timscaffidi / ofxVideoRecorder

A fast multi-threaded video recording extension using ffmpeg
Other
229 stars 97 forks source link

where is the recorded file? #12

Closed ayanoco closed 9 years ago

ayanoco commented 10 years ago

1.Where was the file saved ? There are no mov. in the "bin" folder. 2.I would like to save the movie drawn by my project in the file. Is it possible with your ofxVideoRecorder? Where should I rewrite? Now the FaceTime HD camera has been attached. Sorry for elementary question. Any help would be appreciated. Thank you.

timscaffidi commented 10 years ago

The video should be in bin/data/. I'm not sure i understand your second question, but if you want to save to a specific location it would be possible by using the setupCustomOutput function and providing the command line options directly to ffmpeg, one of them being the output file location. I hope this helps.

ayanoco commented 10 years ago

Now I could make .mov file in bin/data. Thank you! But I can't open the mov. file.. even in VLC media player. In this case, do you think the way I install the ffmepg was wrong? Sorry for poor English..

timscaffidi commented 10 years ago

If you are unable to open the file, it could be a few things. Are you certain you have ffmpeg installed correctly? do you see any errors from it in the console? It could be that the default combination of audio and video codecs are not supported by your version of ffmpeg. You can try changing them. run ffmpeg -codecs to see what codecs are available, if they have an E in the first column, then they support encoding.

You can also try a different container than .mov, you could use .mp4 if you want, or .avi

It may also be that quicktime cant open the file but maybe VLC can.

I hope this helps

ayanoco commented 10 years ago

Thank you for replying Now I'm trying with "mpeg4" and "mp3" combination and set fileExt=".mov", for example. When I run "ffmpeg-codecs", I see the lines like DEV.L. mpeg4 MPEG-4 part 2 (encoders: mpeg4 libxvid ) DEA.L. mp3 MP3 (MPEG audio layer 3) (decoders: mp3 mp3float ) (encoders: libmp3lame ) and when I run "ffmpeg-formats", I see the lines like E mov QuickTime / MOV E mp4 MP4 (MPEG-4 Part 14) They all have "E" so I thought it's no problem here..am I right ? I wonder why.. :(

timscaffidi commented 10 years ago

right, that looks like it should work.

How about errors on the command line? is the program properly closing the video file? are any frames being added to it? Post your console output from a short run, and I might be able to get a better insight

ayanoco commented 10 years ago

That was the problem.. I've only seen the last line saying "being terminated!" and thought "ok!" Excuse me. Now I'm trying NOT to attach video device and capture the Fbo seeing this page ( It's Japanese though http://blog.rettuce.com/openframeworks/fbo_capture/

And here's the short run. I hope this is the "short run". [verbose] ofFbo: GL frame buffer object supported [verbose] ofFbo: checkGLSupport(): maxColorAttachments: 8, maxDrawBuffers: 8, maxSamples: 8 [verbose] ofFbo: FRAMEBUFFER_COMPLETE - OK [warning] ofQTKitGrabber: setDesiredFrameRate(): cannot set framerate for QTKitGrabber DVFreeThread - CFMachPortCreateWithPort hack = 0xa4efd0, fPowerNotifyPort= 0xa4efb0 DVFreeThread - CFMachPortCreateWithPort hack = 0xa4ff60, fPowerNotifyPort= 0xa4f1a0 [verbose] ofQTKitGrabber: attached video device: FaceTime HD Camera [verbose] ofQTKitGrabber: starting video session ffmpeg version 2.3.1 Copyright (c) 2000-2014 the FFmpeg developers built on Aug 2 2014 11:37:10 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid libavutil 52. 92.100 / 52. 92.100 libavcodec 55. 69.100 / 55. 69.100 libavformat 55. 48.100 / 55. 48.100 libavdevice 55. 13.102 / 55. 13.102 libavfilter 4. 11.100 / 4. 11.100 libavresample 1. 3. 0 / 1. 3. 0 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 19.100 / 0. 19.100 libpostproc 52. 3.100 / 52. 3.100 [verbose] ofxVideoRecorder: avDelta = -0.0333333. Too many video frames, skipping.

[verbose] ofxVideoRecorder: avDelta = -0.0333333. Too many video frames, skipping. ......skip,skip,skip...... [verbose] ofxVideoRecorder: avDelta = -0.0333333. Too many video frames, skipping.

Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, s16le, from '/Volumes/HDD/of_v0.8.1_osx_release/apps/myApps/pendulum/bin/data/ofxarpipe0': Duration: N/A, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s Input #1, rawvideo, from '/Volumes/HDD/of_v0.8.1_osx_release/apps/myApps/pendulum/bin/data/ofxvrpipe0': Duration: N/A, bitrate: 221184 kb/s Stream #1:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 640x480, 221184 kb/s, 30 tbr, 30 tbn, 30 tbc Please use -b:a or -b:v, -b is ambiguous Output #0, avi, to '/Volumes/HDD/of_v0.8.1_osx_release/apps/myApps/pendlum/bin/data/testMovie2014-08-14-00-18-00-413.avi': Metadata: ISFT : Lavf55.48.100 Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480, q=2-31, 800 kb/s, 30 fps, 30 tbn, 30 tbc Metadata: encoder : Lavc55.69.100 mpeg4 Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 192 kb/s Metadata: encoder : Lavc55.69.100 libmp3lame Stream mapping: Stream #1:0 -> #0:0 (rawvideo (native) -> mpeg4 (native)) Stream #0:0 -> #0:1 (pcm_s16le (native) -> mp3 (libmp3lame)) Press [q] to stop, [?] for help frame= 0 fps=0.0 q=0.0 Lsize= 10kB time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used) [verbose] ofEvents: OF app is being terminated!

timscaffidi commented 10 years ago

I see that it is skipping tons of frames. Are you actually recording audio as well? In order to keep things in sync, it will skip/repeat video frames as needed depending on the amount of time accumulated in the audio stream. So if you have it set up to record audio, but you dont send it any audio frames, then you also wont get any video.

You can make not record audio at all and then it will always record the video frame you give it.

ayanoco commented 10 years ago

That's really helpful :) Actually I've muted"//" the audio line of somewhere. I'll check and try it and tell you the result before long. I'm sorry I have to go today.. Thank you :)

ayanoco commented 9 years ago

Hello, (( I'm sorry it was long )) As you mentioned, it was the problem of the sounds. I had not been able to understand what you wrote in README but now I can :) , and also I’m able to record and open the file. Thanks! But there’s still the problem of the quality of the image.The color of the recorded file is more dark than the original color. Short-run says like this: … [warning] ofThread: - name: Thread 3 - Calling startThread with verbose is deprecated. [warning] ofThread: - name: Thread 1 - Calling startThread with verbose is deprecated. … Should I do something with ofThread to improve the image quality? Or should I check another point? Any help would be appreciated. Thank you.

timscaffidi commented 9 years ago

Those warnings have nothing to do with the video quality.

Try using a different video codec and/or bitrate to see if it changes the output color.

ayanoco commented 9 years ago

I could do it with "prores", but with "h264", I can't open the recorded file. Short run says "No pixel format specified, yuv444p for H.264 encoding chosen."...Is this the reason why I can't open the file? What's the matter with h264...?

timscaffidi commented 9 years ago

h264 support is highly dependent on your build of ffmpeg, some have support, others dont

ayanoco commented 9 years ago

I see.. I can see "E" in the h264 line but you mean there's many kind of h264 ? Maybe there're more issues that I should study. Anyway, thank you again, it was really helpful :)

timscaffidi commented 9 years ago

If your ffmpeg supports it, then you may just need to find a container to use with it that will work on your platform. On Mac, quicktime usually likes h264 with a .mp4 container. If you are using VLC to play files then it will support h264 within more containers.

timscaffidi commented 9 years ago

Also, h264 may need additional parameters aside from just the bitrate in order to get a working video. For now, you can specify those options using a custom output string with ofxVideoRecorder::setupCustomOutput()