timscaffidi/ofxVideoRecorder

Errors while recording, I can't build the file

Closed this issue · 6 comments

Hi, I've installed the addon, I have ffmpeg installed (the one from Ubuntu packages, Ubuntu 12.04 64 bits) since a while.
I can run ffmpeg commands from console and record the streaming from a webcam in this way:
ffmpeg -f video4linux2 -r 25 -s 640x480 -i /dev/video0 out2.avi

However when running the example I got these errors, so any file is built:

"The video recorder failed to write some frames!"
"The video recorder failed to write some audio samples!"

I don't know if something related with codec issues or maybe a different version of ffmpeg as well, since Ubuntu version is a fork. I appreciate any hint to solve this.
Thanks

Ro

Some common things to check would be making sure that your ffmpeg install supports encoding for the chosen audio and video codecs that you are trying to use. Run ffmpeg -codecs to see a list of codecs and their capabilities. Also ensure that the container format you are using is also included in your ffmpeg install by checking the out put of ffmpeg -formats

I will need more information to help any further. Please post the full output of the example app leading up to and including the error messages. This will help to better diagnose the issue.

I just noticed an issue that may have caused your problem: The bin/data folder did not exist in a fresh install, which would cause the video and audio pipes to not be created. I just fixed this on master so please re-pull and try it now. Let me know if this fixes your issue.

Hi thanks for your response :). I got the new version, same results and message.

ofxvideorecorderoutput

It says the PIPE is broken.

I have the codecs needed (ffmpeg -codecs) and the container format it's included as well (ffmpeg -formats). Unfortunately I can't attach the output of these commands.
The news issue is that two files were created under the data folder: ofxarpipe0 ofxvrpipe0

Best regards

By default the example app is set up to record video and audio. If you do not have a microphone configured, or it cannot open properly, you may get this error. Try to use the video only settings by commenting out line 95, and uncommenting line 96 of the example ofApp.cpp

Well it seems I am getting closer. It records an empty file, when I try to play it, I got this message
This file contains no playable streams.

It seems our line numbers don't match. Just in case
I commented out this:
// vidRecorder.setup(fileName+ofGetTimestampString()+fileExt, vidGrabber.getWidth(), vidGrabber.getHeight(), 30, sampleRate, channels);

Then I uncommented this one:
vidRecorder.setup(fileName+ofGetTimestampString()+fileExt, vidGrabber.getWidth(), vidGrabber.getHeight(), 30); // no audio

I think my microphone is well configured since I can record audio with another programs like arecord.
However when I issue ffmpeg arecord -L in the command line I get:
Unable to find a suitable output format for 'arecord'.
I need to go deeper with this clue. I can't record audio with ffmpeg.

Thanks a lot for your help :)

Although I got it working with ffmpeg, I can recording video & audio, or just audio. I can't get the example working.

Just for the record:

audio & video:
ffmpeg -f alsa -ac 2 -i default -itsoffset 00:00:00.5 -f video4linux2 -s 320x240 -r 25 -i /dev/video0 outaudui.mpg

audio:
ffmpeg -f alsa -ac 2 -i pulse -acodec libmp3lame -ab 96k outputk.mp3D
ffmpeg -f alsa -ac 2 -i pulse -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -y myVOICE.wav

I tryed the ffmpeg command line you construct in your addon, but it doesn't work for me.
I think it has to do with the multiple ffmpeg configuration possibilities and their combination or maybe some drivers issues that I can't figure out properly.

Thanks a lot anyway, your suggestions put me in the right way for finding where my problem is.
Best!