Table of Contents
This is possible under GNU/Linux only.
VideoLAN supports two kinds of MPEG-2 encoding cards:
Hauppauge WinTV-PVR-250 and WinTV-PVR-350,
Visiontech Kfir.
The Hauppauge WinTV-PVR-250/350 gives much better results and is cheaper than the Visiontech Kfir.
First, you will have to patch your kernel to support the v4l2 API (Video 4 Linux version 2). The patch is available on the Video4Linux HQ.
Once your kernel is ready, install the CVS version of the Linux drivers for the Hauppauge WinTV-PVR-250/350. They are hosted on ivtv.sourceforge.net. Then, you will have to create the device and load the modules; for this, please refer to the documentation shipped with the drivers.
You must add --enable-pvr to ./configure to use this feature.
%
vlc -vvv pvr:/dev/video0:norm=secam:size=720x576:frequency=576250: bitrate=3000000:maxbitrate=4000000 --sout udp:192.168.0.42 --ttl 12 --cr-average 1000
where :
/dev/video0 is the device corresponding to the encoding card ,
norm=secam is name of the standard of the analogic signal (possible values are pal, secam, and ntsc) ,
size=720x576 is the size of the video you want to stream ,
frequency=567250 is the frequency in kHz of the channel you want to stream ,
bitrate=3000000 is the average bitrate of the stream ,
maxbitrate=4000000 is the maximum bitrate of the stream ,
192.168.0.42 is either :
the IP address of the machine you want to unicast to ;
or the DNS name the machine you want to unicast to ;
or a multicast IP address.
12 is the value of the TTL (Time To Live) of your IP packets (which means that the stream will be able to cross 11 routers).
1000 is a secret value to work around a bug of the card.
You must use the SVN version of VLS.
There is no command line interface for this input for the moment, so you will have to use the configuration file.
Here is a typical configuration file
vls.cfg
to run VLS with a Hauppauge WinTV-PVR-250/350
encoding card:
# vls.cfg (VLS configuration file) # Example of the VideoLAN HOWTO for Hauppauge WinTV-PVR-250/350 encoding cards begin "inputs" pvr0 = "video" end begin "input" trickplay = "normal" end begin "pvr0" # This card is a Hauppauge WinTV-PVR-250/350 cardtype = "pvr" # Device name device = "/dev/video0" # Stream type type = "mpeg2-ps" # Norm : put "pal", "secam" or "ntsc" norm = "pal" # Framerate : put "30" for NTSC and "25" for PAL and SECAM framerate = "25" # Input number : put - "0" for Composite on S-video plug # - "4" for tuner # - "6" for S-video on S-video plug inputnumber = "4" # If you use the tuner, put the frequency frequency = "567250" # Image size : put "widthxheight" or "subqcif" (128x96) or "qsif" (160x120) # or "qcif" (176x144) or "sif" (320x240) or "cif" (352x288) or "vga" (640x480) size = "720x576" # Bitrate in Kbit/s bitrate = "7000" # Maximum bitrate in Kbit/s maxbitrate = "9000" # Bitrate mode : put "cbr" (constant bitrate) or "vbr" (variable bitrate) bitratemode = "vbr" end begin "channels" channel1 = "network" end begin "channel1" # Unicast or multicast IP address dsthost = "192.168.0.42" # Destination port dstport = "1234" # If it's a multicast IP address, uncomment the line below #type = "multicast" # If it's a multicast IP address, set the "Time To Live" below #ttl = "12" end begin "launchonstartup" command1 = "start video channel1 pvr0" end
Once you have adapted the configuration file above, run VLS:
%
vls -vv -f vls.cfg
If you want to be able to stream from a Visiontech Kfir card, you need to install its Linux drivers. Download the latest release of the drivers from the drivers download page of the LinuxTV web site.
Uncompress the tarball and follow the instructions
written in the INSTALL
file to compile and install
the drivers.
If you have a VIA chipset, you need to disable USB in the BIOS.
%
vlc -vvv kfir:/dev/video --sout udp:192.168.0.42 --ttl 12
where :
/dev/video
is the device corresponding to the Kfir card
,
192.168.0.42 is either :
the IP address of the machine you want to unicast to ;
or the DNS name the machine you want to unicast to ;
or a multicast IP address.
12 is the value of the TTL (Time To Live) of your IP packets (which means that the stream will be able to cross 11 routers).
There is no command line interface for this input for the moment, so you will have to use the configuration file.
Here is a typical configuration file
vls.cfg
to run VLS with a VisionTech Kfir
encoding card:
# vls.cfg (VLS configuration file) # Example of the VideoLAN HOWTO for the Visiontech Kfir encoding card BEGIN "Inputs" kfir = "video" END BEGIN "kfir" # Visiontech Kfir device Device = "/dev/video" # Stream type (default is "Mpeg2-PS") Type = "Mpeg2-PS" END BEGIN "Channels" channel1 = "network" END BEGIN "channel1" # Unicast or multicast IP address DstHost = "192.168.0.42" # Destination port DstPort = "1234" # If it's a multicast IP address, uncomment the line below #Type = "multicast" # If it's a multicast IP address, set the "Time To Live" below #TTL = "12" END BEGIN "LaunchOnStartUp" command1 = "start video channel1 kfir" END
Once you have adapted the configuration file above, run VLS:
%
vls -vv -f vls.cfg