preview video while ffmpeg is recording

Daniel Armstrong daniel-r35aSzp7v8jQT0dZR+AlfA at public.gmane.org
Mon Nov 30 03:40:40 UTC 2009


I am trying my hand at learning shell scripting beyond 1-2 liners...
and I am trying to create a script that uses ffmpeg to record video
from a webcam and vlc to display a preview of the video while
recording.

After trial-and-(much)error I find...

This command captures the video successfully:

ffmpeg -f oss -i /dev/dsp -f video4linux2 -qscale 1 -r 30 -s 320x240
-i /dev/video0 ${OUTPUT}

This command streams video from /dev/video0:

vlc v4l2:///dev/video0

This command streams from a (already existing) video file:

vlc ${INPUT} --sout "#display{noaudio,delay=4000}"

Now I am trying to combine the 2 activites together - record a video
in ffmpeg and simultaneously see a preview in cvlc - and am kinda hazy
about how to make this happen. I have tried:

- running cvlc first followed by ffmpeg... also tried the reverse
- piping ffmpeg's video output into clvc:
ffmpeg -f oss -i /dev/dsp -f video4linux2 -qscale 1 -r 30 -s 320x240
-i /dev/video0 ${OUTPUT} | vlc - --sout "#display{noaudio,delay=4000}"

... and googled and played around with settings but no joy. I have
also started to investigate using mplayer in place of cvlc... either
would be fine for my purpose.

Any help getting these 2 programs to play nice together would be
greatly appreciated!

-- 
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