How to stream your images/files with VLC?

﹥>﹥吖頭↗ 提交于 2019-11-30 10:54:01

问题


So I know there are lot of wrappers of libVLC.dll . But I just do not know what one is ready to do what I need...

What I need is simple...

  • in my C# program I create some bitmap (once or twice per second)...
  • I now want to stream bitmaps live as video (in some format VLC can to offer me) to some http:localhost:port/ using VLC...

How to do that?


回答1:


You need to use following code to stream a image.

cd "C:\program files\videolan\vlc" 
vlc -I dummy fake:// --fake-file c:\1.jpg -vvv --sout #transcode{vcodec=mp4v,vb=1024,scale=1}:duplicate{dst=std{access=udp,mux=ts,dst=localhost:1234}}



回答2:


You can use the NativeLibVlc.cs file available at VLC site.

To stream the bitmap file use following code

   vlc.AddTarget("fake://", new string[] {":no-overlay", ":input-repeat=-1", 
                        ":vout-filter=adjust", ":fake-file=" + fileName.Trim(), ":fake-fps=1",
                        ":brightness="+50, ":fake-caching=100"} , ref playListId);

 vlc.Play(playListId);

To stream webcam over UPD on port 1234 use following code

cd "C:\program files\videolan\vlc"
vlc.exe -vvv --dshow-vdev="Logitech QuickCam Express / Go" dshow:// --sout #transcode{vcodec=mp4v,vb=1024,scale=1}:duplicate{dst=std{access=udp,mux=ts,dst=localhost:1234}}

To stream a video on port 1234 use following code

cd "C:\program files\videolan\vlc" 
vlc.exe -vvv C:\filename.wmv --repeat --sout=#transcode{vcodec=mp4v,vb=1024,scale=1}:duplicate{dst=std{access=udp,mux=ts,dst=localhost:1234}}

To stream a image on localhost port 1234 use following code

cd "C:\program files\videolan\vlc" 
vlc -I dummy fake:// --fake-file c:\1.jpg -vvv --sout #transcode{vcodec=mp4v,vb=1024,scale=1}:duplicate{dst=std{access=udp,mux=ts,dst=localhost:1234}}


来源:https://stackoverflow.com/questions/2738228/how-to-stream-your-images-files-with-vlc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!