Opened 9 years ago

Last modified 8 years ago

#1816 new defect

Stuttering video and audio with styled (ASS/SSA) subs

Reported by: tenfold@… Owned by: eugeni.stepanov@…
Priority: normal Component: libass
Version: 1.0rc4 Severity: normal
Keywords: Cc: compn, tenfold@…
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

At times, which always happens at the same points in files but don't seem to have anything really in common with each other, the video in MKV files with styled subs will stutter for a moment. When it is very bad, the audio also stutters (but it seems like the audio stuttering was introduced in 2010; in 2009 the audio was fine). The stutter always happens right when a subtitle appears.

If you go back and replay the scene again, it will be totally smooth. You have to stop and restart to get it to happen again. When it does happen, it will stutter at the exact same spot.

One example where it can be seen is in [Frostii]_K-On!!_-_18_[CF48B7A4].mkv at the 14-15 second mark, when the text "With that, the leading role of Romeo in Class 3-2's production of Romeo and Juliet" appears. In RC4 the file stutters so badly that it goes silent for a quarter second, but in svn20091207, the sound is fine but the video stutters and then jumps ahead a few frames.

If subtitles are off or the SSA/ASS library is off, it plays perfectly smoothly, but not if they are on. I've tried every setting I could find but as far as I can tell, the only workarounds are to turn of styled subtitles or to use VLC or MPC-HC (in a virtualized XP). It happens with vdpau on or off, compositing on or off. It happens in mkv, lavfpref, and lavf demuxers. It happens in both smplayer and gnome GUIs. I can't get it to work from the command line unless I have smplayer open to accept the video window, so I can't verify that it is not GUI related. Mplayer's CPU use does shoot up for a moment, but only to 27%, so it's not like your typical video stuttering problem. It happens on high definition and low definition files.

This bug is not a big deal but it is very widespread. A day doesn't go by when I don't see it. [TMD_A-Destiny]_Bakuman_05_[480p][A0FFC168] at 8-9 seconds is another example, picked at random. Usually it's just a minor stutter on panning scenes when a subtitle is displayed. I tend to ignore it because I'm used to an old machine that would stutter on pans anyway, but it only happens the first time. If I back up and play it again, it's perfect. It's a lot more noticeable now that the audio is also glitchy, enough for me to go back to Ubuntu 9.10 until it is fixed (my main reason for upgrading was to get a version of mplayer that could handle mkv header compression, but I'll trade that for clean sound).

If there were a way to get mplayer to process the file a few seconds before playing it... but I can't seem to find one.

This is something that has always bothered me and just now, having upgraded and still seeing the error, I'm reporting it. I thought it was restricted to the version I had, but now I've seen this with 1.0rc4-4.4.5 (in ubuntu 10.10) and svn20091207 (in ubuntu 9.10).

Change History (2)

comment:1 Changed 8 years ago by compn

  • Cc patriotact@… added

it would be helpful if you pasted some mplayer output.

does using -ao null fix it? are you using -ao pulseaudio?

comment:2 Changed 8 years ago by tenfold@…

  • Cc tenfold@… added

Noticed my bookmark for this and realized I'd forgotten to check back. And apparently forgot my password.

I discovered something else, rather by accident. This only happens with -vo vdpau. It doesn't matter of vdpau is in use (for example, when the codec is one that doesn't support vdpau, like xvid) but it seems to require the vdpau driver plus styled subs. -vo vdpau without styled subs or -vo xv and styled subs both work as workarounds. Although with with xv, a lot more CPU gets tied up.

The problem still happens with -ao null instead of -ao pulseaudio.

Log of the 1st 15 seconds. This is the ubuntu karmic version because I don't want to reboot.

/usr/bin/mplayer -noquiet -nofs -nomouseinput -vc ffh264vdpau,ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau, -lavdopts threads=2 -sub-fuzziness 1 -identify -slave -vo vdpau -ao pulse -nokeepaspect -framedrop -dr -double -input nodefault-bindings:conf=/dev/null -nostop-xscreensaver -wid 92274703 -monitorpixelaspect 1 -ass -embeddedfonts -ass-line-spacing 0 -ass-font-scale 1 -ass-styles /home/ten/.config/smplayer/styles.ass -fontconfig -font Arial -subfont-autoscale 0 -subfont-osd-scale 20 -subfont-text-scale 20 -subcp ISO-8859-1 -subpos 100 -volume 12 -nocache -osdlevel 0 -idx -correct-pts -slices -channels 2 -af scaletempo -softvol -softvol-max 300 -nolirc /shows/[Frostii]_K-On!!_-_18_[CF48B7A4].mkv

MPlayer SVN-r29978-4.4.1 (C) 2000-2009 MPlayer Team
Terminal type `unknown' is not defined.

Playing /data/shows/Keep/K-On 2/[Frostii]_K-On!!_-_18_[CF48B7A4].mkv.
ID_VIDEO_ID=0
ID_VID_0_NAME=Video (H.264)
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "Video (H.264)", -vid 0
ID_AUDIO_ID=0
ID_AID_0_NAME=Japanese Audio (2ch LC-AAC)
ID_AID_0_LANG=jpn
[mkv] Track ID 2: audio (A_AAC) "Japanese Audio (2ch LC-AAC)", -aid 0, -alang jpn
ID_SUBTITLE_ID=0
ID_SID_0_NAME=English Subtitles (ASS)
ID_SID_0_LANG=eng
[mkv] Track ID 3: subtitles (S_TEXT/ASS) "English Subtitles (ASS)", -sid 0, -slang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1280x720 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=/data/shows/Keep/K-On 2/[Frostii]_K-On!!_-_18_[CF48B7A4].mkv
ID_DEMUXER=mkv
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=1280
ID_VIDEO_HEIGHT=720
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=1.7778
ID_AUDIO_FORMAT=MP4A
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=1469.93
ID_SEEKABLE=1
ID_CHAPTERS=6
Couldn't open video filter 'ass'.
ASS: cannot add video filter
[ass] Init
[ass] Updating font cache.
==========================================================================
Forced video codec: ffh264vdpau
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
[VD_FFMPEG] XVMC-accelerated MPEG-2.
Selected video codec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))
==========================================================================
ID_VIDEO_CODEC=ffh264vdpau
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
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: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
[pulse] working around probably broken pause functionality,

see http://www.pulseaudio.org/ticket/440

AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
[Mixer] No hardware mixing, inserting volume filter.
Starting playback...
[VD_FFMPEG] XVMC-accelerated MPEG-2.
VDec: vo config request - 1280 x 720 (preferred colorspace: H.264 VDPAU acceleration)
VDec: using H.264 VDPAU acceleration as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.7778
VO: [vdpau] 1280x720 => 1280x720 H.264 VDPAU acceleration
ID_VIDEO_TRACK=1
ID_AUDIO_TRACK=0

Note: See TracTickets for help on using tickets.