【概述】
VLC是著名的音视频播放器,而且难能可贵的是,它支持二次开发:LibVlc、VLCDotNet……。VLC是开源的支持多平台(Windows、Linux、Android、iOS等),还支持对流的操作。VCL有丰富的命令行参数,在我们做二次开发的时候可以直接调用。命令行参数我们可以输入VLC =H获取到最详细的帮助。本文就给出几个最实用的命令行,供大家开发使用。
【说明】
通过我的测试,VLC强项是拉流,包括播放本地文件、本地设备,推流、串流效果不好,连接等待时间长(大约30秒),延迟也长,大约在6秒。请有经验的朋友能指点一二,争取榨干VLC的每一滴“血汗”,呵呵。
【参数实例】
vlc screen://
vlc screen:// --screen-fps=10 --screen-width=1920
vlc screen:// :screen-mouse-image=c:\player.png
录屏参数 |
Screen Input --screen-fps= Desired frame rate for the capture. --screen-top= Subscreen top left corner Top coordinate of the subscreen top left corner. --screen-left= Subscreen top left corner Left coordinate of the subscreen top left corner. --screen-width= Subscreen width Subscreen width --screen-height= Subscreen height Subscreen height --screen-follow-mouse, --no-screen-follow-mouse Follow the mouse (default disabled) Follow the mouse when capturing a subscreen. (default disabled) --screen-mouse-image= Mouse pointer image If specified, will use the image to draw the mouse pointer on the capture. --screen-fragment-size= Capture fragment size Optimize the capture by fragmenting the screen in chunks of predefined height (16 might be a good value, and 0 means disabled). |
vlc dshow:// :dshow-adev="麦克风 (Realtek High Definition Audio)"
vlc screen:// --screen-fps=10 --screen-width=1920 :input-slave=dshow:// :dshow-adev="麦克风 (Realtek High Definition Audio)"
vlc dshow:// :dshow-vdev="Integrated Camera"
vlc dshow:// :dshow-vdev="Integrated Camera" :dshow-adev="麦克风 (Realtek High Definition Audio)"
服务端:
vlc dshow:// :dshow-vdev="Integrated Camera" :dshow-adev="麦克风 (Realtek High Definition Audio)" :dshow-size=320*240 :sout=#transcode{vcodec=VP80,vb=2000,acodec=vorb,ab=128,channels=2,samplerate=44100}:duplicate{dst=display,dst=rtp{sdp=rtsp://:8554/test}}
客户端:
vlc rtsp://127.0.0.1:8554/test
服务端:
vlc -vvv dshow:// :dshow-adev="virtual-audio-capturer" :dshow-vdev="screen-capture-recorder" --sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{sdp=rtsp://:8554/} :no-sout-all :sout-keep
客户端:
vlc rtsp://127.0.0.1:8554/
服务端:
vlc -vvv screen:// --screen-fps=10 --screen-width=1920 --sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{sdp=rtsp://:8554/} :no-sout-all :sout-keep
客户端:
vlc rtsp://127.0.0.1:8554/
【注意】