基于vlc进行摄像头推流的细节

Stream with DirectShow (Windows) 基于DirectShow的流(Windows)

Install your peripheral drivers

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

安装您的外围驱动程序

你需要给Windows下的外设安装适当的驱动程序。没有其他必要的事情。【注:遵循UVC的设备则无需安装驱动】


Stream unicast/multicast with VLC in command line

使用命令行基于vlc进行流单播/多播
% C:\Program Files\VideoLAN\VLC\vlc.exe -I rc --ttl 12 dshow:// vdev="VGA USB Camera" adev="USB Camera" size="640x480" --sout=#rtp{mux=ts,dst=239.255.42.12,port=5004}

Note: You either need to provide the full path to the vlc.exe executable or add its location to the Windows Path variable.

注意:你要么提供vlc.exe的全路径,要么将其所在位置添加到windows的path环境变量中。

  • -I rc is to activate the remote control interface (MS/DOS console) 激活远程控制接口(MS/ DOS控制台)
  • 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),
    你的IP数据包的TTL(生存时间)值(设为12,就意味着流将能够跨越11台路由器),
  • vdev="VGA USB Camera" is the name of the video peripheral that DirectShow will use (this is only an exemple),
    DirectShow将使用的视频外设的名称(这只是一个例子),
  • 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)).

    分辨率(你也可以设置标准尺寸,如subqcif(128 x96),qsif(160 x120),qcif (176 x144),sif(320 x240),cif(352 x288)或vga(640 x480))。


  • 239.255.42.12 is either:
    • the IP address of the machine you want to unicast to; 单播的IP地址
    • or the DNS name the machine you want to unicast to;  单播的DNS名称
    • or a multicast IP address.                   多播的IP地址

Stream to file(s) with VLC in command line

% C:\Path\To\vlc.exe -I rc dshow:// :dshow-vdev="Osprey-210 Video Device 1" :dshow-adev="Unbalanced 1 (Osprey-2X0)"  :dshow-caching=200 --sout="#duplicate{dst='transcode{vcodec=h264,vb=1260,fps=24,scale=1,width=640,height=480,acodec=mp4a,ab=96,channels=2,samplerate=44100}:std{access=file,mux=mp4,dst=C:\\Path\\To\\File-1.mp4}',dst='transcode{vcodec=h264,vb=560,fps=24,scale=1,width=427,height=320,acodec=mp4a,ab=96,channels=2,samplerate=44100}:std{access=file,mux=mp4,dst=C:\\Path\\To\\File-2.mp4}'}"
  • -I rc is to activate the remote control interface (MS/DOS console)
  • dshow://... configures your input capture card / settings
  • #duplicate{} multiple output configurations
  • transcode{} video/audio codec settings  视频/音频编解码设置
  • std{} output/muxer settings

其他参考链接:
https://wiki.videolan.org/Documentation:Streaming_HowTo/Stream_from_Encoding_Cards_and_Other_Capture_Devices/#Stream_with_DirectShow_.28Windows.29

https://wiki.videolan.org/Knowledge_Base

https://wiki.videolan.org/Documentation:Play_HowTo

猜你喜欢

转载自blog.csdn.net/Fan0920/article/details/53201744