UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

Prefer timing over fidelity option?

Open M100FAT opened this issue 2 years ago • 6 comments

Hello, I've noticed that AVvideopro by default seems to prefer to keep the video running smoothly than to drop frames. However in the project we are currently working on it is essential that the timing is kept consistent. I've noticed that the mediaPlayer.Control.GetCurrentTime() time often does not match the Time.time that has passed since the start of the video. It is also not consistent. In a short video this doesn't really cause any troubles but in longer videos this means the endtime of the video may differ quite a bit. Is there any option to prefer timing over neat playback?

Regarding video: H264 mp4 1920x1080 25fps 89.9MB 48.000 khz audio sample rate /Only thing that is slightly non-standard is that the bitrate is 15mbps (where normally for 1080p i'd expect 8-10)/ Edit: I had an older version, the newer version has a bitrate of 7611kbps. Playing locally. (From the streaming assets)

Using it on windows 10 Unity 2020.3. Multiple machines, it gets worse if the system specs are lower. (no surprise there ofcourse)

Another bit of added info, it doesn't always have this problem, its sporadic.

M100FAT avatar Oct 24 '22 12:10 M100FAT

Please provide platform details

Ste-RH avatar Oct 24 '22 12:10 Ste-RH

What sort of media are you playing (resolution, framerate, codec, file size) Are you playing it locally or streaming it?

Chris-RH avatar Oct 25 '22 07:10 Chris-RH

What sort of time differences are you getting, and over what period of time? Are you able to link to the media you are using or email it to [email protected]

Chris-RH avatar Oct 25 '22 09:10 Chris-RH

At the start its like 0.03 seconds (perfectly acceptable and also could be due to not starting the timer on the exact same frame as the video starts) but some times at the end of the video we have measured time differences of up to 1.5 seconds at the end of the video. (this is with a video of 1:38 seconds duration.)

I cannot send you the video I'm afraid as its property of a customer. But the relevant data is below: VideoData

Edit: Sorry, uploaded the data of an older version, this one does have a more expected bitrate. I've also edited my main post.

M100FAT avatar Oct 25 '22 09:10 M100FAT

Are you using Media Foundation, DirectShow or WinRT? Have you tried opening the media first before playing, to allow a little bit of a buffer?

Chris-RH avatar Oct 25 '22 09:10 Chris-RH

Currently its set to media foundation but we have tried direct show too, didn't seem to matter. We load the video in the gamestate before it is used (more than a minute before it has to be used at the minimum usually much more).

M100FAT avatar Oct 25 '22 11:10 M100FAT