《VLC命令行模式使用大全》由會(huì)員分享,可在線閱讀,更多相關(guān)《VLC命令行模式使用大全(5頁珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、VLC命令行模式使用大全
一 Receive and save a stream
1.1 Receive a stream with VLC
1.1.1 Receive an unicast stream(接收單播流)
vlc -vvv udp://10.1.14.18
注釋:10.1.14.18為目標(biāo)計(jì)算機(jī)的IP地址
1.1.2 Receive a multicast stream
vlc -vvv udp://239.255.255.1:1234
1.1.3 Receive an HTTP/FTP/MMS stream
vlc -vvv http://example/
2、stream.xyz
vlc -vvv ftp://example/stream.xyz
vlc -vvv rtsp://
1.2 Save a stream with VLC
vlc stream --sout file/muxer:stream.xyz
注釋:
stream:指網(wǎng)絡(luò)流;
muxer:指ps,ts,avi,ogg等封裝形式;
stream.xyz:存儲(chǔ)文件的名字,前面需要加存儲(chǔ)路徑
如:vlc udp://@239.255.255.1:1234 –sout file/ps:/home/youxr/movie.mpg
二 Stream a file
3、 這里主要介紹視頻文件如何以流的形式發(fā)出,給出下面的命令。
2.1 單播輸出
vlc -vvv video1.xyz --sout udp:192.168.0.42 --ttl 12
2.2 多播輸出
vlc -vvv video1.xyz --sout udp://@239.255.255.1:1234 --ttl 12
2.3 Http輸出
vlc -vvv video1.xyz --sout http/muxer:本機(jī)地址:端口號(hào) --ttl 12
注釋:
muxer為ps、ts等封裝形式。
客戶端接收為:vlc http://服務(wù)器地址:端口號(hào)
三 高級(jí)應(yīng)用
4、
3.1 Transcoding(轉(zhuǎn)碼)
① 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}:standard{access=udp,mux=ts,url=239.255.12.42,sap,name="TestStream"}'
注釋:SAP可不要
5、② 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}:standard{access=udp,mux=ts,url=239.255.12.42,sap,name="TestStream
6、"}"}'
③ 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=standard{access=udp,mux=ts,url=239.255.1
7、2.42,sap,name="TestStream"}}'
3.2 Multiple streaming(多個(gè)流輸出)
① Send a stream to a multicast IP address and a unicast IP address:
vlc -vvv input_stream --sout '#duplicate{dst=standard{access=udp,mux=ts,
url=239.255.12.42,sap,name="TestStream"},dst=standard{access=udp,mux=ts,url=192.168.1.2}}'
②
8、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,
url=192.168.1.12},dst=standard{access=udp,mux=ts,url=192.168.1.42}}'
③ Send parts of a multiple program input stream:
vlc -vvv multiple_program_input_s
9、tream --sout '#duplicate{dst=standard{access=udp,
mux=ts,url=239.255.12.42},select="program=12345",dst=standard{access=udp,mux=ts,url=239.255.12.43}, select="video,program=1234-2345"}'
3.3 Transcoding and multiple streaming(轉(zhuǎn)碼且多流輸出)
① Transcode the input stream, display the transcoded stream and
10、 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=standard{access=udp,mux=ts,url=239.255.12.42,sap,name="TestStream"},dst=standard{acc
11、ess=udp,mux=ts,url=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=standard{access=udp,mux=ts,url=192.168.1.2},dst=standard{a
12、ccess=udp,mux=ts,url=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=standard{access=udp,mux=ts,
url=239.255.1.2,sap,name="OriginalStream"}
13、,dst="transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:standard{access=udp,mux=ts,url=239.255.1.3,sap,name="TranscodedStream"}"}'
④ 轉(zhuǎn)碼且存儲(chǔ)
vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,
deinterlace}:duplicate{dst=display,dst=standard{access=file,mux=ps,url=./movie
14、.mpg}}'
3.4 HTTP streaming
① streaming in http (和2.3類似)
服務(wù)器端運(yùn)行:
vlc -vvv input_stream --sout '#standard{access=http,mux=ogg,url=server.example.org:8080}'
客戶端運(yùn)行:--sout '#standard{access=http,mux=ogg,url=192.168.1.101:8080}'
vlc http://server.example.org:8080
C:\Program Files\VideoLAN\VLC>v
15、lc -vvv H:\VIDEO\gg.mpg :sout=#standard{access=ht
tp,mux=ogg,dst=192.168.1.102:9898}'
② 轉(zhuǎn)碼并且http方式輸出
vlc -vvv input_stream --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:
standard{access=http,mux=ogg,url=server.example.org:8080}'
例如:if you want to stream an audio CD in Ogg/Vorbis
16、over HTTP:
vlc -vvv cdda:/dev/cdrom --sout '#transcode{acodec=vorb,ab=128}:standard{access=http,
mux=ogg,url=server.example.org:8080}'
3.5 RTP streaming
Stream in RTP:
on the server, run:
vlc -vvv input_stream --sout '#rtp{dst=192.168.0.12,port=1234,
sdp=http://server.example.org:8080/tes
17、t.sdp}'
on the client(s), run:
vlc http://server.example.org:8080/test.sdp
3.6 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
18、 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
19、=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,
url_video=239.255.12.42,access_audio=file,mux_audio=ps,url_audio=audio-%c.%m}'