Difference between revisions of "Documentation:Streaming HowTo/Stream from Encoding Cards and Other Capture Devices"

From VideoLAN Wiki
Jump to navigation Jump to search
(Original import from docbook. Still needs to be converted to wiki.)
 
(wikify)
Line 1: Line 1:
<?xml version="1.0" encoding="UTF-8"?>
+
==Hardware encoding cards==
<chapter id="hardencoding"><title id="thardencoding">
 
Stream from encoding cards and other capture peripherals
 
</title>
 
  
<!-- TODO: Complete DirectShow -->
+
Note: This is possible under GNU/Linux only.
  
<sect1><title>Hardware encoding cards</title>
 
 
<note><para>
 
This is possible under GNU/Linux only.
 
</para></note><para>
 
 
VideoLAN supports two kinds of MPEG-2 encoding cards:
 
VideoLAN supports two kinds of MPEG-2 encoding cards:
</para>
+
* Hauppauge WinTV-PVR-250 and WinTV-PVR-350,
 +
* Visiontech Kfir.
  
<itemizedlist>
+
The Hauppauge WinTV-PVR-250/350 gives much better results and is cheaper than the Visiontech Kfir.
  
<listitem><para>
+
===Stream with the Hauppauge WinTV-PVR-250/350 card===
 +
====Install the drivers====
  
Hauppauge WinTV-PVR-250 and WinTV-PVR-350,
+
First, you will have to patch your kernel (version 2.4) to support the v4l2 API (Video 4 Linux version 2). The patch is available on the [http://bytesex.org/v4l/ Video4Linux HQ].
 
 
</para></listitem>
 
 
 
<listitem><para>Visiontech Kfir.</para></listitem>
 
 
 
</itemizedlist>
 
 
 
<para>
 
The Hauppauge WinTV-PVR-250/350 gives much better
 
results and is cheaper than the Visiontech Kfir.
 
</para>
 
 
 
<sect2><title>
 
Stream with the Hauppauge WinTV-PVR-250/350 card
 
</title>
 
 
 
<sect3><title>
 
Install the drivers
 
</title>
 
 
 
<para>
 
First, you will have to patch your kernel (version 2.4) to support
 
the v4l2 API (Video 4 Linux version 2). The patch is available on the
 
<ulink url="http://bytesex.org/v4l/">Video4Linux HQ</ulink>.
 
 
If you use a 2.6 kernel, you only need to build I2C support and the BT848 Video For Linux module.
 
If you use a 2.6 kernel, you only need to build I2C support and the BT848 Video For Linux module.
</para>
 
 
<para>
 
Once your kernel is ready, install the CK version (currently in development) of the Linux drivers for the Hauppauge WinTV-PVR-250/350. They are hosted on
 
<ulink url="http://67.18.1.101/~ckennedy/ivtv">ivtv ck</ulink>. You will need to patch your kernel to use it with a 2.4. You can also use the CVS version available here: <ulink url="http://ivtv.sourceforge.net/">ivtv.sourceforge.net</ulink> (this version is not developped anymore).
 
Then, you will have to create the device and load the modules; for this,
 
please refer to the documentation shipped with the drivers.
 
</para>
 
 
</sect3>
 
 
<sect3><title>
 
Stream with VLC
 
</title>
 
 
<note><para>
 
You must add <command>--enable-pvr</command>
 
to <command>./configure</command> to use this
 
feature.
 
</para></note>
 
 
<screen>
 
<prompt>% </prompt><userinput>vlc -vvv --color pvr:/dev/video0:norm=secam:size=720x576:frequency=576250:
 
bitrate=3000000:maxbitrate=4000000 --cr-average 1000 --sout udp:192.168.0.42 --ttl 12</userinput>
 
</screen>
 
 
<para>
 
where
 
 
 
:
 
</para>
 
 
<itemizedlist>
 
 
<listitem><para><emphasis>/dev/video0</emphasis>
 
is the device corresponding to the encoding card
 
,</para></listitem>
 
 
<listitem><para><emphasis>norm=secam</emphasis>
 
is name of the standard of the analogic signal
 
(possible values are pal, secam, and ntsc)
 
,</para></listitem>
 
 
<listitem><para><emphasis>size=720x576</emphasis>
 
is the size of the video you want to stream
 
,</para></listitem>
 
 
<listitem><para><emphasis>frequency=567250</emphasis>
 
is the frequency in kHz of the channel you want to
 
stream
 
,</para></listitem>
 
 
<listitem><para><emphasis>bitrate=3000000</emphasis>
 
is the average bitrate of the stream
 
,</para></listitem>
 
 
<listitem><para><emphasis>maxbitrate=4000000</emphasis>
 
is the maximum bitrate of the stream
 
,</para></listitem>
 
 
<listitem><para><emphasis>1000</emphasis> is a secret value to work around a bug of the card.
 
</para></listitem>
 
 
<listitem><para><emphasis>192.168.0.42</emphasis>
 
is either :
 
</para>
 
 
<itemizedlist>
 
<listitem><para>
 
the IP address of the machine you want to unicast
 
to
 
;</para></listitem>
 
 
<listitem><para>
 
or the DNS name the machine you want to unicast
 
to
 
;</para></listitem>
 
 
<listitem><para>
 
or a multicast IP address.
 
</para></listitem>
 
 
</itemizedlist>
 
 
</listitem>
 
 
<listitem><para><emphasis>12</emphasis>
 
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).
 
</para></listitem>
 
 
</itemizedlist>
 
 
</sect3>
 
 
</sect2>
 
 
<sect2><title>
 
Stream with the Visiontech Kfir card
 
</title>
 
 
<sect3><title>
 
Install the drivers
 
</title>
 
  
<para>
+
Once your kernel is ready, install the CK version (currently in development) of the Linux drivers for the Hauppauge WinTV-PVR-250/350. They are hosted on [http://67.18.1.101/~ckennedy/ivtv ivtv ck]. You will need to patch your kernel to use it with a 2.4. You can also use the CVS version available here: [http://ivtv.sourceforge.net/ ivtv.sourceforge.net] (this version is not developped anymore).
If you want to be able to stream from a
+
Then, you will have to create the device and load the modules; for this, please refer to the documentation shipped with the drivers.
Visiontech Kfir card, you need to install its Linux drivers.
 
Download the latest release of the drivers from the <ulink url="http://www.linuxtv.org/download/mpeg2/">drivers download
 
page</ulink> of the <ulink url="http://www.linuxtv.org/">LinuxTV web
 
site</ulink>.
 
</para><para>
 
Uncompress the tarball and follow the instructions
 
written in the <filename>INSTALL</filename> file to compile and install
 
the drivers.
 
</para>
 
  
<note><para>
+
====Stream with VLC====
If you have a VIA chipset, you need to disable USB
 
in the BIOS.
 
</para></note>
 
  
</sect3>
+
Note: You must add '''--enable-pvr''' to '''./configure''' to use this feature.
  
<sect3><title>
+
% '''vlc -vvv --color pvr:/dev/video0:norm=secam:size=720x576:frequency=576250:bitrate=3000000:maxbitrate=4000000 --cr-average 1000 --sout udp:192.168.0.42 --ttl 12'''
  
Stream
+
where:
</title>
+
*'''/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,
 +
*'''1000''' is a secret value to work around a bug of the 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).
  
<screen>
+
===Stream with the Visiontech Kfir card===
<prompt>% </prompt><userinput>vlc -vvv --color kfir:/dev/video --sout udp:192.168.0.42 --ttl 12</userinput>
 
</screen>
 
  
<para>where
+
====Install the drivers====
:</para>
 
  
<itemizedlist>
+
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 [http://www.linuxtv.org/download/mpeg2/ drivers download page] of the [http://www.linuxtv.org/ LinuxTV web
 +
site].
  
<listitem><para><filename>/dev/video</filename>
+
Uncompress the tarball and follow the instructions written in the ''INSTALL'' file to compile and install the drivers.
is the device corresponding to the Kfir card
 
,</para></listitem>
 
  
<listitem><para><emphasis>192.168.0.42</emphasis>
+
Note: If you have a VIA chipset, you need to disable USB in the BIOS.
is either :
 
</para>
 
  
<itemizedlist>
+
====Stream====
<listitem><para>
+
% '''vlc -vvv --color kfir:/dev/video --sout udp:192.168.0.42 --ttl 12'''
the IP address of the machine you want to unicast
+
where:
to
 
;</para></listitem>
 
  
<listitem><para>
+
*'''/dev/video''' is the device corresponding to the Kfir card,
or the DNS name the machine you want to unicast
+
*'''192.168.0.42''' is either :
to
+
**the IP address of the machine you want to unicast to;
;</para></listitem>
+
**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).
  
<listitem><para>
+
==Software encoding cards==
or a multicast IP address.
+
===Under GNU/Linux===
</para></listitem>
+
====Install the Video for Linux drivers====
  
</itemizedlist>
+
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 [http://www.exploits.org/v4l here].
  
</listitem>
 
  
<listitem><para><emphasis>12</emphasis>
+
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 [http://bytesex.org/v4l Video4Linux HQ].
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).
 
</para></listitem>
 
  
</itemizedlist>
+
You can test your device by using any of the listed programs in the ''Video: TV and PVR/DVR'' section of [http://www.exploits.org/v4l/ this page].
  
</sect3>
 
  
</sect2>
 
</sect1>
 
 
<sect1>
 
<title>Software encoding cards</title>
 
 
<sect2><title>Under GNU/Linux</title>
 
 
<sect3><title>
 
Install the Video for Linux drivers
 
</title>
 
 
<para>
 
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 <ulink url="http://www.exploits.org/v4l">here</ulink>.
 
</para>
 
 
<para>
 
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
 
<ulink url="http://bytesex.org/v4l">Video4Linux HQ</ulink>.</para>
 
 
<para>You can test your device by using any of the listed
 
programs in the <emphasis>Video: TV and PVR/DVR</emphasis> section of
 
<ulink url="http://www.exploits.org/v4l/">this page</ulink>.
 
</para>
 
 
<para>
 
 
Note that v4l2 modules will also work with VLC.
 
Note that v4l2 modules will also work with VLC.
</para>
 
 
</sect3>
 
 
<sect3><title>
 
Stream with VLC
 
</title>
 
 
<note><para>
 
You must add <command>--enable-v4l</command> to
 
<command>./configure</command> to use this feature.
 
</para></note>
 
 
<screen>
 
<!-- We cut the lines when they are too long, so that it looks OK in PDF format ! -->
 
<prompt>% </prompt><userinput>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}:std{access=udp,mux=ts,dst=239.255.12.13}' --ttl 12</userinput>
 
</screen>
 
 
<note><para>You can find all transcode options on this page : <xref linkend="cmdline" endterm="tcmdline" /> .</para></note>
 
 
<para>where:
 
</para><itemizedlist>
 
 
<listitem><para><filename>/dev/video</filename>
 
is the device corresponding to your acquisition
 
card or your webcam,
 
</para></listitem>
 
 
<listitem><para><emphasis>norm=secam</emphasis>
 
is name of the standard of the analogic signal
 
(possible values are pal, secam, and ntsc)
 
,</para></listitem>
 
 
<listitem><para><emphasis>frequency=543250</emphasis>
 
is the frequency of the channel in kHz
 
(<emphasis>Warning :</emphasis> for VLC &lt; 0.6.1, Frequency is channel
 
frequency in MHz multiplied by 16),
 
</para></listitem>
 
 
<listitem><para>
 
<emphasis>size=640x480</emphasis>
 
is the size of the video you want (you can also put the
 
standard size like <emphasis>subqcif</emphasis> (128x96),
 
<emphasis>qsif</emphasis> (160x120), <emphasis>qcif</emphasis>
 
(176x144), <emphasis>sif</emphasis> (320x240), <emphasis>cif</emphasis>
 
(352x288) or <emphasis>vga</emphasis> (640x480)),
 
</para></listitem>
 
 
<listitem><para><emphasis>channel=0</emphasis>
 
is the number of the channel (usually 0 is for
 
tuner, 1 for composite and 2 for svideo),
 
 
</para></listitem>
 
 
<listitem><para><emphasis>adev=/dev/dsp</emphasis>
 
is the audio device,
 
</para></listitem>
 
 
<listitem><para><emphasis>audio=1</emphasis>
 
is the number of the audio
 
channel (usually 0 is for mono and 1 for stereo),
 
</para></listitem>
 
 
<listitem><para><emphasis>vcodec=mp4v</emphasis>
 
is the video format you want to encode in
 
(<emphasis>mp4v</emphasis> is MPEG-4, <emphasis>mpgv</emphasis> is
 
MPEG-1, and there is also
 
<emphasis>h263</emphasis>, <emphasis>DIV1</emphasis>,
 
<emphasis>DIV2</emphasis>, <emphasis>DIV3</emphasis>,
 
<emphasis>I420</emphasis>, <emphasis>I422</emphasis>,
 
<emphasis>I444</emphasis>, <emphasis>RV24</emphasis>,
 
<emphasis>YUY2</emphasis>),</para></listitem>
 
 
<listitem><para><emphasis>acodec=mpga</emphasis>
 
is the audio format you want to encode
 
in (<emphasis>mpga</emphasis> is MPEG audio layer 2,
 
<emphasis>a52</emphasis> is A52 i.e. AC3 sound),
 
</para></listitem>
 
 
<listitem><para><emphasis>vb=3000</emphasis>
 
is the video bitrate in Kbit/s
 
</para></listitem>
 
 
<listitem><para><emphasis>ab=256</emphasis>
 
is the audio bitrate in Kbit/s
 
</para></listitem>
 
 
<listitem><para><emphasis>venc=ffmpeg</emphasis>
 
allows to set the encoder to use, where: </para>
 
<itemizedlist>
 
<listitem><para><emphasis>keyint=80</emphasis> is the maximal amount of frames between two key frames</para></listitem>
 
<listitem><para><emphasis>hurry-up</emphasis> allows the encoder to decrease the quality of the stream if the CPU can't keep up with the encoding rate</para></listitem>
 
<listitem><para><emphasis>vt=800000</emphasis> is the tolerance in kbit/s for the bitrate of the outputted video</para></listitem>
 
</itemizedlist>
 
</listitem>
 
 
<listitem><para><emphasis>deinterlace</emphasis>
 
tells VLC to deinterlace the video on the fly,
 
</para></listitem>
 
 
<listitem><para><emphasis>192.168.0.42</emphasis>
 
is either:
 
 
</para>
 
 
<itemizedlist>
 
<listitem><para>
 
the IP address of the machine you want to unicast
 
to;
 
</para></listitem>
 
 
<listitem><para>
 
or the DNS name the machine you want to unicast
 
to;
 
 
</para></listitem>
 
 
<listitem><para>
 
or a multicast IP address.</para></listitem>
 
  
</itemizedlist>
+
====Stream with VLC====
  
</listitem>
+
Note: You must add '''--enable-v4l''' to '''./configure''' to use this feature.
  
<listitem><para><emphasis>12</emphasis>
+
% '''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}:std{access=udp,mux=ts,dst=239.255.12.13}' --ttl 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).</para></listitem>
 
  
</itemizedlist>
+
Note: You can find all transcode options on this page : [[Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line|Advanced Streaming Using the Command Line]].
  
</sect3>
+
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
 +
**'''hurry-up''' allows the encoder to decrease the quality of the stream if the CPU can't keep up with the encoding rate
 +
**'''vt=800000''' is the tolerance in kbit/s for the bitrate of the outputted video
 +
*'''deinterlace''' tells VLC to deinterlace the video on the fly,
 +
*'''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).
  
</sect2>
+
==Stream with DirectShow==
</sect1>
+
Note: This is only possible under Windows.
  
<sect1><title>Stream with DirectShow</title>
+
===Install your peripheral drivers===
<note><para>This is only possible under Windows</para></note>
+
You need to install your peripherals under Windows with the appropriate drivers. Nothing else is necessary.
<sect2><title>Install your peripheral drivers</title>
+
===Stream with VLC in command line===
<para>You need to install your peripherals under Windows with the appropriate drivers. Nothing else is necessary.</para>
+
% '''C:\Program Files\VideoLAN\VLC\vlc.exe -vvv -I rc --ttl 12 dshow:// vdev="VGA USB Camera" adev="USB Camera" size="640x480" --sout=#std{mux=ts,access=udp,dst=239.255.42.12}'''
</sect2>
 
<sect2><title>Stream with VLC in command line</title>
 
<para><screen><prompt>% </prompt><userinput>C:\Program Files\VideoLAN\VLC\vlc.exe -vvv -I rc --ttl 12 dshow:// vdev="VGA USB Camera" adev="USB Camera" size="640x480" --sout=#std{mux=ts,access=udp,dst=239.255.42.12}</userinput></screen></para>
 
<note>
 
<para>You need to precise the complete path to find vlc program or to launch the command from the correct directory.</para>
 
</note>
 
<itemizedlist>
 
<listitem><para><emphasis>vvv</emphasis> is to activate the verbose mode</para></listitem>
 
<listitem><para><emphasis>rc</emphasis> is to activate the remote control interface (MS/DOS console)</para></listitem>
 
<listitem><para><emphasis>12</emphasis> 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),
 
</para></listitem>
 
<listitem><para><emphasis>vdev="VGA USB Camera"</emphasis> is the name of the video peripheral that DirectShow will use (this is only an exemple),
 
</para></listitem>
 
<listitem><para><emphasis>adev="USB Camera"</emphasis> is the name of the audio peripheral,
 
</para></listitem>
 
<listitem><para><emphasis>size="640x480"</emphasis> is the resolution (you can also put the standard size like <emphasis>subqcif</emphasis> (128x96),
 
<emphasis>qsif</emphasis> (160x120), <emphasis>qcif</emphasis>
 
(176x144), <emphasis>sif</emphasis> (320x240), <emphasis>cif</emphasis>
 
(352x288) or <emphasis>vga</emphasis> (640x480)).
 
</para></listitem>
 
  
<listitem><para><emphasis>239.255.42.12</emphasis>
+
Note: You need to precise the complete path to find vlc program or to launch the command from the correct directory.
is either:
 
</para>
 
<itemizedlist>
 
<listitem><para>
 
the IP address of the machine you want to unicast to
 
</para></listitem>
 
<listitem><para>
 
or the DNS name the machine you want to unicast to
 
</para></listitem>
 
<listitem><para>
 
or a multicast IP address.</para></listitem>
 
</itemizedlist>
 
</listitem>
 
  
</itemizedlist>
+
*'''vvv''' is to activate the verbose mode
</sect2>
+
*'''rc''' is to activate the remote control interface (MS/DOS console)
</sect1>
+
*'''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),
</chapter>
+
*'''vdev="VGA USB Camera"''' is the name of the video peripheral that DirectShow will use (this is only an exemple),
 +
*'''adev="USB Camera"''' is the name of the audio peripheral,
 +
*'''size="640x480"''' is the resolution (you can also put the standard size like ''subqcif'' (128x96), ''qsif'' (160x120), ''qcif''
 +
(176x144), ''sif'' (320x240), ''cif'' (352x288) or ''vga'' (640x480)).
 +
*'''239.255.42.12''' 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.

Revision as of 10:45, 30 March 2007

Hardware encoding cards

Note: 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.

Stream with the Hauppauge WinTV-PVR-250/350 card

Install the drivers

First, you will have to patch your kernel (version 2.4) to support the v4l2 API (Video 4 Linux version 2). The patch is available on the Video4Linux HQ. If you use a 2.6 kernel, you only need to build I2C support and the BT848 Video For Linux module.

Once your kernel is ready, install the CK version (currently in development) of the Linux drivers for the Hauppauge WinTV-PVR-250/350. They are hosted on ivtv ck. You will need to patch your kernel to use it with a 2.4. You can also use the CVS version available here: ivtv.sourceforge.net (this version is not developped anymore). Then, you will have to create the device and load the modules; for this, please refer to the documentation shipped with the drivers.

Stream with VLC

Note: You must add --enable-pvr to ./configure to use this feature.

% vlc -vvv --color pvr:/dev/video0:norm=secam:size=720x576:frequency=576250:bitrate=3000000:maxbitrate=4000000 --cr-average 1000 --sout udp:192.168.0.42 --ttl 12

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,
  • 1000 is a secret value to work around a bug of the 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).

Stream with the Visiontech Kfir card

Install the drivers

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 [http://www.linuxtv.org/ LinuxTV web site].

Uncompress the tarball and follow the instructions written in the INSTALL file to compile and install the drivers.

Note: If you have a VIA chipset, you need to disable USB in the BIOS.

Stream

% vlc -vvv --color 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).

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.


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.

You can test your device by using any of the listed programs in the Video: TV and PVR/DVR section of this page.


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}:std{access=udp,mux=ts,dst=239.255.12.13}' --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
    • hurry-up allows the encoder to decrease the quality of the stream if the CPU can't keep up with the encoding rate
    • vt=800000 is the tolerance in kbit/s for the bitrate of the outputted video
  • deinterlace tells VLC to deinterlace the video on the fly,
  • 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).

Stream with DirectShow

Note: This is only possible under Windows.

Install your peripheral drivers

You need to install your peripherals under Windows with the appropriate drivers. Nothing else is necessary.

Stream with VLC in command line

% C:\Program Files\VideoLAN\VLC\vlc.exe -vvv -I rc --ttl 12 dshow:// vdev="VGA USB Camera" adev="USB Camera" size="640x480" --sout=#std{mux=ts,access=udp,dst=239.255.42.12}

Note: You need to precise the complete path to find vlc program or to launch the command from the correct directory.

  • vvv is to activate the verbose mode
  • rc is to activate the remote control interface (MS/DOS console)
  • 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),
  • vdev="VGA USB Camera" is the name of the video peripheral that DirectShow will use (this is only an exemple),
  • adev="USB Camera" is the name of the audio peripheral,
  • size="640x480" is the resolution (you can also put the standard size like subqcif (128x96), qsif (160x120), qcif

(176x144), sif (320x240), cif (352x288) or vga (640x480)).

  • 239.255.42.12 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.