更新和更改:
public void PlayURLFile(string file)
{
_libVLC.Log += LibVLC_Log;
var media = new Media(_libVLC, file);
media.AddOption(":access=udp");
media.AddOption(":demux=mp4v");
_mp.Play(media);
isPlaying = true;
_libVLC.Log -= LibVLC_Log;
}
我试过了,但屏幕还是黑的。
在 CMD 命令中使用 vlc ->vlc udp://@224.21.51.16:13001 --access=udp --demux=mp4v
VLC 日志显示:
main debug: processing request item: udp://224.21.51.16:13001, node: Lista de reproducción, skip: 0
main debug: resyncing on udp://224.21.51.16:13001
main debug: udp://224.21.51.16:13001 is at 0
main debug: starting playback of the new playlist item
main debug: resyncing on udp://224.21.51.16:13001
main debug: udp://224.21.51.16:13001 is at 0
main debug: creating new input thread
main debug: Creating an input for 'udp://224.21.51.16:13001'
main debug: using timeshift granularity of 50 MiB, in path 'C:\Users\ALEJAN~1\AppData\Local\Temp'
main debug: `udp://@224.21.51.16:13001' gives access `udp' demux `' path `@224.21.51.16:13001'
main debug: enforced demux ` mp4v'
main debug: creating demux: access='udp' demux='mp4v' location='@224.21.51.16:13001' file='\\@224.21.51.16:13001'
main debug: looking for access_demux module: 0 candidates
main debug: no access_demux module matched "udp"
main debug: TIMER module_need() : 0.142 ms - Total 0.142 ms / 1 intvls (Avg 0.142 ms)
main debug: creating access 'udp' location='@224.21.51.16:13001', path='\\@224.21.51.16:13001'
main debug: looking for access module: 1 candidate
access_udp debug: opening server=:0 local=224.21.51.16:13001
main debug: net: opening 224.21.51.16 datagram port 13001
main debug: using access module "access_udp"
main debug: TIMER module_need() : 0.215 ms - Total 0.215 ms / 1 intvls (Avg 0.215 ms)
main debug: Using block method for AStream*
main debug: starting pre-buffering
main debug: received first data after 7 ms
main debug: prebuffering done 5709 bytes in 0s - 788 KiB/s
main debug: looking for stream_filter module: 4 candidates
main debug: no stream_filter module matching "any" could be loaded
main debug: TIMER module_need() : 0.126 ms - Total 0.126 ms / 1 intvls (Avg 0.126 ms)
main debug: looking for stream_filter module: 1 candidate
main debug: using stream_filter module "stream_filter_record"
main debug: TIMER module_need() : 0.077 ms - Total 0.077 ms / 1 intvls (Avg 0.077 ms)
main debug: creating demux: access='udp' demux='mp4v' location='@224.21.51.16:13001' file='\\@224.21.51.16:13001'
main debug: looking for demux module: 1 candidate
es warning: this doesn't look like an MPEG ES stream, continuing anyway
es debug: detected format mp4v
main debug: looking for packetizer module: 21 candidates
main debug: using packetizer module "packetizer_mpeg4video"
main debug: TIMER module_need() : 0.067 ms - Total 0.067 ms / 1 intvls (Avg 0.067 ms)
es debug: did not sync on first block
qt4 debug: IM: Setting an input
packetizer_mpeg4video warning: waiting for VOL
packetizer_mpeg4video warning: waiting for VOL
packetizer_mpeg4video warning: waiting for VOL
packetizer_mpeg4video warning: waiting for VOL
packetizer_mpeg4video warning: waiting for VOL
main debug: selecting program id=0
main debug: using demux module "es"
main debug: TIMER module_need() : 320.628 ms - Total 320.628 ms / 1 intvls (Avg 320.628 ms)
main debug: looking for decoder module: 32 candidates
avcodec debug: libavcodec already initialized
avcodec debug: trying to use direct rendering
avcodec debug: allowing 4 thread(s) for decoding
avcodec debug: ffmpeg codec (MPEG-4 Video) started
avcodec debug: using frame thread mode with 4 threads
main debug: using decoder module "avcodec"
main debug: TIMER module_need() : 0.727 ms - Total 0.727 ms / 1 intvls (Avg 0.727 ms)
access_udp warning: unimplemented query in control
main debug: looking for meta reader module: 2 candidates
lua debug: Trying Lua scripts in C:\Users\alejandro-martinez\AppData\Roaming\vlc\lua\meta\reader
lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader
lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader\filename.luac
main debug: no meta reader module matching "any" could be loaded
main debug: TIMER module_need() : 1.537 ms - Total 1.537 ms / 1 intvls (Avg 1.537 ms)
main debug: `udp://@224.21.51.16:13001' successfully opened
main debug: Buffering 0%
main debug: looking for text renderer module: 2 candidates
freetype debug: Using Arial as font from file C:\Windows\Fonts\arial.ttf
freetype debug: using fontsize: 2
main debug: using text renderer module "freetype"
main debug: TIMER module_need() : 1.069 ms - Total 1.069 ms / 1 intvls (Avg 1.069 ms)
main debug: looking for video filter2 module: 18 candidates
swscale debug: 32x32 chroma: YUVA -> 16x16 chroma: RGBA with scaling using Bicubic (good quality)
main debug: using video filter2 module "swscale"
main debug: TIMER module_need() : 0.313 ms - Total 0.313 ms / 1 intvls (Avg 0.313 ms)
main debug: looking for video filter2 module: 18 candidates
yuvp debug: YUVP to YUVA converter
main debug: using video filter2 module "yuvp"
main debug: TIMER module_need() : 0.089 ms - Total 0.089 ms / 1 intvls (Avg 0.089 ms)
main debug: Deinterlacing available
main debug: deinterlace 0, mode blend, is_needed 0
main debug: Opening vout display wrapper
main debug: looking for vout display module: 6 candidates
direct3d debug: creating Vout EventThread
direct3d debug: DirectXCreateWindow
main debug: looking for vout window hwnd module: 2 candidates
qt4 debug: requesting video...
qt4 debug: Video was requested 0, 0
main debug: using vout window hwnd module "qt4"
main debug: TIMER module_need() : 62.604 ms - Total 62.604 ms / 1 intvls (Avg 62.604 ms)
direct3d debug: created video sub-window
direct3d debug: Vout EventThread running
direct3d debug: disabling screen saver
direct3d debug: Direct3d Device: Intel(R) HD Graphics 4600 32902 1046 6
main debug: Buffering 8%
main debug: VoutDisplayEvent 'resize' 722x335 window
direct3d warning: trying surface pixel format: YV12
direct3d debug: selected surface pixel format is YV12
direct3d debug: Using D3DTEXF_LINEAR for minification
direct3d debug: Using D3DTEXF_LINEAR for magnification
direct3d debug: Direct3D scene created successfully
direct3d debug: Direct3D device adapter successfully initialized
main debug: using vout display module "direct3d"
main debug: TIMER module_need() : 92.791 ms - Total 92.791 ms / 1 intvls (Avg 92.791 ms)
main debug: original format sz 704x288, of (0,0), vsz 704x288, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
main debug: removing module "freetype"
main debug: looking for text renderer module: 2 candidates
main debug: VoutDisplayEvent 'resize' 704x288 window
freetype debug: Using Arial as font from file C:\Windows\Fonts\arial.ttf
freetype debug: using fontsize: 2
main debug: using text renderer module "freetype"
main debug: TIMER module_need() : 1.137 ms - Total 1.137 ms / 1 intvls (Avg 1.137 ms)
avcodec debug: using direct rendering
main debug: Buffering 16%
main debug: Buffering 24%
main debug: End of video preroll
main debug: Received first picture
direct3d debug: Created 204x20 texture for OSD
main debug: Post-processing available
main debug: Buffering 33%
main debug: Buffering 41%
main debug: Buffering 49%
main debug: Buffering 58%
main debug: Buffering 66%
main debug: Buffering 74%
main debug: Buffering 83%
main debug: Buffering 91%
main debug: Buffering 99%
main debug: Stream buffering done (1083 ms in 1036 ms)
main debug: Decoder buffering done in 0 ms
main debug: auto hiding mouse cursor
main debug: picture might be displayed late (missing 18 ms)
main debug: auto hiding mouse cursor
main debug: auto hiding mouse cursor
Visual Studio 日志显示:
revision 3.0.10-0-g7f145afa84
configured with ../extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--host=i686-w64-mingw32' '--with-breakpad=https://win.crashes.videolan.org' 'host_alias=i686-w64-mingw32' 'PKG_CONFIG_LIBDIR=/home/jenkins/workspace/vlc-release/windows/vlc-release-win32-x86/contrib/i686-w64-mingw32/lib/pkgconfig'
VLC media player - 3.0.10 Vetinari
Copyright © 1996-2020 the VideoLAN team
Creating an input for 'udp://@224.21.51.16:13001'
El subproceso 0x1b00 terminó con código 259 (0x103).
El subproceso 0x2f38 terminó con código 259 (0x103).
El subproceso 0x3f9c terminó con código 259 (0x103).
El subproceso 0x1da0 terminó con código 259 (0x103).