New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
首个moof的default_sample_duration为0,导致浏览器播放fmp4首个GOP失败 #285
Comments
我的修改思路是: int fmp4_writer_write(struct fmp4_writer_t* writer, int idx, const void* data, size_t bytes, int64_t pts, int64_t dts, int flags) {
......
duration = dts > track->last_dts && INT64_MIN != track->last_dts ? dts - track->last_dts : 0;
if(duration <= 0) {
duration = 40;
}
} |
怎么排查出来fmp4播放是因为这个default_sample_duration为0的? |
用ffmpeg生成一段可以秒开的fmp4文件, |
我按这个修改了,没有好 |
把mp4文件上传下? |
Uploading 017721038891_1_1713681945suffix.mp4… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我在chrome浏览器播放流式fmp4数据时,会出现首个gop数据播放失败,原因是首个moof的default_sample_duration为0导致的。
https://github.com/ireader/media-server/blob/671c6618772a31e3201d6628b4cf50fb7bf8de3d/libmov/source/fmp4-writer.c#LL415C39-L415C39
如果首帧的dts为0,track->last_dts也为0,所以duration也为0
因为moof表示一个视频段,所以default_sample_duration不应该为0,即便moof里只有一帧数据,对于25fps的视频流default_sample_duration最小也是40,不应该为0
The text was updated successfully, but these errors were encountered: