mp4parser icon indicating copy to clipboard operation
mp4parser copied to clipboard

How to adjust the frame playback speed when muxing H264 to MP4

Open pinkfloyda opened this issue 8 years ago • 5 comments

Currently I am developing a media streaming app in Android (<=4.2), I need to use mp4parser at the final step to convert raw H264 file to MP4 file. Currently the issue is the final mp4 video plays too fast! And I searched around, it seems like H264 does not have timing info for each frame, it is the Muxer's responsibility. Does MP4Parser can do the timing for each frame?

Currently, I control the playback speed by providing timeScale and frameTick parameters to H264TrackImpl, I found that tune timeScale / frameTick = 10 seems normal speed. But it is really hard to keep sync with AAC audios recorded separately. Does MP4Parser support adjust the Video frames along with the Audio Track?

pinkfloyda avatar Sep 29 '15 02:09 pinkfloyda

Is this the only way to control speed ? i see in BasicContainer there is also timeScale Box but didn't find the frameTick yet

flieks avatar Nov 30 '15 15:11 flieks

It's in the Decoding Time to Sample box - typically at /moov/trak/mdia/minf/stbl/stts

2015-11-30 16:17 GMT+01:00 De Lille Felix [email protected]:

Is this the only way to control speed ? i see in BasicContainer there is also timeScale Box but didn't find the frameTick yet

— Reply to this email directly or view it on GitHub https://github.com/sannies/mp4parser/issues/111#issuecomment-160658088.

sannies avatar Nov 30 '15 15:11 sannies

hi @sannies thanks but where does /moov/trak/mdia/minf/stbl/stts point to ? a file on github here ? or in the boxes? i only found:

  • sampleDescriptionBox
  • timeToSampleBox
  • syncSampleBox
  • SampleToChunkBox
  • SampleSizeBox
  • StaticChunkOffsetBox

in the boxes in BasicContainer

ah ok i understand i'm navigating to it now

flieks avatar Nov 30 '15 15:11 flieks

see this @sannies https://github.com/sannies/mp4parser/issues/144

flieks avatar Nov 30 '15 15:11 flieks

hi, have anyone fixed the synchronization problem?

designerMichael avatar Mar 13 '20 10:03 designerMichael