Libvlcsharp: ускорить загрузку rtsp/выбрать декодер rtspC#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 Libvlcsharp: ускорить загрузку rtsp/выбрать декодер rtsp

Сообщение Anonymous »

Я использую libvlcsharp для открытия потока RTSP в элементе управления MediaPlayer. Проблема в том, что когда MediaPlayer «открывает» поток RTSP, он ждет около 1 минуты (!), прежде чем фактически отобразить поток. Я проверил время, используемое для буферизации (с помощью события MediaPlayer.Buffering), и буферизация занимает всего одну секунду (я использую проводное сетевое соединение).
Как можно ускорить запуск видео или поймать его, когда оно начнет воспроизводиться?
Я просмотрел обсуждение на https://code.videolan.org/videolan/LibVLCSharp //issues/203, который предлагает использовать событие Buffering и событие MediaPlayer.TimeChanged, но буферизация не решает проблему (на нее приходится 1 секунда из 60), а событие TimeChanged кажется хаком, а не решением, и это также не работает (т. е. значение TimeChanged увеличивается, пока MediaPlayer «загружается» и ничего не показывает на экране)
Я посмотрел свои файлы журналов и почувствовал, что библиотека VLC тратит время пытаясь выяснить, какой кодек использовать для декодирования потока - в конце концов он останавливается на 'пробуем формат d3d11va_vld'. Мне было интересно, можно ли как-нибудь заранее указать кодек, поскольку для потока это не меняется. В файле журнала нет временных меток, поэтому я предполагаю, что именно на это тратится время — я могу ошибаться.
Я просмотрел параметры библиотеки VLC, но не смог найти возможности указать декодер потока; если я перекодирую поток, то в этом случае я могу указать декодер вывода, но не для ввода.
В файле журнала указано:
VLC media player - 3.0.20 Vetinari
Copyright © 1996-2023 the VideoLAN team
revision 3.0.20-0-g6f0d0ab126
configured with /builds/videolan/vlc/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= -D_WIN32_WINNT=0x0502 -DWINVER=0x502 -D__MSVCRT_VERSION__=0x700 ' 'CXXFLAGS= -D_WIN32_WINNT=0x0502 -DWINVER=0x502 -D__MSVCRT_VERSION__=0x700 ' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_LIBDIR=/usr/i686-w64-mingw32/lib/pkgconfig:/usr/lib/i686-w64-mingw32/pkgconfig'
creating audio output
looking for audio output module matching "any": 6 candidates
using default device
display name changed: VLC media player (LibVLC 3.0.20)
version 2 session control unavailable
volume from -65.250000 dB to +0.000000 dB with 0.750000 dB increments
using audio output module "mmdevice"
keeping audio output
Creating an input for 'rtsp://10.0.40.99:554/Streaming/Channels/101'
using timeshift granularity of 50 MiB
using timeshift path: C:\Users\Me\AppData\Local\Temp
`rtsp://admin:[email protected]:554/Streaming/Channels/101' gives access `rtsp' demux `any' path `admin:[email protected]:554/Streaming/Channels/101'
creating demux: access='rtsp' demux='any' location='admin:[email protected]:554/Streaming/Channels/101' file='\\admin:[email protected]:554\Streaming\Channels\101'
looking for access_demux module matching "rtsp": 15 candidates
version 2016.11.28
Password in a URI is DEPRECATED
RTP subsession 'video/H264'
selecting program id=0
RTP subsession 'audio/PCMU'
setup start: 0.000000 stop:0.000000
We have a timeout of 60 seconds
play start: 0.000000 stop:0.000000
using access_demux module "live555"
looking for packetizer module matching "any": 25 candidates
found NAL_SPS (sps_id=0)
found NAL_PPS (pps_id=0 sps_id=0)
using packetizer module "h264"
looking for video decoder module matching "any": 20 candidates
using ffmpeg Lavc58.134.100
CPU flags: 0x000fd3db
allowing 6 thread(s) for decoding
codec (h264) started
using frame thread mode with 6 threads
using video decoder module "avcodec"
audio is disabled, not selecting ES 0x1
looking for meta reader module matching "any": 2 candidates
Trying Lua scripts in C:\Users\Me\AppData\Roaming\vlc\lua\meta\reader
Trying Lua scripts in C:\Users\Me\source\repos\VLC-Demo\bin\Debug\libvlc\win-x86\lua\meta\reader
Trying Lua playlist script C:\Users\Me\source\repos\VLC-Demo\bin\Debug\libvlc\win-x86\lua\meta\reader\filename.luac
no meta reader modules matched
`rtsp://admin:[email protected]:554/Streaming/Channels/101' successfully opened
lost 29895 bytes
increasing buffer size to 500000
Buffering 0%
Buffering 1%
Buffering 3%
Buffering 7%
Buffering 35%
Buffering 40%
Buffering 45%
Buffering 50%
Buffering 55%
Buffering 60%
Buffering 65%
Buffering 70%
Buffering 75%
Buffering 80%
Buffering 85%
Buffering 90%
Buffering 95%
Buffering 100%
Stream buffering done (1050 ms in 832 ms)
buffer deadlock prevented
Decoder wait done in 0 ms
lost 78214 bytes
increasing buffer size to 1000000
lost 283943 bytes
increasing buffer size to 2000000
restarting module due to input format change
removing module "avcodec"
looking for video decoder module matching "any": 20 candidates
using ffmpeg Lavc58.134.100
CPU flags: 0x000fd3db
allowing 6 thread(s) for decoding
codec (h264) started
using frame thread mode with 6 threads
using video decoder module "avcodec"
available hardware decoder output format 53 (dxva2_vld)
available hardware decoder output format 118 (d3d11va_vld)
available hardware decoder output format 174 (d3d11)
available software decoder output format 12 (yuvj420p)
trying format d3d11va_vld
looking for text renderer module matching "any": 3 candidates
Using DWrite backend
DWrite_GetFamily(): family name: Arial
DWrite_ParseFamily(): using font at index 0 with weight 400 for bold: 0, italic: 0
DWrite_ParseFamily(): using font at index 1 with weight 700 for bold: 1, italic: 0
DWrite_ParseFamily(): using font at index 2 with weight 400 for bold: 0, italic: 1
DWrite_ParseFamily(): using font at index 3 with weight 700 for bold: 1, italic: 1
using text renderer module "freetype"
looking for video converter module matching "any": 24 candidates
32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bicubic (good quality)
using video converter module "swscale"
looking for video converter module matching "any": 24 candidates
YUVP to YUVA converter
using video converter module "yuvp"
Deinterlacing available
deinterlace -1, mode auto, is_needed 0
looking for vout window module matching "embed-hwnd,any": 3 candidates
using vout window module "drawable"
looking for inhibit module matching "any": 1 candidates
using inhibit module "inhibit"
Opening vout display wrapper
looking for vout display module matching "any": 12 candidates
creating Vout EventThread
Win32VoutCreateWindow
VoutDisplayEvent 'resize' 2688x1520
inclinometer not found. (hr=0x80070490)
created video sub-window
Vout EventThread running
Created the D3D11 device type 1 level b100.
NVIDIA WDDM driver 32.0.15.5599
supports colorspace RGB Rec.709 gamma:22 range:FULL
supports colorspace RGB Rec.709 gamma:22 range:STUDIO
supports colorspace RGB Rec.2020 gamma:22 range:STUDIO
supports colorspace RGB Rec.2020 gamma:22 range:FULL
supports colorspace RGB Rec.2020 gamma:2084 range:FULL
supports colorspace RGB Rec.2020 gamma:2084 range:STUDIO
Output max luminance: 270.0, colorspace RGB Rec.709 gamma:22 range:FULL, bits per pixel 8
using colorspace RGB Rec.709 gamma:22 range:FULL
Using pixel format VA_NV12 for chroma DX11
VoutDisplayEvent 'resize' 2704x1559
using GPU render fence
Direct3D11 resources created
Direct3D11 device adapter successfully initialized
Direct3D11 Open Succeeded
using vout display module "direct3d11"
D3D11 pool succeed with 40 surfaces (2688x1520) context 0x0841d410
original format sz 2688x1520, of (0,0), vsz 2688x1520, 4cc DX11, sar 1:1, msk r0x0 g0x0 b0x0
removing module "freetype"
VoutDisplayEvent 'resize' 623x309
looking for text renderer module matching "any": 3 candidates
Using DWrite backend
DWrite_GetFamily(): family name: Arial
DWrite_ParseFamily(): using font at index 0 with weight 400 for bold: 0, italic: 0
DWrite_ParseFamily(): using font at index 1 with weight 700 for bold: 1, italic: 0
DWrite_ParseFamily(): using font at index 2 with weight 400 for bold: 0, italic: 1
DWrite_ParseFamily(): using font at index 3 with weight 700 for bold: 1, italic: 1
using text renderer module "freetype"
looking for hw decoder module matching "any": 2 candidates


Подробнее здесь: https://stackoverflow.com/questions/786 ... sp-decoder
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Невозможно открыть RTSP -поток из libvlcsharp
    Anonymous » » в форуме C#
    0 Ответы
    7 Просмотры
    Последнее сообщение Anonymous
  • Ускорить загрузку файлов с помощью aiofiles и aiohttp?
    Гость » » в форуме Python
    0 Ответы
    40 Просмотры
    Последнее сообщение Гость
  • Есть ли какой-нибудь трюк, позволяющий ускорить загрузку файла фрагмента js, созданного с помощью приложения create-reac
    Anonymous » » в форуме Javascript
    0 Ответы
    38 Просмотры
    Последнее сообщение Anonymous
  • Как ускорить загрузку изображений на моем веб-сайте?
    Гость » » в форуме CSS
    0 Ответы
    29 Просмотры
    Последнее сообщение Гость
  • Как сохранить темный режим в браузере и ускорить его загрузку? [дубликат]
    Anonymous » » в форуме Jquery
    0 Ответы
    73 Просмотры
    Последнее сообщение Anonymous

Вернуться в «C#»