Menu

Question about MPEG-TS duration and framecount

Help
2023-08-16
2023-08-17
  • Paul Rowlands

    Paul Rowlands - 2023-08-16

    Hi,

    Investigating a problem with frame count discrepancies on SD MPEG-TS files. Problem seen on files with odd second durations for example 5 secs or 15 secs. The frame count on these files is 1 frame short. Files with even durations, for example 10, 20, 30, 40, 60 and 120 seconds report the expected frame count. All files are from same transcode source / profile. All outputs report video track 20ms (1/2 frame) short but only 5 secs or 15 secs samples round this duration down resulting in a frame count 1 frame shorter than expected.

    Comparison of MediaInfo outputs not showing obvious point where discrepancy is introduced:

    [cid:43e6d665-a8f2-4823-b354-f664a6f0c31b]

    Looking for some guidance on how durations and frame counts are calculated on ts files. Basic understanding is MediaInfo determines the frame count based on the duration and the frame rate of the media (i.e. duration x frame rate). Would like some detail on other variables that impact that calculation.

    On the example above, video stream on both the 10s file and 15s files are 20ms (1/2 frame short @ 25fps). Not clear why the framecount on the "9s 980ms" video gets rounded up to the expected 10s frame count (250 frames) and the "14s 980ms" video gets rounded down so frame count is 1 frame short of expected 15s (374 frames).

    Thanks!

     
  • Jerome Martinez

    Jerome Martinez - 2023-08-16

    The computing of duration is last timestamp minus first time stamp plus duration of a picture (field for interlaced content).

    If you are sure that you get 375 full (both fields) frames, please share a sample file (link to be sent to info@mediaarea.net if you can not share it publicly).

     
  • Jerome Martinez

    Jerome Martinez - 2023-08-17

    I confirm that we correctly detect all expected frames when we check manually. There is an issue somewhere in the code for computing the timestamp of last field of a MPEG Video stream, definitely on our side.


    Warning: non-paid requests are set to low priority, we don't know when we have time to handle them.
    If you desire to accelerate the development, don't hesitate to contact us for a quotation.

     
  • Paul Rowlands

    Paul Rowlands - 2023-08-17

    Thanks for confirming. Should I raise a separate bug report or is this thread sufficient?

     
  • Paul Rowlands

    Paul Rowlands - 2023-08-17
     

    Related

    Bugs: #1187


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.