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

BugMaster BugMaster at narod.ru
Sun Apr 2 13:24:54 UTC 2023


On Sat, 1 Apr 2023 18:43:48 +0200, H. Thiele wrote:

> 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.

Hi. I don't know why they removed the link "Register now", but in
theory you can try to replace sign_in with sing_up in the url.


> 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.

https://code.videolan.org/videolan/x264/-/merge_requests/129 should
probably fix your issue.

> 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.

It parsed 6113<space>I<space><newline>12744<space>I<newline> as
frame=6113
type=I
qp=12744 (due such high qp value it decimated to grey frame)

And later probably failed with error:
x264 [error]: can't parse qpfile for frame 6114



More information about the x264-devel mailing list