Log in

View Full Version : Why is VLC displaying my video with a wrong resolution?


seggitek
3rd November 2018, 16:37
I encoded a video using x264. The video has a resolution of 700x576 and a display resolution of 747x576. Yet when opened in VLC it is displayed at 751x578.

This is the verbose messages output of VLC:

core debug: adding item `movie.mkv' ( file:///home/krisztian/Videos/movie.mkv )
core debug: processing request item: movie.mkv, node: null, skip: 0
core debug: rebuilding array of current - root Playlist
core debug: rebuild done - 1 items, index 0
core debug: starting playback of the new playlist item
core debug: Creating an input for 'movie.mkv'
core debug: resyncing on movie.mkv
core debug: movie.mkv is at 0
core debug: creating new input thread
core debug: Creating an input for 'movie.mkv'
core debug: requesting art for movie.mkv
core debug: using timeshift granularity of 50 MiB, in path '/tmp'
core debug: `file:///home/krisztian/Videos/movie.mkv' gives access `file' demux `' path `/home/krisztian/Videos/movie.mkv'
core debug: specified demux `any'
core debug: creating demux: access='file' demux='any' location='/home/krisztian/Videos/movie.mkv' file='/home/krisztian/Videos/movie.mkv'
core debug: looking for access_demux module matching "file": 20 candidates
core debug: no access_demux modules matched
core debug: creating access 'file' location='/home/krisztian/Videos/movie.mkv', path='/home/krisztian/Videos/movie.mkv'
core debug: looking for access module matching "file": 25 candidates
filesystem debug: opening file `/home/krisztian/Videos/movie.mkv'
core debug: using access module "filesystem"
core debug: Using stream method for AStream*
core debug: starting pre-buffering
core debug: received first data after 0 ms
core debug: pre-buffering done 1024 bytes in 0s - 43478 KiB/s
core debug: looking for stream_filter module matching "any": 9 candidates
core debug: no stream_filter modules matched
core debug: looking for stream_filter module matching "record": 9 candidates
core debug: using stream_filter module "record"
core debug: creating demux: access='file' demux='any' location='/home/krisztian/Videos/movie.mkv' file='/home/krisztian/Videos/movie.mkv'
core debug: looking for meta fetcher module matching "any": 1 candidates
core debug: looking for demux module matching "mkv": 66 candidates
mkv debug: | + Seek head
mkv debug: | | + Seek
mkv debug: | - info at 4151
mkv debug: | + Information
mkv debug: | | + TimecodeScale=1000000
mkv debug: | | + Muxing Application=libebml v1.3.6 + libmatroska v1.4.9
mkv debug: | | + Writing Application=mkvmerge v28.2.0 ('The Awakening') 64-bit
mkv debug: | | + Duration=5224200
mkv debug: | | + Date=Sam Nov 03 14:51:32 2018
mkv debug: | | + UID=1921311931
mkv debug: | | + Seek
mkv debug: | - cues at 1563888617
mkv debug: | + Cues
qt4 debug: IM: Setting an input
lua debug: Trying Lua scripts in /home/krisztian/.local/share/vlc/lua/meta/fetcher
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/fetcher
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
mkv debug: | - loading cues done.
mkv debug: | | + Seek
mkv debug: | - tags at 1563907719
mkv debug: | + Tags
mkv debug: + Tag
mkv debug: | + Targets
mkv debug: | | + TargetTypeValue: 50
mkv debug: | | + TrackUID: 1
mkv debug: | + Simple Tag
mkv debug: | | + Meta BPS: 2201102
mkv debug: | + Simple Tag
mkv debug: | | + Meta DURATION: 01:27:04.200000000
mkv debug: | + Simple Tag
mkv debug: | | + Meta NUMBER_OF_FRAMES: 130605
mkv debug: | + Simple Tag
mkv debug: | | + Meta NUMBER_OF_BYTES: 1437374967
mkv debug: | + Simple Tag
mkv debug: | | + Meta _STATISTICS_WRITING_APP: mkvmerge v28.2.0 ('The Awakening') 64-bit
mkv debug: | + Simple Tag
mkv debug: | | + Meta _STATISTICS_WRITING_DATE_UTC: 2018-11-03 14:51:32
mkv debug: | + Simple Tag
mkv debug: | | + Meta _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
mkv debug: + Tag
mkv debug: | + Targets
mkv debug: | | + TargetTypeValue: 50
mkv debug: | | + TrackUID: 9563179697568169765
mkv debug: | + Simple Tag
mkv debug: | | + Meta BPS: 192000
mkv debug: | + Simple Tag
mkv debug: | | + Meta DURATION: 01:27:04.096000000
mkv debug: | + Simple Tag
mkv debug: | | + Meta NUMBER_OF_FRAMES: 163253
mkv debug: | + Simple Tag
mkv debug: | | + Meta NUMBER_OF_BYTES: 125378304
mkv debug: | + Simple Tag
mkv debug: | | + Meta _STATISTICS_WRITING_APP: mkvmerge v28.2.0 ('The Awakening') 64-bit
mkv debug: | + Simple Tag
mkv debug: | | + Meta _STATISTICS_WRITING_DATE_UTC: 2018-11-03 14:51:32
mkv debug: | + Simple Tag
mkv warning: MKV/Ebml Parser: m_el[mi_level] == NULL
mkv debug: | | + Meta _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
mkv warning: MKV/Ebml Parser: m_el[mi_level] == NULL
mkv warning: MKV/Ebml Parser: Up cannot escape itself
mkv debug: loading tags done.
mkv debug: | | + Seek
mkv debug: | - tracks at 120
mkv debug: | + Tracks
mkv debug: | | + Track Entry
mkv debug: | | | + Track Number=1
mkv debug: | | | + Track UID=1
mkv debug: | | | + Track Type=video
mkv debug: | | | + Track Lacing=0
mkv debug: | | | + Track CodecId=V_MPEG4/ISO/AVC
mkv debug: | | | + Track CodecPrivate size=45
mkv debug: | | | + Track Default Duration=40000000
mkv debug: | | | + Track Video
mkv debug: | | | | + width=700
mkv debug: | | | | + height=576
mkv debug: | | | | + display width=747
mkv debug: | | | | + display height=576
mkv debug: | | + Track Entry
mkv debug: | | | + Track Number=2
mkv debug: | | | + Track UID=1556561701
mkv debug: | | | + Track Type=audio
mkv debug: | | | + Track CodecId=A_AC3
mkv debug: | | | + Track Default Duration=32000000
mkv debug: | | | + Track Audio
mkv debug: | | | | + afreq=48000
mkv debug: | | | | + achan=2
mkv debug: | + Tracks
mkv debug: | + Void
mkv debug: | + Information
mkv debug: | + Void
mkv debug: | + Cluster
mkv debug: found 2 es
core debug: selecting program id=0
core debug: Buffering 0%
mkv debug: Starting the UI Hook
core debug: using demux module "mkv"
core debug: looking for a subtitle file in /home/krisztian/Videos/
core debug: looking for decoder module matching "any": 42 candidates
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
core debug: no meta fetcher modules matched
core debug: searching art for movie.mkv
core debug: looking for art finder module matching "any": 2 candidates
avcodec debug: CPU flags: 0x0107d3db
avcodec debug: trying to use direct rendering
avcodec debug: allowing 4 thread(s) for decoding
avcodec debug: avcodec codec (H264 - MPEG-4 AVC (part 10)) started
avcodec debug: using frame thread mode with 4 threads
core debug: using decoder module "avcodec"
core debug: looking for decoder module matching "any": 42 candidates
core debug: using decoder module "a52"
core debug: looking for meta reader module matching "any": 2 candidates
lua debug: Trying Lua scripts in /home/krisztian/.local/share/vlc/lua/meta/art
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/art
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/01_googleimage.luac
core debug: meta ok for (null), need to fetch art
core debug: looking for meta fetcher module matching "any": 1 candidates
lua debug: Trying Lua scripts in /home/krisztian/.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: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/01_googleimage.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
lua debug: Trying Lua scripts in /home/krisztian/.local/share/vlc/lua/meta/fetcher
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/fetcher
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
core debug: no meta reader modules matched
core debug: `file:///home/krisztian/Videos/movie.mkv' successfully opened
a52 debug: A/52 channels:2 samplerate:48000 bitrate:192000
core debug: reusing audio output
pulse debug: using stereo channel map
avcodec debug: available hardware decoder output format 109 (vdpau)
avcodec debug: available hardware decoder output format 53 (vaapi_vld)
avcodec debug: available software decoder output format 0 (yuv420p)
core debug: looking for hw decoder module matching "any": 4 candidates
core debug: Buffering 0%
core debug: Stream buffering done (320 ms in 56 ms)
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
core debug: no hw decoder modules matched
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
core debug: no meta fetcher modules matched
core debug: searching art for movie.mkv
core debug: looking for art finder module matching "any": 2 candidates
core debug: looking for text renderer module matching "any": 2 candidates
freetype debug: Building font databases.
freetype debug: Took 0 microseconds
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/03_lastfm.luac
pulse debug: changing sink 0: alsa_output.pci-0000_00_1f.3.analog-stereo (Built-in Audio Analog Stereo)
pulse debug: digital pass-through not available
pulse debug: changed buffer metrics: maxlength=4194304, tlength=46080, prebuf=0, minreq=15360
pulse debug: connected to sink alsa_output.pci-0000_00_1f.3.analog-stereo
core debug: output 'f32l' 48000 Hz Stereo frame=1 samples/8 bytes
core debug: looking for audio volume module matching "any": 2 candidates
core debug: using audio volume module "float_mixer"
core debug: input 'a52 ' 48000 Hz Stereo frame=1536 samples/768 bytes
freetype debug: Using Serif Bold as font from file /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
freetype debug: Using Monospace as mono-font from file /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
core debug: looking for audio filter module matching "scaletempo": 14 candidates
freetype debug: using fontsize: 2
core debug: using text renderer module "freetype"
core debug: looking for video filter2 module matching "any": 63 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
core debug: using audio filter module "scaletempo"
core debug: conversion: 'a52 '->'f32l' 48000 Hz->48000 Hz Stereo->Stereo
core debug: looking for audio converter module matching "any": 12 candidates
swscale debug: 32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bicubic (good quality)
core debug: using video filter2 module "swscale"
core debug: looking for video filter2 module matching "any": 63 candidates
core debug: no audio converter modules matched
core debug: looking for audio converter module matching "any": 12 candidates
core debug: using audio converter module "a52tofloat32"
core debug: conversion pipeline complete
core debug: conversion: 'f32l'->'f32l' 48000 Hz->48000 Hz Stereo->Stereo
core debug: conversion pipeline complete
core debug: looking for audio resampler module matching "any": 3 candidates
core debug: using audio resampler module "samplerate"
core debug: End of audio preroll
lua debug: Trying Lua scripts in /home/krisztian/.local/share/vlc/lua/meta/art
lua debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/art
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/03_lastfm.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
core debug: no art finder modules matched
core debug: art not found for movie.mkv
yuvp debug: YUVP to YUVA converter
core debug: using video filter2 module "yuvp"
core debug: Deinterlacing available
core debug: deinterlace 0, mode blend, is_needed 0
core debug: Opening vout display wrapper
core debug: looking for vout display module matching "xcb_x11": 14 candidates
core debug: looking for vout window xid module matching "qt4,any": 4 candidates
qt4 debug: requesting video window...
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/01_googleimage.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/01_googleimage.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
lua debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/03_lastfm.luac
lua debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/03_lastfm.luac
lua debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
core debug: no art finder modules matched
core debug: art not found for movie.mkv
qt4 debug: Video was requested 0, 0
core debug: using vout window xid module "qt4"
core debug: looking for inhibit module matching "any": 2 candidates
dbus_screensaver debug: found service org.freedesktop.ScreenSaver
core debug: using inhibit module "dbus_screensaver"
xcb debug: connected to X11.0 server
xcb debug: vendor : The X.Org Foundation
xcb debug: version: 11804000
xcb debug: using screen 0x153
xcb_x11 debug: using X11 visual ID 0x20
xcb_x11 debug: 24 bits depth
xcb_x11 debug: 32 bits per pixel
xcb_x11 debug: 32 bits line pad
xcb_x11 debug: using X11 window 03800000
xcb_x11 debug: using X11 graphic context 03800001
core debug: VoutDisplayEvent 'fullscreen' 0
core debug: VoutDisplayEvent 'resize' 747x576 window
core debug: using vout display module "xcb_x11"
core debug: A filter to adapt decoder to display is needed
core debug: looking for video filter2 module matching "any": 63 candidates
swscale debug: 700x576 (704x578) chroma: I420 -> 700x576 (704x578) chroma: RV32 with scaling using Bicubic (good quality)
core debug: using video filter2 module "swscale"
core debug: Filter 'Swscale' (0x7fa994005058) appended to chain
core debug: original format sz 704x578, of (0,0), vsz 700x576, 4cc I420, sar 747:700, msk r0x0 g0x0 b0x0
core debug: removing module "freetype"
core debug: looking for text renderer module matching "any": 2 candidates
freetype debug: Building font databases.
freetype debug: Took 0 microseconds
freetype debug: Using Serif Bold as font from file /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
freetype debug: Using Monospace as mono-font from file /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
freetype debug: using fontsize: 2
core debug: using text renderer module "freetype"
avcodec warning: plane 0 not aligned
xcb debug: display is visible
core warning: VoutDisplayEvent 'pictures invalid'
core warning: VoutDisplayEvent 'pictures invalid'
core warning: VoutDisplayEvent 'pictures invalid'
core debug: Filter 0x7fa994005058 removed from chain
core debug: removing module "swscale"
core debug: A filter to adapt decoder to display is needed
core debug: looking for video filter2 module matching "any": 63 candidates
swscale debug: 700x576 (704x578) chroma: I420 -> 747x576 (751x578) chroma: RV32 with scaling using Bicubic (good quality)
core debug: using video filter2 module "swscale"
core debug: Filter 'Swscale' (0x7fa994026978) appended to chain
avcodec warning: disabling direct rendering
core debug: End of video preroll
core debug: Received first picture
avcodec debug: enabling direct rendering

Can anybody tell me what is wrong here? Thank you.

huhn
3rd November 2018, 17:42
core debug: VoutDisplayEvent 'resize' 747x576 window
core debug: using vout display module "xcb_x11"
core debug: A filter to adapt decoder to display is needed
core debug: looking for video filter2 module matching "any": 63 candidates
swscale debug: 700x576 (704x578) chroma: I420 -> 700x576 (704x578) chroma: RV32 with scaling using Bicubic (good quality)

it reports 704x578. how did you can up with a resolution of 700x576?

BTW every should be fine.

nevcairiel
3rd November 2018, 18:28
There is really some odd parts here. 704 I could see, because its the next mod-16 of 700. But 576 is already mod 16, and 578 is only mod 2. So thats weird.

seggitek
4th November 2018, 18:25
This is an encode of a DVD video. The input video had a resolution of 720x576 and I cropped of the black borders on the left and right. The result is a video with a resolution of 700x576. Applying the correct SAR/PAR the display resolution should be 747x576.

The video was encoded using x264. The display resolution was later set in the header of the MKV file using MKVToolNix.

When I play the encoded video (700x576) without changing anything in the header, VLC is already displaying it at 704x578. I don't understand why. I've never experienced this issue before. Maybe I'm doing something wrong?

huhn
4th November 2018, 18:36
how did you crop it?

seggitek
4th November 2018, 19:32
I cropped it using the Crop filter of AviSynth.

I opened the video now with GNOME MPlayer and it displays the video showing a resolution of 748x576. It might be that the players don't like the display resolution and tinker around with it. What do you think?

Asmodian
5th November 2018, 08:01
I would stick to mod4 for everything, things often go weird if you do not.

Hmm.. but you are mod4. Sorry... maybe try mod8? I don't use VLC or similar but LAV works fine with mod4 anamorphic in my experience. You might be right, maybe they want to display mod4 too, or something.

SeeMoreDigital
5th November 2018, 09:59
How about uploading a short sample of your encode?

littleD
7th November 2018, 22:57
You entered odd numbers in display resolution, so vlc may use its own mechanism for chroma upscaling hence use its own image resolution.
You may also unintentionally set strange pixel aspect ratio (rectangular) which do not suit to your or vlc math.