Opened 13 years ago

Closed 13 years ago

#1881 closed defect (fixed)

Subtitles out off sync in .mkv files because lavf recognize wrong fps of a movie

Reported by: cameronpoe@… Owned by: reimar
Priority: important Component: demuxer
Version: 1.0rc4 Severity: major
Keywords: Cc: cehoyos
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

I noticed when watching matroska files (.mkv) the default demuxer 'lavf' (or/and 'lavfpref') are always showing 24.000 fps when it should be actually 23.976 fps. Because of this subtitles in MicroDVD format get out off sync while watching the movie and at the end there is a few seconds difference.

On MPlayer-1.0rc4_r31930 I could change demuxer to 'mkv' and the movie was recognized as 23.976 by this 'mkv' demuxer and subtitles where shown correctly through the whole movie. It worked with 'lavf' as well but only when I manually used option '-fps 24000/1001'. I actually prefered 'mkv' because with 'lavf -fps 24000/1001' subtitles flickered and that was a bit annoying.

There is big problem with a new version - MPlayer-1.0rc4_r32749 - I can't change demuxer to 'mkv' :( I mean I can and it shows correct 23.976 fps but it won't play the movie at all. The second problem with this version is - when I force 'lavf' to 23.976 fps using '-fps 24000/1001' the subtitles won't sync with the picture like on previous version of MPlayer :(

I noticed something else on both versions. If a .mkv movie comes with built-in subtitles the 'lavf' (and 'lavfpref') demuxer will recognize correct fps (23.976 fps) so the subtitles opened from a separate file are all fine - synchronized with the picture :)

Change History (12)

comment:1 by cameronpoe@…, 13 years ago

Priority: normalimportant

comment:2 by cehoyos, 13 years ago

Cc: cehoyos@… added

Did you upload a sample that does not work with -demuxer mkv?

comment:3 by cameronpoe@…, 13 years ago

(In reply to comment #1)

Did you upload a sample that does not work with -demuxer mkv?

There you go: http://rapidshare.com/files/249845185/TG1301Sample.mkv

comment:4 by cehoyos, 13 years ago

Your sample plays fine for me with -demuxer mkv

comment:5 by cameronpoe@…, 13 years ago

(In reply to comment #3)

Your sample plays fine for me with -demuxer mkv

You are right but when I use this command it doesn't play the sample:

quinn@linux-lap:~/Video> /usr/bin/mplayer -noquiet -nofs -nomouseinput -demuxer mkv -ac ffaac -sub-fuzziness 1 -identify -slave -vo gl -ao alsa -nokeepaspect -nodr -double -input nodefault-bindings:conf=/dev/null -stop-xscreensaver -monitorpixelaspect 1 -ass -embeddedfonts -ass-line-spacing 0 -ass-font-scale 1 -ass-styles /home/quinn/.config/smplayer/styles.ass -fontconfig -font Arial -subfont-autoscale 0 -subfont-osd-scale 20 -subfont-text-scale 20 -subcp CP1250 -vid 0 -subpos 100 -volume 92 -nocache -ss 5 -osdlevel 0 -idx -vf-add screenshot -slices -channels 2 -af scaletempo,equalizer=0:0:0:0:0:0:0:0:0:0 -softvol -softvol-max 110 /home/quinn/Video/TG1301Sample.mkv
MPlayer dev-SVN-r32749-4.5-openSUSE Linux 11.3 (x86_64)-Packman (C) 2000-2010 MPlayer TeamCan't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /home/quinn/Video/TG1301Sample.mkv.
ID_CHAPTER_ID=0
ID_CHAPTER_0_START=0
ID_CHAPTER_0_NAME=00:00:00.097
ID_VIDEO_ID=0
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
ID_AUDIO_ID=0
ID_AID_0_LANG=eng
[mkv] Track ID 2: audio (A_AAC), -aid 0, -alang eng
[mkv] No video track found/wanted.
Matroska file format detected.
VIDEO: [avc1] 624x352 24bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=/home/quinn/Video/TG1301Sample.mkv
ID_DEMUXER=mkv
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=624
ID_VIDEO_HEIGHT=352
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=1.7727
ID_AUDIO_FORMAT=MP4A
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=24000
ID_AUDIO_NCH=2
ID_START_TIME=0.04
ID_LENGTH=100.22
ID_SEEKABLE=1
ID_CHAPTERS=1
[gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
Opening video filter: [ass auto=1]
Couldn't open video filter 'ass'.
ASS: cannot add video filter
Opening video filter: [screenshot]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
==========================================================================
Forced audio codec: ffaac
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Ignoring broken container sample rate for AAC with SBR
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
ID_AUDIO_CODEC=ffaac
[Mixer] No hardware mixing, inserting volume filter.
Starting playback...
A: 0.1 V: 0.0 A-V: 0.085 ct: -0.006 0/ 0 ??% ??% ??,?% 0 0

Exiting... (End of file)
ID_EXIT=EOF

comment:6 by cameronpoe@…, 13 years ago

...but if I change the demuxer in that command to lavfpref it plays it fine then, so that's why I reported this bug because on previous version of MPlayer I didn't have that issue:

quinn@linux-lap:~/Video> /usr/bin/mplayer -noquiet -nofs -nomouseinput -demuxer lavfpref -ac ffaac -sub-fuzziness 1 -identify -slave -vo gl -ao alsa -nokeepaspect -nodr -double -input nodefault-bindings:conf=/dev/null -stop-xscreensaver -monitorpixelaspect 1 -ass -embeddedfonts -ass-line-spacing 0 -ass-font-scale 1 -ass-styles /home/quinn/.config/smplayer/styles.ass -fontconfig -font Arial -subfont-autoscale 0 -subfont-osd-scale 20 -subfont-text-scale 20 -subcp CP1250 -vid 0 -subpos 100 -volume 92 -nocache -ss 5 -osdlevel 0 -idx -vf-add screenshot -slices -channels 2 -af scaletempo,equalizer=0:0:0:0:0:0:0:0:0:0 -softvol -softvol-max 110 /home/quinn/Video/TG1301Sample.mkv
MPlayer dev-SVN-r32749-4.5-openSUSE Linux 11.3 (x86_64)-Packman (C) 2000-2010 MPlayer TeamCan't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /home/quinn/Video/TG1301Sample.mkv.
libavformat file format detected.
[matroska,webm @ 0x167a890] Estimating duration from bitrate, this may be inaccurate
ID_CHAPTER_ID=0
ID_CHAPTER_0_START=0
ID_CHAPTER_0_END=100223
ID_CHAPTER_0_NAME=00:00:00.097
ID_VIDEO_ID=0
[lavf] stream 0: video (h264), -vid 0
ID_AUDIO_ID=0
ID_AID_0_LANG=eng
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO: [H264] 624x352 0bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=/home/quinn/Video/TG1301Sample.mkv
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=624
ID_VIDEO_HEIGHT=352
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=1.7727
ID_AUDIO_FORMAT=MP4A
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_START_TIME=0.00
ID_LENGTH=100.22
ID_SEEKABLE=1
ID_CHAPTERS=1
[gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
Opening video filter: [ass auto=1]
Couldn't open video filter 'ass'.
ASS: cannot add video filter
Opening video filter: [screenshot]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
==========================================================================
Forced audio codec: ffaac
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->192000)
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
ID_AUDIO_CODEC=ffaac
[Mixer] No hardware mixing, inserting volume filter.
Starting playback...
Movie-Aspect is 1.77:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.7727
[swscaler @ 0xd2a1e0]using unscaled yuv420p -> rgb24 special converter
VO: [gl] 624x352 => 624x352 Planar YV12
A: 10.6 V: 10.6 A-V: 0.002 ct: 0.036 0/ 0 30% 20% 5.4% 14 0

comment:7 by cameronpoe@…, 13 years ago

I found out what makes the problem using that command with the newest version of MPlayer!!!
It's because it doesn't recognize the video stream with option '-vid 0' so when I changed it to 'vid -1' it plays it fine using '-demuxer mkv' :)

comment:8 by cameronpoe@…, 13 years ago

...but still there is a BIG PROBLEM because subtitles in MicroDVD format are totally out off sync with picture on the newest MPlayer-1.0rc4_r32749 even when using mkv as a demuxer and 'vid -1'!!! :(

comment:9 by cameronpoe@…, 13 years ago

PS. I made a mistake in my first top message saying 'I noticed something else on both versions.' It should be 'I noticed something else but just on the previous (older) version of MPlayer.'

comment:10 by cameronpoe@…, 13 years ago

I have noticed a new version of MPlayer came out but this problem is still not fixed!!! :(

comment:11 by cehoyos, 13 years ago

This may be fixed in latest (today's) svn / git.

Please test, Carl Eugen

comment:12 by cameronpoe@…, 13 years ago

Resolution: fixed
Status: newclosed

It seems this problem with wrong fps recognition by default demuxer 'lavf' ('lavfpref') in newest MPlayer while playing *.mkv movies is finally fixed :)
Thank you!!!

Note: See TracTickets for help on using tickets.