You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I'm not sure if this is a muxer issue or the way how I used it was wrong.
I used minimp4 for a live stream recording case. Live video and audio were captured, encoded and fed to the muxer. The duration parameter to the MP4E_put_sample function is calculated from the audio/video capture timestamp, e.g. TSn - TSn-1.
The recorded mp4 file played fine at the beginning, but you can tell the gap between the audio and the video is accumulating. The out of sync becomes noticeable after around 1 minute of play and gets worse as time passes.
So I have two questions:
What's the right way to compute audio and video sample duration for muxer in my case (video framerate may not be fixed)?
Looking into the code, it seems like the audio duration is set in tfhd as the default sample duration, while the video duration is set in trun as sample duration. What are the difference? Am I suppose to use a fix value for the audio duration, because it's the "default sample duration"?
Thanks!
The text was updated successfully, but these errors were encountered:
rhwu
changed the title
a/v sync issue?
a/v sync issue with fragmentation mode ?
Feb 29, 2020
Sorry for the delay, I miss notification for some reason.
In mp4f mode sample duration should be passed directly from MP4E_put_sample.
Problem most likely in fps or sample rate. I tried stream.h264 and stream.pcm from minirtmp with this patch:
First of all, I'm not sure if this is a muxer issue or the way how I used it was wrong.
I used minimp4 for a live stream recording case. Live video and audio were captured, encoded and fed to the muxer. The duration parameter to the MP4E_put_sample function is calculated from the audio/video capture timestamp, e.g. TSn - TSn-1.
The recorded mp4 file played fine at the beginning, but you can tell the gap between the audio and the video is accumulating. The out of sync becomes noticeable after around 1 minute of play and gets worse as time passes.
So I have two questions:
What's the right way to compute audio and video sample duration for muxer in my case (video framerate may not be fixed)?
Looking into the code, it seems like the audio duration is set in tfhd as the default sample duration, while the video duration is set in trun as sample duration. What are the difference? Am I suppose to use a fix value for the audio duration, because it's the "default sample duration"?
Thanks!
The text was updated successfully, but these errors were encountered: