Difference between revisions of "Documentation:Streaming HowTo/Command Line Examples"

From VideoLAN Wiki
Jump to navigation Jump to search
m (Fix SAP syntax for RTP)
Line 6: Line 6:
  
 
Transcode the input stream and send it to a multicast IP address with the associated SAP announce:
 
Transcode the input stream and send it to a multicast IP address with the associated SAP announce:
  % '''vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:rtp{mux=ts,dst=239.255.12.42,sap,name="TestStream"}' '''
+
  % '''vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}' '''
  
  
 
Display the input stream, transcode it and send it to a multicast IP address with the associated SAP announce:
 
Display the input stream, transcode it and send it to a multicast IP address with the associated SAP announce:
  % '''vlc -vvv input_stream --sout '#duplicate{dst=display,dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:rtp{mux=ts,dst=239.255.12.42,sap,name="TestStream"}"}' '''
+
  % '''vlc -vvv input_stream --sout '#duplicate{dst=display,dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}"}' '''
  
 
Transcode the input stream, display the transcoded stream and send it to a multicast IP address with the associated SAP announce:
 
Transcode the input stream, display the transcoded stream and send it to a multicast IP address with the associated SAP announce:
  % '''vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sap,name="TestStream"}}' '''
+
  % '''vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}}' '''
  
 
==Multiple streaming==
 
==Multiple streaming==
  
 
Send a stream to a multicast IP address and a unicast IP address:
 
Send a stream to a multicast IP address and a unicast IP address:
  % '''vlc -vvv input_stream --sout '#duplicate{dst=rtp{mux=ts,dst=239.255.12.42,sap,name="TestStream"},dst=rtp{mux=ts,dst=192.168.1.2}}' '''
+
  % '''vlc -vvv input_stream --sout '#duplicate{dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"},dst=rtp{mux=ts,dst=192.168.1.2}}' '''
  
 
Display the stream and send it to two unicast IP addresses:
 
Display the stream and send it to two unicast IP addresses:
Line 30: Line 30:
  
 
Transcode the input stream, display the transcoded stream and send it to a multicast IP address with the associated SAP announce and an unicast IP address:
 
Transcode the input stream, display the transcoded stream and send it to a multicast IP address with the associated SAP announce and an unicast IP address:
  % '''vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sap,name="TestStream"},dst=rtp{mux=ts,dst=192.168.1.2}}' '''
+
  % '''vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"},dst=rtp{mux=ts,dst=192.168.1.2}}' '''
  
 
Display the input stream, transcode it and send it to two unicast IP addresses:
 
Display the input stream, transcode it and send it to two unicast IP addresses:
Line 36: Line 36:
  
 
Send the input stream to a multicast IP address and the transcoded stream to another multicast IP address with the associated SAP announces:
 
Send the input stream to a multicast IP address and the transcoded stream to another multicast IP address with the associated SAP announces:
  % '''vlc -vvv input_stream --sout '#duplicate{dst=rtp{mux=ts,dst=239.255.1.2,sap,name="OriginalStream"},dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{mux=ts,dst=239.255.1.3,sap,name="TranscodedStream"}"}' '''
+
  % '''vlc -vvv input_stream --sout '#duplicate{dst=rtp{mux=ts,dst=239.255.1.2,sdp=sap,name="OriginalStream"},dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{mux=ts,dst=239.255.1.3,sdp=sap,name="TranscodedStream"}"}' '''
  
 
==HTTP streaming==
 
==HTTP streaming==

Revision as of 12:06, 29 September 2007

VLC Streaming HowTo

Introduction
Streaming, Muxers and Codecs

Main
Easy Streaming
Advanced Streaming Using the Command Line
Command Line Examples

VLM
VLM - Multiple Streaming and Video on Demand

Tutorials and examples
Receive and Save a Stream
Convert files to other formats
Stream a File
Stream a DVD
Stream a DVB Channel
Stream from Encoding Cards and Other Capture Devices
Stream from a DV Camcorder
Streaming for the iPhone

IPv6
Streaming over IPv6
View this alone

Examples for advanced use of VLC's stream output (transcoding, multiple streaming, etc...)

Transcoding

Transcode the input stream and send it to a multicast IP address with the associated SAP announce:

% vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}' 


Display the input stream, transcode it and send it to a multicast IP address with the associated SAP announce:

% vlc -vvv input_stream --sout '#duplicate{dst=display,dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}"}' 

Transcode the input stream, display the transcoded stream and send it to a multicast IP address with the associated SAP announce:

% vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}}' 

Multiple streaming

Send a stream to a multicast IP address and a unicast IP address:

% vlc -vvv input_stream --sout '#duplicate{dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"},dst=rtp{mux=ts,dst=192.168.1.2}}' 

Display the stream and send it to two unicast IP addresses:

% vlc -vvv input_stream --sout '#duplicate{dst=display,dst=standard{access=udp,mux=ts,dst=192.168.1.12},dst=standard{access=udp,mux=ts,dst=192.168.1.42}}' 

Send parts of a multiple program input stream:

% vlc -vvv multiple_program_input_stream --sout '#duplicate{dst=rtp{mux=ts,dst=239.255.12.42},select="program=12345",dst=rtp{mux=ts,dst=239.255.12.43}, select="video,program=1234-2345"}' 

This command sends the program of the input stream which id is 12345 to 239.255.12.42 and all video programs with id between 1234 and 2345 to 239.255.12.43.

Transcoding and multiple streaming

Transcode the input stream, display the transcoded stream and send it to a multicast IP address with the associated SAP announce and an unicast IP address:

% vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"},dst=rtp{mux=ts,dst=192.168.1.2}}' 

Display the input stream, transcode it and send it to two unicast IP addresses:

% vlc -vvv input_stream --sout '#duplicate{dst=display,dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:duplicate{dst=rtp{mux=ts,dst=192.168.1.2},dst=rtp{mux=ts,dst=192.168.1.12}"}' 

Send the input stream to a multicast IP address and the transcoded stream to another multicast IP address with the associated SAP announces:

% vlc -vvv input_stream --sout '#duplicate{dst=rtp{mux=ts,dst=239.255.1.2,sdp=sap,name="OriginalStream"},dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{mux=ts,dst=239.255.1.3,sdp=sap,name="TranscodedStream"}"}' 

HTTP streaming

Stream in HTTP:

  • on the server, run:
% vlc -vvv input_stream --sout '#standard{access=http,mux=ogg,dst=server.example.org:8080}' 
  • on the client(s), run:
% vlc http://server.example.org:8080

Transcode and stream in HTTP:

% vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:standard{access=http,mux=ogg,dst=server.example.org:8080}' 

Recording a live video stream:

% vlc http://example.com/live.asf --sout="#duplicate{dst=std{access=file,mux=asf,url='C:\test\test.asf'},dst=nodisplay}" 

For example, if you want to stream an audio CD in Ogg/Vorbis over HTTP:

% vlc -vvv cdda:/dev/cdrom --sout '#transcode{acodec=vorb,ab=128}:standard{access=http,mux=ogg,dst=server.example.org:8080}' 

RTSP live streaming

Stream with RTSP and RTP:

  • on the server, run:
% vlc -vvv input_stream --sout '#rtp{dst=192.168.0.12,port=1234,sdp=rtsp://server.example.org:8080/test.sdp}' 
  • on the client(s), run:
% vlc rtsp://server.example.org:8080/test.sdp

RTSP on-demand streaming

See Documentation:Streaming HowTo/VLM.

MMS / MMSH streaming to Windows Media Player

% vlc -vvv input_stream --sout '#transcode{vcodec=DIV3,vb=256,scale=1,acodec=mp3,ab=32,channels=2}:std{access=mmsh,mux=asfh,dst=:8080}' 

VLC media player can connect to this by using the following url: mmsh://server_ip_address:8080. Windows Media Player can connect to this by using the following url: mms://server_ip_address:8080.

Use the es module

Separate audio and video in two PS files:

% vlc -vvv input_stream --sout '#es{access=file,mux=ps,url_audio=audio-%c.%m,url_video=video-%c.%m}' 

Extract the audio track of the input stream to a TS file:

% vlc -vvv input_stream --sout '#es{access_audio=file,mux_audio=ts,url_audio=audio-%c.%m}' 

Stream in unicast the audio track on a port and the video track on another port:

  • on the server side:
% vlc -vvv input_stream --sout '#es{access=rtp,mux=ts,url_audio=192.168.1.2:1212,url_video=192.168.1.2:1213}' 
  • on the client side:
    • to receive the audio:
% vlc udp:@:1212
    • to receive the video:
% vlc udp:@:1213

Stream in multicast the video and dump the audio in a file:

% vlc -vvv input_stream --sout '#es{access-video=udp,mux-video=ts,dst-video=239.255.12.42,access-audio=file,mux-audio=ps,dst-audio=audio-%c.%m}' 

Note: You can also combine the es module with the other modules to set-up even more complex solution.


This page is part of official VLC media player Documentation (User GuideStreaming HowToHacker GuideModules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.