RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
226 stars 28 forks source link

RTMP streaming with MonaServer blocks the app for 20 seconds if the streaming is not ready #727

Open Oneiros90 opened 3 years ago

Oneiros90 commented 3 years ago

Description I'm using AVPro to visualize a video streaming coming from a locally hosted RTMP server. I got it working using the Direct Show API and LAV Filters, I just have to open rtmp://localhost in a MediaPlayer and it instantly starts, smooth as butter. The problem is that if I try to open a RTMP url when the server is running BUT the streaming is not ready yet (i.e. a device (I'm using a GoPro) is not pushing its stream to the server yet) then AVPro will hang for ~20 seconds, because it waits for an internal call (WindowsMediaPlayer.Native.OpenSource) while running on the main thread. Is it possible to open the media in a secondary thread or to have a timeout? The issue looks similar to this one but I don't think I can enable the "fast start" in this case.

My setup

To Reproduce

  1. Setup a MediaPlayer with Direct Show and LAV Filters
  2. Run Monaserver.exe to start the RTMP server without pushing any stream
  3. Open rtmp://localhost in the MediaPlayer. It will throw an error after 20 seconds of freeze
ThisIsUniqueName commented 3 years ago

I meet the same problem,And i have not idea ,Hope to be resolved。 And when i simultaneous play much rtmp stream,i need wait a long time