-
Notifications
You must be signed in to change notification settings - Fork 519
mp4fragment creating extra small fragment #19
Description
I have been finding that mp4fragment has been creating an extra audio fragment with only 3 samples even though the previous fragment has less than the maximum number of samples for the specified duration.
Using this sample file: http://asbctest.s3.amazonaws.com/debug/muxed.mp4
Result looks like this
mp4fragment --verbosity 3 muxed.mp4 cokead_frag.m4f
found regular I-frame interval: 200 frames (at 25.000 frames per second)
fragment: track ID 1 200 samples
fragment: track ID 2 345 samples
fragment: track ID 1 200 samples
fragment: track ID 2 344 samples
fragment: track ID 1 200 samples
fragment: track ID 2 345 samples
fragment: track ID 1 150 samples
fragment: track ID 2 258 samples
fragment: track ID 2 3 samples
As the video is 25fps 200 samples per fragment is exactly on 8 seconds as per the encode and the audio is 44.1Khz so should be 43 packets of 1024 samples second == 344.5 samples.
So are the last 2 fragments for track 2 258 and 3? Shouldn't it be one last fragment of 261 samples? Even if I adjust the fragment duration to longer than the video I still get one last audio fragment of 3 samples.
The result is that when it runs through mp4split is that it is generating one more audio segment than video segment and this is causing some players to error.