Log in

View Full Version : How to get the duration of a Blu-ray disk with millisecond accuracy?


yellowolf
4th December 2019, 13:06
I want to get the duration with millisecond accuracy and have tried BDInfo 0.7.5.5 (GUI). However, it reports the duration as hh:mm:ss without the precision of milliseconds. Any help would be deeply appreciated.:thanks:

Sharc
4th December 2019, 13:25
Number of frames / framerate.
Isn't the time resolution = 1/framerate, means for a 60fps it is 16.667 ms, or for a typical blu-ray movie @23.976 fps the time resolution is 41.708ms? But never 'milliseconds accuracy'.

ocean
4th December 2019, 17:50
I want to get the duration with millisecond accuracy and have tried BDInfo 0.7.5.5 (GUI). However, it reports the duration as hh:mm:ss without the precision of milliseconds. Any help would be deeply appreciated.:thanks:


Hi yellowolf, welcome to the forum, you can try mediainfo by selecting advanced mode:

https://www.videohelp.com/software/MediaInfo

https://i.ibb.co/YfR4NGk/mediainfo.png (https://ibb.co/YfR4NGk)

yellowolf
5th December 2019, 10:43
Hi yellowolf, welcome to the forum, you can try mediainfo by selecting advanced mode:

https://www.videohelp.com/software/MediaInfo

https://i.ibb.co/YfR4NGk/mediainfo.png (https://ibb.co/YfR4NGk)
Hi ocean, thank you for your help, I never notice this feature before. As I want to detect the duration of quite a lot of BDs, I would like to use the command line version of MediaInfo. The basic usage is "mediainfo.exe k:\BDMV\PLAYLIST\00800.mpls". However, it seems that MediaInfo always takes over 3 minutes to list all the detailed information for each BD. I have tried some options to accelerate this progress but no gains. As what I need is only the duration, is it possible to shorten this process by using appropriate options of MediaInfo?

Ghitulescu
5th December 2019, 17:35
How to get the duration of a Blu-ray disk with millisecond accuracy?

https://chronexttime.imgix.net/C/7/C76980/C76980_5a661936f1a21.jpg


Now, seriously, why do you need this precision? In particular with DF the duration may actually differ across various players.
PS: not even the audio is required to be aligned with video at millisecond (IIRC it's 1/3 frame that is some 10 milliseconds).

ocean
5th December 2019, 19:03
Use the GUI interface to read, is immediate, example:

https://i.ibb.co/q7vLcrz/mediainfo.png (https://ibb.co/q7vLcrz)

Ghitulescu
6th December 2019, 08:48
Why picking up 1h 32m 54s 610ms and not 1h 37m 53s 11f?

Let's say the movie has 140787 frames.
If the speed is 23.976fps, the time in seconds is almost 5872 seconds (xxx1, 99699699 etc etc).
But if it's 24/1.001, it will be already 6 millisenconds off. By true 24fs, it will play for ~5866 seconds: 6120 milliseconds less.
To further push this phylosophically discussion into the absurd, let's notice that the last frame has no proper duration (all other frames are replaced by the next image at its PTS (Presentation Time Stamp), that is its duration is given by the difference between those two PTSs. It should be also a PTS after the last frame (link-pts), but AFAIK is not mandatory used, many players giving the last frame the same duration as the preceding one/s or using pkt-duration (imprecise). The clock is also required to be within 4 millisecond tolerance.


Thus it all boils down to what the OP intends to do....

r0lZ
6th December 2019, 12:12
Why picking up 1h 32m 54s 610ms and not 1h 37m 53s 11f?
:eek: Indeed, it's a huge bug of MediaInfo!

yellowolf
6th December 2019, 14:48
Use the GUI interface to read, is immediate,
Thanks a lot. Why MediaInfo gives more than one duration, among which some ones are with the totally same format and value? Which duration should I believe?:scared:

ocean
6th December 2019, 16:13
Thanks Ghitulescu for the clarification, mine was just an example where to read the time in milliseconds, it is clear if the frames are: 140787:23,976 (fps)= 5871,997:60=97,866.... the value can be 1h 37m 51s 997 ms.

yellowolf
6th December 2019, 16:50
Why picking up 1h 32m 54s 610ms and not 1h 37m 53s 11f?

Let's say the movie has 140787 frames.
If the speed is 23.976fps, the time in seconds is almost 5872 seconds (xxx1, 99699699 etc etc).
But if it's 24/1.001, it will be already 6 millisenconds off. By true 24fs, it will play for ~5866 seconds: 6120 milliseconds less.
To further push this phylosophically discussion into the absurd, let's notice that the last frame has no proper duration (all other frames are replaced by the next image at its PTS (Presentation Time Stamp), that is its duration is given by the difference between those two PTSs. It should be also a PTS after the last frame (link-pts), but AFAIK is not mandatory used, many players giving the last frame the same duration as the preceding one/s or using pkt-duration (imprecise). The clock is also required to be within 4 millisecond tolerance.


Thus it all boils down to what the OP intends to do....

Thanks your scientific explanation. As a layman, I seem to have catch the point.