[x264-devel] [bug-report] An accidental trailing space in qpfile encodes as a broken I-frame

H. Thiele thiele at streamline-x.org
Sat Apr 1 16:43:48 UTC 2023


Hi,

I did not find a suitable way to sign-in to your issue tracker (I only 
can log-in when I have an account with Google, Twitter, etc.?), so I 
hope it is acceptable to report my issue here on this mailing list.


Issue
-----

Having a random trailing space in a qpfile can lead to the respective 
frame encoded as a blank grey I-frame (no image content), following B/P 
frames warp then in funnily. It's quite a nice looking glitch.


e.g. an qpfile could look like this to force some i-frames on specific
scene switches (e.g. dark -> dark to aid with debanding efforts):

...
4507<space>I<newline>
4578<space>I<newline>
5414<space>I<newline>
5619<space>I<newline>
5764<space>I<newline>
5870<space>I<newline>
6113<space>I<space><newline>
12744<space>I<newline>
12799<space>I<newline>
19428<space>I<newline>
...

Please note the extra accidental space character after the "I" for frame 
#6113.

After removing the space character and re-encoding the whole file the 
issue went away.


What Should Happen?
-------------------

Accidental trailing whitespace in lines of a qpfile should be ignored 
and not trigger encoding errors.

My wild guess is it was trying to parse of the optional QP value, failed 
on it, and then set it to an internal default.


Used x264 Command Line (Example)
--------------------------------

vspipe --y4m input.vpy - | x264 --crf 17 --profile high422 --preset 
veryslow --tune film --demuxer y4m - --output output.264 --no-interlaced 
--level 4.1 --deblock -2:-2 --force-cfr --range tv --colorprim bt709 
--transfer bt709 --colormatrix bt709 --sar 1:1 --vbv-maxrate 5120 
--vbv-bufsize 12288 --threads 4 --frames 48012 --qpfile qpfile.txt



regards,
H. Thiele


More information about the x264-devel mailing list