es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Winforms VLC no puede reproducir ningún vídeo http/https.

Estoy intentando reproducir un HLS en una aplicación WinForms. Descubrí que MediaPlayer no soporta este formato, pero la librería de VLC sí. Pero cuando intento transmitir el HLS con la librería de VLC, no funciona. Luego probé VLC Controler con el video Big Buck Bunny y tampoco funcionó, solo cuando reproduzco un video local, funciona.

El código que estoy utilizando para reproducir el video Big Buck Bunny es:
“`C#
mediaPlayer.Play(new Uri(“https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4”));


Y la salida de depuración de VLC es:

[00eee3b8] main libvlc debug: VLC media player – 3.0.16 Vetinari
[00eee3b8] main libvlc debug: Copyright ® 1996-2021 the VideoLAN team
[00eee3b8] main libvlc debug: revision 3.0.16-0-g5e70837d8d
[00eee3b8] main libvlc debug: configured with /home/jenkins/workspace/vlc-release/windows/vlc-release-win32-x86/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-shout’ ‘–enable-goom’ ‘–enable-sse’ ‘–enable-mmx’ ‘–enable-libcddb’ ‘–enable-zvbi’ ‘–disable-telx’ ‘–enable-nls’ ‘–host=i686-w64-mingw32’ ‘–with-contrib=../contrib/i686-w64-mingw32’ ‘–with-breakpad=https://win.crashes.videolan.org’ ‘–enable-qt’ ‘–enable-skins2’ ‘–enable-dvdread’ ‘–enable-caca’ ‘host_alias=i686-w64-mingw32’ ‘CFLAGS=’ ‘CXXFLAGS=’ ‘PKG_CONFIG=pkg-config’ ‘PKG_CONFIG_LIBDIR=/usr/i686-w64-mingw32/lib/pkgconfig:/usr/lib/i686-w64-mingw32/pkgconfig’
[00eee3b8] main libvlc debug: using multimedia timers as clock source
[00eee3b8] main libvlc debug: min period: 1 ms, max period: 1000000 ms
[00eee3b8] main libvlc debug: searching plug-in modules
[00eee3b8] main libvlc debug: loading plugins cache file C:\Program Files (x86)\VideoLAN\VLC\plugins\plugins.dat
[00eee3b8] main libvlc debug: recursively browsing C:\Program Files (x86)\VideoLAN\VLC\plugins'
[00eee3b8] main libvlc debug: plug-ins loaded: 496 modules
[00eee4f0] main logger debug: looking for logger module matching "any": 2 candidates
[00eee4f0] main logger debug: using logger module "console"
[00eee3b8] main libvlc debug: translation test: code is "en_GB"
[05f18798] main keystore debug: looking for keystore module matching "memory": 3 candidates
[05f18798] main keystore debug: using keystore module "memory"
[00eee3b8] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU
[05fb9458] main generic debug: creating audio output
[05fce1c0] main audio output debug: looking for audio output module matching "any": 6 candidates
[05fce1c0] mmdevice audio output error: cannot initialize COM (error 0x80010106)
[05fce1c0] directsound audio output debug: found 5 devices
[05fce1c0] main audio output debug: using audio output module "directsound"
[05fb9458] main generic debug: keeping audio output
[05fdcfc8] main input debug: Creating an input for 'Big_Buck_Bunny_1080_10s_1MB.mp4'
[05fdcfc8] main input debug: using timeshift granularity of 50 MiB
[05fdcfc8] main input debug: using timeshift path: C:\Users\thor0\AppData\Local\Temp
[05fdcfc8] main input debug:
https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4′ gives access https' demuxany’ path `test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4′
[05fcf2a0] main input source debug: creating demux: access=’https’ demux=’any’ location=’test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4′ file=’\test-videos.co.uk\vids\bigbuckbunny\mp4\h264\1080\Big_Buck_Bunny_1080_10s_1MB.mp4′
[07eb4c30] main demux debug: looking for access_demux module matching “https”: 15 candidates
[07eb4c30] main demux debug: no access_demux modules matched
[07eb8108] main stream debug: creating access: https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4
[07eb8108] main stream debug: (path: \test-videos.co.uk\vids\bigbuckbunny\mp4\h264\1080\Big_Buck_Bunny_1080_10s_1MB.mp4)
[07eb8108] main stream debug: looking for access module matching “https”: 27 candidates
[05fd2e28] main tls client debug: looking for tls client module matching “any”: 1 candidates
[05fd2e28] gnutls tls client debug: using GnuTLS version 3.6.15
[05fd2e28] gnutls tls client debug: loaded 125 trusted CAs from system
[05fd2e28] main tls client debug: using tls client module “gnutls”
[05fd2e28] main tls client debug: resolving test-videos.co.uk …
[05fd2e28] gnutls tls client debug: TLS handshake: Error in the push function.
[05fd2e28] gnutls tls client debug: Winsock error 0
[05fd2e28] gnutls tls client error: TLS handshake error: Error in the push function.
[05fd2e28] main tls client error: TLS session handshake error
[05fd2e28] main tls client error: connection error: Access denied
[05fd2e28] gnutls tls client debug: TLS handshake: Error in the push function.
[05fd2e28] gnutls tls client debug: Winsock error 0
[05fd2e28] gnutls tls client error: TLS handshake error: Error in the push function.
[05fd2e28] main tls client error: TLS session handshake error
[05fd2e

Tags:  , , ,

Answer

  1. Avatar for davy.ai

    Parece que la transmisión HLS no está siendo reconocida por la librería VLC. La salida de depuración muestra que el módulo access_demux que corresponde con “https” no se encuentra, lo que sugiere que el formato HLS no está siendo detectado correctamente.

    Una posible solución es utilizar la librería libvlcsharp, que proporciona un mejor soporte para HLS. Puede intentar usar el control MediaPlayerElement de la librería para reproducir la transmisión HLS. Aquí hay un ejemplo de código:

    C#
    var media = new Media(_libVlc, new Uri("http://example.com/playlist.m3u8")); // reemplace con la URL de su transmisión HLS
    media.AddOption(":no-http-reconnect"); // deshabilitar la reconexión HTTP para las transmisiones HLS
    mediaPlayerElement.MediaPlayer.Play(media);

    Tenga en cuenta que deberá agregar los archivos binarios de libvlc a su proyecto e inicializar la instancia de LibVLC antes de usar el control MediaPlayerElement. Puede consultar la documentación de libvlcsharp para obtener más detalles sobre cómo hacer esto.

Comments are closed.