preview video while ffmpeg is recording

Daniel Armstrong daniel-r35aSzp7v8jQT0dZR+AlfA at public.gmane.org
Tue Dec 1 08:36:57 UTC 2009


On Mon, Nov 30, 2009 at 6:19 PM, Brandon Sandrowicz <bsandrow-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> mplayer might work better than vlc for your buffering issues[1].
> There's even options to control the buffer size if you need to.
>
> I would suggest Alsa or PulseAudio instead of OSS (I've always had
> issues with OSS, esp crackling/etc in audio at times), but it looks
> like ffmpeg might not support Alsa.[2]
>
> My suggestion would be to try mencoder for recording from your webcam.
> There are some suggestions here[3] under the iSight section for using
> mencoder. ffmpeg or gstreamer (thought only the gstreamer suggestion
> has a preview). There are also some webcam suggestions here[4].
>
> You could probably just do what you are doing but with mencoder and
> pipe it through tee to mplayer. Mplayer might have a better handle on
> the video if you *don't* use an avi file (since it won't be indexed)
> but it should play it fine nonetheless. You might want to tell
> mplayer/vlc *not* to play back audio though (lest you end up with a
> feedback loop or just an annoying replay of all the sounds you hear).
>
> [1] http://lists.mplayerhq.hu/pipermail/mplayer-users/2002-May/015919.html
> [2] http://old.nabble.com/Capture-audio-from-alsa-td15819836.html
> [3] http://www.odi.ch/prog/macbookpro/index.php
> [4] http://leese.info/projekte/webcam.htm

Hi Brandon... Thanks for the suggestions and links!

Using mplayer with buffering did the trick... It works! My one-liner:

ffmpeg -f oss -i /dev/dsp -f video4linux2 -qscale 1 -r 30 -s 320x240
-i /dev/video0 -f avi - | tee output.avi | mplayer -cache 1024
-nosound -

... records audio and video from my netbook's webcam, generates a
preview window, and saves the output to a video file. Yes!

There are a few other features I want to put in my shell script and -
besides my netbook camera - I picked up a Sony PS3 Eye webcam that I
want to start investigating. I will post back my results.

That preview window thing was a bit of a roadblock... Thanks again for
pointing me in the right direction!

-- 
Daniel Armstrong
http://wooush.com
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list