[MEncoder-users] Using mencoder to stream to icecast

A. Schmid sahib at phreaker.net
Thu Apr 24 21:33:01 CEST 2008


Guillermo Salas M. wrote:
> I'm capturing the channel 7 from the TV at Anywhere to an /tmp/pipe file
> created with : mknod /tmp/pipe p
> 
> 
> This is the command that I'm using to capture and stream:
> 
> mencoder tv://7 -tv driver=v4l2:device=/dev/video0:fps=29.97: \
> chanlist=us-bcast:audiorate=16000:norm=NTSC:input=0:amode=1:  \
> volume=100:channel=SE7 -ovc copy -oac copy -o /tmp/pipe - |   \
> /usr/bin/ffmpeg2theora --artist "TV Manabi" --title "Stream de TV \
> Manabi" --date "6-4-2008" --location "Manabi" --organization   \
> "tvmanabi.com" --copyright "2008 tvmanabi.com" --license "creative \
>  commons share alike" -x 320 -y 240 -F 25 -v 1 -a 1 -c 1 -H 22050 \
>  -o /dev/stdout - | oggfwd -p -d "Stream de TV Manabi" -g "TV" \
> -n "TV Manabi" -u "www.tvmanabi.com" my.icecastserver.com 8000 \
>  mypassword /mountpoint.ogg

Why do you pipe the mencoder output (this is stdout - i.e. the encoding
statistics!) into ffmpeg2theora?
Instead, you  should use /tmp/pipe as input file for ffmpeg2theora
(instead of "-").

Try something like:
mencoder (options...) -o /tmp/pipe tv://7 > /tmp/mencoder.log &
ffmpeg2theora (options...) -o /tmp/pipe2 /tmp/pipe > /tmp/f2t.log &
oggfwd (options...) < /tmp/pipe2 &

Even better, reverse the order of the commands above. This lowers the
risk of filling the small buffers of the named pipes (by having the next
program in line aready waiting for input). You may also want to test
this setup by running the three commands in seperate terminals (to see
their messages), then you should leave out the "&"s.

I'm not sure if ffmpeg2theora supports outputting video to stdout,
mencoder does not (at least, I don't know how).

Regards
Alex






More information about the MEncoder-users mailing list