Skip to content
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

fix mp4 stts box bug. #4190

Closed
wants to merge 4 commits into from
Closed

Conversation

suzp1984
Copy link
Contributor

@suzp1984 suzp1984 commented Sep 29, 2024

How to reproduce?

  1. ./objs/srs -c conf/dvr.mp4.conf
  2. ffmpeg -re -i output.flv -c copy -f flv rtmp://localhost/live/livestream
    the output.flv is recorded from a DJI drone, download from this google drive link: https://drive.google.com/file/d/1IVoDXI-WYoIlKiyzs65fCsDRRt0z-EuU/view?usp=sharing
  3. after finished publish this video, play the livestream.*.mp4 located in trunk/objs/nginx/html/live.
  4. the video playback is 2x slower than the original file.

Cause

The Mp4 frame rate is determined by mp4 box: mdhd and stts. But the stts encoding in srs has bugs. The above output.flv video file has a lot of SEI type of nalu, which is not video samples, SRS can't calculate the stts correctly.

How to calculate stts?

check doc ISO/IEC 14496-12:2012(E) 8.6.1.2 Decoding Time to Sample Box.

https://ossrs.net/lts/zh-cn/assets/files/ISO_IEC_14496-12-base-format-2012-b70dd5f101daecd072700609842c9649.pdf

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Sep 29, 2024
@suzp1984 suzp1984 marked this pull request as draft September 29, 2024 11:11
@suzp1984 suzp1984 marked this pull request as ready for review September 29, 2024 16:46
@suzp1984 suzp1984 closed this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EnglishNative This issue is conveyed exclusively in English.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants