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

Use MP4 average frame duration for M3U8 playlist FRAME-RATE calculation #1558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

denis-gudim
Copy link

@denis-gudim denis-gudim commented Jan 13, 2025

Some of MP4 videos have frames daration less than average frame duration, which leads to big FRAME-RATE values in M3U8 playlists.

This pull request offers to use average frame duation for FRAME-RATE into M3U8 playlists for MP4

EXAMPLE:

Current logic:
#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1662071,RESOLUTION=480x854,FRAME-RATE=573.248,CODECS="avc1.64001f,mp4a.40.2",VIDEO-RANGE=SDR ./index-f1-v1-a1.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=843389,RESOLUTION=360x640,FRAME-RATE=573.248,CODECS="avc1.64001e,mp4a.40.2",VIDEO-RANGE=SDR ./index-f2-v1-a1.m3u8

New logic:
#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1662071,RESOLUTION=480x854,FRAME-RATE=30.060,CODECS="avc1.64001f,mp4a.40.2",VIDEO-RANGE=SDR ./index-f1-v1-a1.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=843389,RESOLUTION=360x640,FRAME-RATE=30.060,CODECS="avc1.64001e,mp4a.40.2",VIDEO-RANGE=SDR ./index-f2-v1-a1.m3u8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant