[FFmpeg-devel] [PATCH] libavformat/hlsenc: add AVFMT_VARIABLE_FPS flag to mimic mpegtsenc

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Dec 8 02:40:43 EET 2017


2017-12-08 1:14 GMT+01:00 Aman Gupta <ffmpeg at tmm1.net>:
> From: Aman Gupta <aman at tmm1.net>
>
> Previously, using a filter that changed frame_rate/time_base would work
> as expected with mpegtsenc, but duplicate frames when used with hlsenc
> (which uses mpegtsenc underneath).
>
> For instance, using https://tmm1.s3.amazonaws.com/720p.ts:
>
>     $ ffmpeg -i 720p.ts -c:v libx264 -an -filter:v "yadif=mode=send_field:deint=interlaced" -f mpegts -y single.ts
>     $ ffmpeg -i 720p.ts -c:v libx264 -an -filter:v "yadif=mode=send_field:deint=interlaced" -f hls -hls_time 30 -y segment.m3u8
>
> One would expect single.ts and segment0.ts to be identical, however comparing them shows:
>
>     single.ts:   120 fps,  59.94 tbr, 90k tbn, 239.76 tbc
>     segment0.ts: 120 fps, 119.88 tbr, 90k tbn, 239.76 tbc
>
> Without AVFMT_VARIABLE_FPS set, ffmpeg.c was duplicating frames in the hlsenc
> case and generating segments with double the r_frame_rate.
>
> After this commit, the two muxers generate identical output.

But the mp4 muxer does not support variable frame rate output...

Carl Eugen


More information about the ffmpeg-devel mailing list