[FFmpeg-trac] #11182(swscale:closed): yuvtestsrc and yuv444p->rgba->yuv444p conversion result in huge difference

FFmpeg trac at avcodec.org
Sun Sep 15 16:10:39 EEST 2024


#11182: yuvtestsrc and yuv444p->rgba->yuv444p conversion result in huge difference
-------------------------------------+-------------------------------------
             Reporter:  Andrew-R     |                    Owner:  (none)
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:  swscale
              Version:  unspecified  |               Resolution:  invalid
             Keywords:  colorspace   |               Blocked By:
  color_primaries                    |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by Andrew-R):

 Replying to [comment:41 Balling]:
 > Well, again. Color_range 2 does not work as input option and that is not
 how you handle ranges, you use -vf scale=in_range=pc:out_range=pc
 >


 I tried as you suggested, and difference still around, note that input
 file clearly says range PC in both cases (generating and converting)

 {{{
 bash-5.1$ /dev/shm/bin/ffmpeg -f lavfi -color_range 2 -i
 yuvtestsrc=s=640x480 -vf scale=in_range=pc:out_range=pc -color_range 2
 -frames 2 /dev/shm/yuv-pc-yuv444.y4m
 ffmpeg version N-115867-g3f84d1d1fb Copyright (c) 2000-2024 the FFmpeg
 developers
   built with gcc 11.2.0 (GCC)
   configuration: --disable-debug
   libavutil      59. 36.100 / 59. 36.100
   libavcodec     61. 13.100 / 61. 13.100
   libavformat    61.  5.101 / 61.  5.101
   libavdevice    61.  2.101 / 61.  2.101
   libavfilter    10.  2.102 / 10.  2.102
   libswscale      8.  2.100 /  8.  2.100
   libswresample   5.  2.100 /  5.  2.100
 Input #0, lavfi, from 'yuvtestsrc=s=640x480':
   Duration: N/A, start: 0.000000, bitrate: N/A
   Stream #0:0: Video: wrapped_avframe, yuv444p(**pc**), 640x480 [SAR 1:1
 DAR 4:3], 25 fps, 25 tbr, 25 tbn
 File '/dev/shm/yuv-pc-yuv444.y4m' already exists. Overwrite? [y/N] y
 Stream mapping:
   Stream #0:0 -> #0:0 (wrapped_avframe (native) -> wrapped_avframe
 (native))
 Press [q] to stop, [?] for help
 Output #0, yuv4mpegpipe, to '/dev/shm/yuv-pc-yuv444.y4m':
   Metadata:
     encoder         : Lavf61.5.101
   Stream #0:0: Video: wrapped_avframe, yuv444p(pc, progressive), 640x480
 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn
       Metadata:
         encoder         : Lavc61.13.100 wrapped_avframe
 [out#0/yuv4mpegpipe @ 0xc54e340] video:1KiB audio:0KiB subtitle:0KiB other
 streams:0KiB global headers:0KiB muxing overhead: 299133.603896%
 frame=    2 fps=0.0 q=-0.0 Lsize=    1800KiB time=00:00:00.08
 bitrate=184327.9kbits/s speed=  10x


 bash-5.1$ /dev/shm/bin/ffmpeg -color_range 2 -i /dev/shm/yuv-pc-yuv444.y4m
 -vf format=rgba -color_range 2 -frames 2 -pix_fmt yuv444p  /dev/shm/yuv-
 pc-rgba-yuv444.y4m
 ffmpeg version N-115867-g3f84d1d1fb Copyright (c) 2000-2024 the FFmpeg
 developers
   built with gcc 11.2.0 (GCC)
   configuration: --disable-debug
   libavutil      59. 36.100 / 59. 36.100
   libavcodec     61. 13.100 / 61. 13.100
   libavformat    61.  5.101 / 61.  5.101
   libavdevice    61.  2.101 / 61.  2.101
   libavfilter    10.  2.102 / 10.  2.102
   libswscale      8.  2.100 /  8.  2.100
   libswresample   5.  2.100 /  5.  2.100
 Input #0, yuv4mpegpipe, from '/dev/shm/yuv-pc-yuv444.y4m':
   Duration: 00:00:00.08, start: 0.000000, bitrate: 184327 kb/s
   Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p(**pc**,
 progressive), 640x480, SAR 1:1 DAR 4:3, 25 fps, 25 tbr, 25 tbn
 File '/dev/shm/yuv-pc-rgba-yuv444.y4m' already exists. Overwrite? [y/N] y
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> wrapped_avframe (native))
 Press [q] to stop, [?] for help
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 luma range from limited to full, srcrange 0 dstrange = 1
 Output #0, yuv4mpegpipe, to '/dev/shm/yuv-pc-rgba-yuv444.y4m':
   Metadata:
     encoder         : Lavf61.5.101
   Stream #0:0: Video: wrapped_avframe, yuv444p(pc, progressive), 640x480
 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn
       Metadata:
         encoder         : Lavc61.13.100 wrapped_avframe
 [out#0/yuv4mpegpipe @ 0xb6a4700] video:1KiB audio:0KiB subtitle:0KiB other
 streams:0KiB global headers:0KiB muxing overhead: 299133.603896%
 frame=    2 fps=0.0 q=-0.0 Lsize=    1800KiB time=00:00:00.08
 bitrate=184327.9kbits/s speed=4.12x
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11182#comment:43>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list