0

Trying to create fragmented MP4 file from a non-fragmented one via command

mp4fragment --fragment-duration 10000 5ca31321e4b068348e2220a9-480p.mp4 5ca31321e4b068348e2220a9-480p.mp4_fragmented

But got media with incorrect duration of 2880000 ms (~ 48 minutes)

mediainfo --Inform=file:///var/cache/tomcat/temp/SC2024943881495774878TMP 5ca31321e4b068348e2220a9-480p.mp4_fragmented 
CompleteName=5ca31321e4b068348e2220a9-480p.mp4_fragmented

Duration=2880000
Width=848
Height=480 BitRate=1099968 VideoId=1
AspectRatio=1.767
Language_3=

The original media file duration is 2880040:

mediainfo --Inform=file:///var/cache/tomcat/temp/SC2024943881495774878TMP 5ca31321e4b068348e2220a9-480p.mp4

Duration=2880040
Width=640
Height=360
BitRate=800000
VideoId=1
AspectRatio=1.778
Language_3=

Lesha Pipiev
  • 3,251
  • 4
  • 31
  • 65
  • 1
    Is there an audio track? What is its duration? Also what is time base of the video track? Did mp4fragment modify it? is it a multiple of the frame rate? If not, it may just be a rounding error as 40ms is only about one frame. – szatmary Apr 02 '19 at 22:09
  • @szatmary, 1) yes, video has audio, 2) I guess a duration of audio is the same as duration of video, 3) could you please describe what a time base is, 4) yes, mp4fragment modified the original video – Lesha Pipiev Apr 03 '19 at 07:25
  • 1
    2) that is statically VERY unlikely as audio frame durations are not usually multiples of video frames. So there is almost certainly a delta 3) it’s how time is measured in video file. Mp4 uses a (implies) frame number multiplied by a time base ratio. Time stamps can not be more accurate than its time base. 3) I mean was the time base modified? I understand the file was modified. All of this information is required to answer the question. This is a math question, and we are missing at least 5 variables (Audio duration and time base numerator and denominator for source and destination) – szatmary Apr 03 '19 at 11:28

0 Answers0