Comments (9)
it is hard for me to say exactly without seeing your code, but It looks like you are sending either too much or too little information for each frame. For example you might be sending a 640x480 frame of pixels but the recorder is expecting 1024x768, or vise-versa.
from ofxvideorecorder.
I had this at the end of my setup method.
if(!vidRecorder.isInitialized())
{
vidRecorder.setup(fileName+ofGetTimestampString()+fileExt, ofGetWidth(), ofGetHeight(), 30); // no audio
}
Now I had the window mode set to fullscreen intitially and that gave me scanlines on the output, so I made it not full screen and I got the frames I already mentioned and then I set it to 640, 480 and I got more scanlines.
I was using this code in my update loop
ofImage img;
img.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
vidRecorder.addFrame(img.getPixelsRef());
from ofxvideorecorder.
I would advise against using ofGetWidth/Height with the video recorder as these values can change if you resize the window, and also I don't know that they will have the correct values if called within the setup function, as the window may not have been given its final size yet. Try hardcoding the width and height in both the setup method and within your update method, this should solve your problem.
I usually draw my entire scene to a FBO which has a fixed size (1920x1080 for example), then I can easily get the pixels from the FBO and save to the recorder. This has the added benefit of allowing me to draw the FBO to the screen at any size: should I need to support different resolution displays, just draw the FBO to fit within the window.
from ofxvideorecorder.
Aw man that worked perfectly! Great addon.
How would you do the FBO object?
from ofxvideorecorder.
OF comes with an FBO example in the examples/gl/fboTrailsExample folder. If you need additional help with FBOs, make a topic in the OF forums and I'll be glad to look at it there.
from ofxvideorecorder.
Hi Tim, the addon works great with the videoGrabber, I have been struggling to get it recording from an FBO. This is what I get: gif
I'm modding the example trails you mentioned.
I allocate by ofPixels like so fboPix.allocate(640,480,OF_PIXELS_RGBA)
Then I do:
rgbaFbo.readToPixels(fboPix); vidRecorder.addFrame(fboPix);
I've made sure the videoRecorder.setup width/height matches. Could the pixel data
Would you be so kind as to updating the example with a working FBO version? I'm all out of ideas.
from ofxvideorecorder.
@samelie you should probably create a new bug. this seems non related.
anyways, try rgb, instead of rgba!
from ofxvideorecorder.
@samelie , I believe @kritzikratzi is correct. Using RGBA for the FBO will not work because the video grabber is expecting RGB. The resulting gif you posted looks so strange because because you are sending 4 byte per pixel, and the video grabber is expecting 3.
from ofxvideorecorder.
fboPixels.allocate(fboWidth, fboHeight, OF_PIXELS_RGBA);
recorderPixels.allocate(fboWidth, fboHeight, OF_PIXELS_RGB);
fbo.readToPixels(fboPixels);
for (int i = 0; i < fboWidth * fboHeight; i++) {
int pix = i * 4;
int pixRgb = i * 3;
int r = fboPixels[pix];
int g = fboPixels[pix + 1];
int b = fboPixels[pix + 2];
recorderPixels[pixRgb] = r;
recorderPixels[pixRgb + 1] = g;
recorderPixels[pixRgb + 2] = b;
}
bool success = vidRecorder.addFrame(recorderPixels);
Ahha, nice one, my shader outputs RGBA! Thanks guys, works great!
from ofxvideorecorder.
Related Issues (20)
- Add iOS support HOT 2
- App OF submitted to the problems encountered in Mac Store
- What the problem is ? HOT 1
- write to PIPE failed with error -> 32 - Broken pipe HOT 4
- For some reason, Ubuntu no longer switches threads for me... HOT 20
- Can I record OF output HOT 1
- Add no audio option HOT 1
- pixelFormat = "rgba" HOT 7
- No audio on Windows using branch osx-and-win HOT 5
- c930
- Ambiguous function name + example needed HOT 1
- can not open the recorded video file in recordingComplete function HOT 6
- Video recording issue - scrambled images HOT 4
- Files not being saved HOT 1
- Problems saving in a specific folder HOT 4
- Audio recording: system exception: cannot lock mutex
- Support for OF 0.10.0 HOT 3
- Windows VS2017, 0.10 master branch, added Poco but error about <unistd.h> HOT 2
- Trying to use this addon HOT 1
- ofxVideoRecorder seems to fail when the path to app (and ffmpeg) has spaces in it HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxvideorecorder.