[FFmpeg-trac] #9573(avcodec:new): libx264 ignores color range flag for gray10 input

FFmpeg trac at avcodec.org
Wed Dec 29 16:16:08 EET 2021


#9573: libx264 ignores color range flag for gray10 input
-------------------------------------+-------------------------------------
             Reporter:  Diederick    |                    Owner:  (none)
  Niehorster                         |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avcodec
              Version:  git-master   |               Resolution:
             Keywords:  libx264      |               Blocked By:
  gray10                             |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by Diederick Niehorster):

 Replying to [comment:3 pdr0]:
 > Replying to [comment:2 Diederick Niehorster]:
 > > However, encoding yuv420p10le (or yuv444p10le for that matter) does
 not seem to be lossless despite crf 0. The conversion
 gray10le->yuv420p10le (or gray10le->yuv444p10le) is not perfect, but leads
 to pixel intensity errors of only +1 or -1 value on 14.11% of pixels in my
 example input (when total conversion actually is
 gray10le->yuv420p10le->gray10le, so not really a problem, some roundoff
 error i guess). In the encoded file however 68.66% of pixels have the
 wrong intensity value, with errors ranging from -5 to +5 intensity values.
 I assume this is not expected? Should i post a separate ticket for that?
 >
 > use full range
 >
 > (gray uses full range, but your yuv420p10 conversion uses limited range)
 >
 > {{{
 > ffmpeg -y -i test.mkv -vf
 "scale=in_range=pc:out_range=pc,format=yuv420p10" -c:v libx264 -preset
 veryfast -crf 0 test2.mp4
 > }}}

 Thanks. Using that command, both the output stream of ffmpeg and ffprobe
 now correctly identify the data as full range. However, the output in
 terms of pixel values is identical (both conversions apparently were full
 range, even if that info did not survive the filter chain without your
 addition). My problems thus remain:
 1. libx264 with full range gray10 input seems to ignore the full range
 flag (also when adding a filter -vf scale=in_range=pc:out_range=pc to the
 command, i just tried)
 2. libx264 with crf 0 and pix_fmt yuv420p10le is not lossless, but shows
 many pixels that are off by up to 5 intensity values (should this be
 reported separately?)
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9573#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list