Skip to content

Jerky/stuttery playback with certain xvid files

Hi, Some xvid encoded files have non-smooth playback. An example of output for one of these files from tools/messages is:

main debug: processing request item: Xvid_jerky_sample_1.avi, node: Playlist, skip: 0
main debug: resyncing on Xvid_jerky_sample_1.avi
main debug: Xvid_jerky_sample_1.avi is at 0
main debug: starting playback of the new playlist item
main debug: resyncing on Xvid_jerky_sample_1.avi
main debug: Xvid_jerky_sample_1.avi is at 0
main debug: creating new input thread
main debug: Creating an input for 'Xvid_jerky_sample_1.avi'
main debug: using timeshift granularity of 50 MiB, in path '/tmp'
main debug: `file:///root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi' gives access `file' demux `' path `/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi'
main debug: creating demux: access='file' demux='' location='/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi' file='/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi'
main debug: looking for access_demux module matching "file": 19 candidates
main debug: no access_demux modules matched
main debug: creating access 'file' location='/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi', path='/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi'
main debug: looking for access module matching "file": 22 candidates
filesystem debug: opening file `/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi'
main debug: using access module "filesystem"
main debug: Using stream method for AStream*
main debug: starting pre-buffering
main debug: received first data after 0 ms
main debug: pre-buffering done 1024 bytes in 0s - 142857 KiB/s
main debug: looking for stream_filter module matching "any": 9 candidates
main debug: no stream_filter modules matched
main debug: looking for stream_filter module matching "stream_filter_record": 9 candidates
main debug: no stream_filter modules matched
main debug: creating demux: access='file' demux='' location='/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi' file='/root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi'
main debug: looking for demux module matching "avi": 64 candidates
avi debug: 
avi debug: 
avi debug: 
avi debug: 
avi debug: 
avi debug: 
avi debug: 
avi debug: skipping movi chunk
avi debug: 
avi debug: * LIST-root size:16490652 pos:0
avi debug: + RIFF-AVI size:16490644 pos:0
avi debug: | + LIST-hdrl size:8516 pos:12
avi debug: | | + avih size:56 pos:24
avi debug: | | + LIST-strl size:4220 pos:88
avi debug: | | | + strh size:56 pos:100
avi debug: | | | + strf size:40 pos:164
avi debug: | | | + JUNK size:4096 pos:212
avi debug: | | + LIST-strl size:4212 pos:4316
avi debug: | | | + strh size:56 pos:4328
avi debug: | | | + strf size:32 pos:4392
avi debug: | | | + JUNK size:4096 pos:4432
avi debug: | + LIST-movi size:16307380 pos:8536
avi debug: | + idx1 size:174720 pos:16315924
avi debug: AVIH: 2 stream, flags HAS_INDEX IS_INTERLEAVED 
avi debug: stream[0] rate:25 scale:1 samplesize:0
avi debug: stream[0] video(XVID) 608x352 12bpp 25.000000fps
main debug: selecting program id=0
avi debug: stream[1] rate:48000 scale:1152 samplesize:0
avi debug: stream[1] audio(0x55 - MPEG Audio layer 1/2/3) 2 channels 48000Hz 16bits
avi debug: selected standard index for stream[0]
avi debug: selected standard index for stream[1]
avi debug: stream[0] created 4095 index entries
avi error: no key frame set for track 1
avi debug: stream[1] created 6825 index entries
avi debug: stream[0] length:163 (based on index)
avi debug: stream[1] length:163 (based on index)
main debug: using demux module "avi"
main debug: looking for a subtitle file in /root/teststuff/vlc_stutter/
main debug: looking for decoder module matching "any": 40 candidates
avcodec debug: trying to use direct rendering
avcodec debug: allowing 3 thread(s) for decoding
avcodec debug: avcodec codec (MPEG-4 Video) started
avcodec debug: using frame thread mode with 3 threads
main debug: using decoder module "avcodec"
main debug: looking for decoder module matching "any": 40 candidates
main debug: using decoder module "mpeg_audio"
main debug: looking for meta reader module matching "any": 2 candidates
qt4 debug: IM: Setting an input
lua debug: Trying Lua scripts in /root/.local/share/vlc/lua/meta/reader
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
main debug: no meta reader modules matched
main debug: `file:///root/teststuff/vlc_stutter/Xvid_jerky_sample_1.avi' successfully opened
main debug: Buffering 0%
main debug: Buffering 8%
main debug: Buffering 16%
main debug: Buffering 25%
main debug: Buffering 33%
main debug: Buffering 41%
main debug: Buffering 50%
main debug: Buffering 58%
main debug: Buffering 66%
main debug: Buffering 75%
main debug: Buffering 83%
main debug: Buffering 91%
main debug: Buffering 100%
main debug: Stream buffering done (325 ms in 0 ms)
main debug: looking for text renderer module matching "any": 3 candidates
freetype debug: Building font databases.
freetype debug: Took 1 microseconds
freetype debug: Using Serif Bold as font from file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
freetype debug: using fontsize: 2
main debug: using text renderer module "freetype"
main debug: looking for video filter2 module matching "any": 55 candidates
swscale debug: 32x32 chroma: YUVA -> 16x16 chroma: RGBA with scaling using Bicubic (good quality)
main debug: using video filter2 module "swscale"
main debug: looking for video filter2 module matching "any": 55 candidates
yuvp debug: YUVP to YUVA converter
main debug: using video filter2 module "yuvp"
main debug: Deinterlacing available
main debug: deinterlace 0, mode blend, is_needed 0
mpeg_audio debug: MPGA channels:2 samplerate:48000 bitrate:32
main debug: Opening vout display wrapper
main debug: looking for vout display module matching "xcb_xv": 13 candidates
main debug: looking for vout window xid module matching "qt4,any": 4 candidates
qt4 debug: requesting video window...
qt4 debug: Video was requested 0, 0
main debug: using vout window xid module "qt4"
main debug: looking for inhibit module matching "any": 2 candidates
dbus_screensaver debug: cannot find service org.freedesktop.ScreenSaver
dbus_screensaver debug: cannot find service org.freedesktop.PowerManagement.Inhibit
dbus_screensaver debug: found service org.gnome.SessionManager
main debug: using inhibit module "dbus_screensaver"
xcb_xv debug: connected to X11.0 server
xcb_xv debug: vendor : The X.Org Foundation
xcb_xv debug: version: 10900000
xcb_xv debug: using screen 0x1ad
xcb_xv debug: using XVideo extension v2.2
xcb_xv debug: using adaptor NV17 Video Texture
xcb_xv debug: using port 361
xcb_xv debug: using image format 0x30323449
xcb_xv debug: using X11 visual ID 0x21 (depth: 24)
xcb_xv debug: using X11 window 0x03800000
xcb_xv debug: using X11 graphic context 0x03800002
main debug: VoutDisplayEvent 'fullscreen' 0
main debug: VoutDisplayEvent 'resize' 608x352 window
main debug: using vout display module "xcb_xv"
main debug: original format sz 608x352, of (0,0), vsz 608x352, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
main debug: removing module "freetype"
main debug: looking for text renderer module matching "any": 3 candidates
freetype debug: Building font databases.
freetype debug: Took 0 microseconds
freetype debug: Using Serif Bold as font from file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
freetype debug: using fontsize: 2
main debug: using text renderer module "freetype"
avcodec debug: using direct rendering
main debug: reusing audio output
pulse debug: using stereo channel map
main debug: End of video preroll
main debug: Received first picture
xcb_xv debug: display is visible
pulse debug: changed buffer metrics: maxlength=4194304, tlength=46080, prebuf=0, minreq=15360
pulse debug: connected to sink alsa_output.pci-0000_00_05.0.analog-stereo
main debug: output 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes
main debug: looking for audio volume module matching "any": 2 candidates
main debug: using audio volume module "float_mixer"
main debug: input 'mpga' 48000 Hz Stereo frame=1152 samples/969 bytes
main debug: looking for audio filter module matching "scaletempo": 14 candidates
scaletempo debug: format: 48000 rate, 2 nch, 4 bps, fl32
scaletempo debug: params: 30 stride, 0.200 overlap, 14 search
scaletempo debug: 1.000 scale, 1440.000 stride_in, 1440 stride_out, 1152 standing, 288 overlap, 672 search, 2400 queue, fl32 mode
main debug: using audio filter module "scaletempo"
main debug: conversion: 'mpga'->'f32l' 48000 Hz->48000 Hz Stereo->Stereo
main debug: looking for audio converter module matching "any": 12 candidates
main debug: no audio converter modules matched
main debug: looking for audio converter module matching "any": 12 candidates
mpgatofixed32 debug: mpga->f32l, bits per sample: 32
main debug: using audio converter module "mpgatofixed32"
main debug: conversion pipeline complete
main debug: conversion: 'f32l'->'f32l' 48000 Hz->48000 Hz Stereo->Stereo
main debug: conversion pipeline complete
main debug: looking for audio resampler module matching "any": 3 candidates
main debug: using audio resampler module "samplerate"
main debug: End of audio preroll
main debug: Decoder buffering done in 104 ms
pulse debug: base volume: 65536
pulse debug: changing sink 0: alsa_output.pci-0000_00_05.0.analog-stereo (Internal Audio Analogue Stereo)
pulse debug: cannot synchronize start
pulse debug: deferring start (7116 us)
pulse warning: starting late (-17820 us)
pulse debug: started
pulse debug: underflow
pulse debug: changing sink 0: alsa_output.pci-0000_00_05.0.analog-stereo (Internal Audio Analogue Stereo)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 42 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main debug: auto hiding mouse cursor
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main warning: picture is too late to be displayed (missing 40 ms)
main debug: incoming request - stopping current input
main debug: control: stopping input
main debug: incoming request - stopping current input
main debug: finished input
main debug: removing module "avcodec"
avcodec debug: ffmpeg codec (MPEG-4 Video) stopped
main debug: killing decoder fourcc `mp4v', 0 PES in FIFO
main debug: saving a free vout
main debug: reusing provided vout
main debug: removing module "mpeg_audio"
main debug: killing decoder fourcc `mpga', 0 PES in FIFO
main debug: removing module "samplerate"
main debug: removing module "mpgatofixed32"
main debug: removing module "scaletempo"
main debug: removing module "float_mixer"
main debug: keeping audio output
main debug: removing module "avi"
main debug: removing module "filesystem"
main debug: Program doesn't contain anymore ES
main debug: incoming request - stopping current input
main debug: dead input
main debug: destroying useless vout
main debug: removing module "xcb_xv"
dbus_screensaver debug: got cookie 599933768
main debug: removing module "dbus_screensaver"
qt4 debug: releasing video...
pulse debug: changing sink 0: alsa_output.pci-0000_00_05.0.analog-stereo (Internal Audio Analogue Stereo)
qt4 debug: IM: Deleting the input
qt4 debug: Video is not needed anymore
main debug: removing module "freetype"
main debug: removing module "yuvp"
main debug: removing module "swscale"

The problem line seems to be 'main warning: picture is too late to be displayed' (?).

This problem seems to start with Libav commit '759001c534287a96dc96d1e274665feb7059145d', commit title is "lavc decoders: work with refcounted frames". If I build vlc with the commit previous to that (commit no '6e7b50b4270116ded8b874d76cb7c5b1a0341827', commit title "mpegvideo_enc: drop support for reusing the input motion vectors" ) then playback is smooth.

Edited by Rémi Denis-Courmont
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information