Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#781 different duration values for each stream

Incorrect_result
open-accepted
nobody
length (1)
3
2013-08-08
2013-08-08
Gergely Lukacsy
No

Hi!

I'm using mediainfo cli to provide technical data (length, codec, resolution, PAR, etc.) for my video database, and I've noticed there's a lot of entries with incorrect durations. It was suspicious that the inaccurate values were all rounded off to the nearest minute, so I've made some tests to figure out what's wrong with my code.

It seems that mediainfo sometimes gives inaccurate value for duration, when using normal mode. However, when using it with --full option, I get a bunch of (redundant) duration values, along with the correct one:

<Duration> 8998150</Duration>
<Duration>2h 29mn</Duration>
<Duration>2h 29mn 58s 150ms</Duration>
<Duration>2h 29mn</Duration>
<Duration>02:29:58.150</Duration>

Tested with 0.7.63.
It looks like it detects different values for each invidual streams.

Discussion

  • I get a bunch of (redundant) duration values

    Each line has a specification, this is wanted (you can choose the one which fits the best for you).

    "2h 29mn 58s 150ms" rounded to "2h 29mn" is not normal, rounding should be "2h 30 mn". I'll check.

    It looks like it detects different values for each invidual streams.

    Each stream has often its own duration, nothing anormal.

     
    • status: open --> closed-accepted
    • Priority: 5 --> 3
     
  • Thanks for the answer!

    Each stream has often its own duration, nothing anormal

    I absolutley agree with that. I've extracted each invidual streams from the video and inspected them with ffmpeg.

    $ffmpeg -i file
    

    ↑ this command does nothing special, but it's enough to extract some basic information from the input file, for example, the duration.
    Here's what I've got:

    video stream - Duration: 02:29:58.01, start: 0.000000, bitrate: 129 kb/s
    audio stream - Duration: 02:29:58.15, start: 0.040000, bitrate: 1503 kb/s
    

    Inspecting the --full output, it looks both audio and video streams have been detected correctly, but it's not clear to me why video is not relevant regarding generic length.

    Full output result:

    Audio track - <Duration>02:29:58.012</Duration>
    Video track - <Duration>02:29:58.150</Duration>
    
     
    Last edit: Gergely Lukacsy 2013-08-08
  • it's not clear to me why video is not relevant regarding generic length.

    I don't understand.

     
    • status: closed-accepted --> open-accepted
     
  • ffmpeg and MediaInfo say the same thing (rounding is after 3 decimals with MediaInfo, 2 decimal with ffmpeg).
    The reported issue is only with "2h 29mn 58s" --> "2h 29mn" (should be "2h 30ms"), right?

     
  • I mean the audio stream's length is visible in the General section instead of the video's length.

    Never mind, I got it now. Mediainfo shows the longest stream's length in the General section.

     
    Last edit: Gergely Lukacsy 2013-08-08