Chapter 10. Stream from encoding cards and other capture peripherals
Software encoding cards
Under GNU/Linux
Install the Video for Linux drivers
If you want to stream from an acquisition card or a webcam, a video4linux driver must be available for it. You can find
more information about video4linux and supported devices here (http://www.exploits.org/v4l).
Compile the right module for your device, and insert it into your kernel. Some video4linux modules are shipped with the
2.4.x and 2.6.x Linux kernels, the patch is available on the Video4Linux HQ (http://bytesex.org/v4l).
You can test your device by using any of the listed programs in the Video: TV and PVR/DVR section of this page
(http://www.exploits.org/v4l/).
Note that v4l2 modules will also work with VLC.
Stream with VLC
Note: You must add --enable-v4l to ./configure to use this feature.
% vlc -vvv --color v4l:///dev/video:norm=secam:frequency=543250:size=640x480:channel=0:adev=/dev/dsp:audio=0
--sout ’#transcode{vcodec=mp4v,acodec=mpga,vb=3000,ab=256,venc=ffmpeg{keyint=80,hurry-up,vt=800000},deinterlace}:rtp{mux=ts,dst=239.255.12.13,port=5004}’ --ttl 12
Note: You can find all transcode options on this page : Advanced streaming using the command line .
where:
• /dev/video is the device corresponding to your acquisition card or your webcam,
• norm=secam is name of the standard of the analogic signal (possible values are pal, secam, and ntsc) ,
• frequency=543250 is the frequency of the channel in kHz (Warning : for VLC < 0.6.1, Frequency is channel frequency
in MHz multiplied by 16),
• size=640x480 is the size of the video you want (you can also put the standard size like subqcif (128x96), qsif
(160x120), qcif (176x144), sif (320x240), cif (352x288) or vga (640x480)),
• channel=0 is the number of the channel (usually 0 is for tuner, 1 for composite and 2 for svideo),
• adev=/dev/dsp is the audio device,
• audio=1 is the number of the audio channel (usually 0 is for mono and 1 for stereo),
• vcodec=mp4v is the video format you want to encode in (mp4v is MPEG-4, mpgv is MPEG-1, and there is also h263,
DIV1, DIV2, DIV3, I420, I422, I444, RV24, YUY2),
• acodec=mpga is the audio format you want to encode in (mpga is MPEG audio layer 2, a52 is A52 i.e. AC3 sound),
• vb=3000 is the video bitrate in Kbit/s
• ab=256 is the audio bitrate in Kbit/s
• venc=ffmpeg allows to set the encoder to use, where:
• keyint=80 is the maximal amount of frames between two key frames
49
Comentários a estes Manuais