RenderHeads / UnityPlugin-AVProMovieCapture

AVPro Movie Capture is a Unity Plugin for advanced video capture to AVI/MP4/MOV files
https://renderheads.com/products/avpro-movie-capture/
43 stars 8 forks source link

[Question] Getting duration of video? #365

Open artoonie opened 5 months ago

artoonie commented 5 months ago

AVPro Movie Capture Version

5.2.0

Which platform is your question for?

iOS, Android

Your question

How can I get the true duration of the video? Not the number of encoded frames * fps, but, the timestamp of the last frame minus the first frame?

I currently calculate this based on Start and Stop time, but that can be off by a few frames. I'm hoping for something that's almost exactly equal to AVProVideo's MediaPlayer.Info.GetDuration() without using AVProVideo for this.

Chris-RH commented 5 months ago

Hi @artoonie,

I'm afraid there isn't a way to do that. It looks like it would be quite tricky to do as there are a few variables to consider. Its something that we can look at implementing in the future, but its unlikely to be any time soon.

With AVPro Video, duration is just part of the information that you get when opening the video file.

artoonie commented 5 months ago

Gotcha, will use AVProVideo and lazily update the metadata if we detect it's off. Thanks for the quick response! Would appreciate this eventually getting in to AVPro Movie Capture to avoid the memory hit of opening a large video file, but I understand it's low priority.