Subtitles out-of-sync with 23.976 mkv files with lavf demuxer
Hi! Frame-based (microdvd) subtitles currently get out of sync towards the end of 23.976 fps H264 matroska files (some 1-2s in 40min). This doesn't happen with the legacy demuxer (-demuxer mkv). AFAICS this happens because demux_lavf.c uses st->r_frame_rate to determine sh_video->fps and sh_video->frametime, and r_frame_rate is rounded up to 24 fps by av_find_stream_info(). I'm not immediately sure what is the correct solution here, so does someone else know? -- Anssi Hannula
On Fri, Jan 28, 2011 at 02:40:17AM +0200, Anssi Hannula wrote:
AFAICS this happens because demux_lavf.c uses st->r_frame_rate to determine sh_video->fps and sh_video->frametime, and r_frame_rate is rounded up to 24 fps by av_find_stream_info().
I'm not immediately sure what is the correct solution here, so does someone else know?
Yes, if the video isn't 24 fps, av_find_stream_info shouldn't return 24 fps. Fixing whatever goes wrong would be the most preferable solution by far.
On 28.01.2011 20:24, Reimar Döffinger wrote:
On Fri, Jan 28, 2011 at 02:40:17AM +0200, Anssi Hannula wrote:
AFAICS this happens because demux_lavf.c uses st->r_frame_rate to determine sh_video->fps and sh_video->frametime, and r_frame_rate is rounded up to 24 fps by av_find_stream_info().
I'm not immediately sure what is the correct solution here, so does someone else know?
Yes, if the video isn't 24 fps, av_find_stream_info shouldn't return 24 fps. Fixing whatever goes wrong would be the most preferable solution by far.
Indeed, I see now that the rounding isn't intentional. I'll continue looking at fixing this on the FFmpeg side (expect a patch there in the next few days). -- Anssi Hannula
On 28.01.2011 22:46, Anssi Hannula wrote:
On 28.01.2011 20:24, Reimar Döffinger wrote:
On Fri, Jan 28, 2011 at 02:40:17AM +0200, Anssi Hannula wrote:
AFAICS this happens because demux_lavf.c uses st->r_frame_rate to determine sh_video->fps and sh_video->frametime, and r_frame_rate is rounded up to 24 fps by av_find_stream_info().
I'm not immediately sure what is the correct solution here, so does someone else know?
Yes, if the video isn't 24 fps, av_find_stream_info shouldn't return 24 fps. Fixing whatever goes wrong would be the most preferable solution by far.
Indeed, I see now that the rounding isn't intentional. I'll continue looking at fixing this on the FFmpeg side (expect a patch there in the next few days).
For the record, this should be fixed with: http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=78431098f9e306ebe27e769... -- Anssi Hannula
participants (2)
-
Anssi Hannula -
Reimar Döffinger