Opened 3 months ago

Closed 7 weeks ago

#10861 closed defect (invalid)

hls video timing issue groups of frames play back early

Reported by: diviaki Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: hls fps libx264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by diviaki)

Summary of the bug:
I am trying to transcode anything to mp4/libx264 then use this source to create hls by copying data.
In this second step some videos play back very strange as if frames in every nth group of about 5 frames played back later then those in the the n+1th group.
How to reproduce:
I see this issue on Safari in Macos (in and out of the browser) and on ios in Safari.
Using ffplay plays back the video without issues.
Note that the original.mp4 has a frame rate of 29.99 fps, and adding the -r:v 30 parameter when creating video.mp4 fixes the odd behaviour in the subsequently created video.ts

% ffmpeg -i original.mp4 -c:v libx264 video.mp4
% ffmpeg -i video.mp4  -c copy video.m3u8
ffmpeg version N-68533-gcc774cd962-static arm64
built on 20240203

Attachments (3)

video.m3u8 (141 bytes ) - added by diviaki 3 months ago.
the m3u8 showing playback issues
video.ts (746.9 KB ) - added by diviaki 3 months ago.
the ts file showing playback issues
video.mp4 (720.3 KB ) - added by diviaki 3 months ago.
source mp4

Download all attachments as: .zip

Change History (10)

by diviaki, 3 months ago

Attachment: video.m3u8 added

the m3u8 showing playback issues

by diviaki, 3 months ago

Attachment: video.ts added

the ts file showing playback issues

by diviaki, 3 months ago

Attachment: video.mp4 added

source mp4

comment:1 by diviaki, 3 months ago

Description: modified (diff)

comment:2 by Balling, 3 months ago

29.99 fps? No, Frame rate : 30.000 FPS

comment:3 by diviaki, 3 months ago

Yes there is an fps diff between them:
mp4:

Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1824 kb/s, 29.99 fps, 29.99 tbr, 1888380000.00 tbn (default)

hls:

Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn

comment:4 by diviaki, 3 months ago

I've been trying to understand the issue and read that timestamp issues can be fixed with a simple

ffmpeg -i video.m3u8 -c copy video_.m3u8

Issueing this command generates an army of warnings like this one, and does not fix the problem:

[vost#0:0/copy @ 0x28e738f0] Non-monotonic DTS; previous: 177892197, current: 177892197; changing to 177892198. This may result in incorrect timestamps in the output file.

Why ffmpeg created such a problematic file?

comment:5 by diviaki, 3 months ago

This flag removes the Non-monotonic DTS warnings but playing back the hls file still looks uncontinous.

ffmpeg -fflags +igndts -i video.mp4 video.m3u8

comment:6 by Balling, 3 months ago

But mediainfo says 30.000 fps, strange

comment:7 by diviaki, 7 weeks ago

Resolution: invalid
Status: newclosed

Further investigation reveled issues in the original 264 file. A new ticket will be opened.

Note: See TracTickets for help on using tickets.