[FFmpeg-trac] #2407(swscale:new): Conversion from yuv to RGB leads to broken gradients and colors.

FFmpeg trac at avcodec.org
Thu Mar 28 12:36:33 CET 2013


#2407: Conversion from yuv to RGB leads to broken gradients and colors.
------------------------------------+-----------------------------------
             Reporter:  sun         |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  swscale
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+-----------------------------------

Comment (by cehoyos):

 I tested the following:
 {{{
 $ ffmpeg -i ffv1.avi -pix_fmt bgr24 out.bmp
 $ ffmpeg -i ffv1.avi -pix_fmt rgb24 out.png
 }}}
 {{{
 $ ffmpeg -i out.png -i out.bmp -map 0 -f framecrc -pix_fmt bgr24 - -map 1
 -f framecrc -
 ffmpeg version N-51338-g914f48d Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Mar 28 2013 11:17:21 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl --disable-indev=jack
   libavutil      52. 22.101 / 52. 22.101
   libavcodec     55.  1.100 / 55.  1.100
   libavformat    55.  0.100 / 55.  0.100
   libavdevice    55.  0.100 / 55.  0.100
   libavfilter     3. 48.105 /  3. 48.105
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, image2, from 'out.png':
   Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: png, rgb24, 1920x1080, 25 tbr, 25 tbn, 25 tbc
 [image2 @ 0x32c9440] Stream #0: not enough frames to estimate rate;
 consider increasing probesize
 Input #1, image2, from 'out.bmp':
   Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
     Stream #1:0: Video: bmp, bgr24, 1920x1080, 25 tbr, 25 tbn, 25 tbc
 #tb 0: 1/25
 #tb 0: 1/25
 Output #0, framecrc, to 'pipe:':
   Metadata:
     encoder         : Lavf55.0.100
     Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1920x1080,
 q=2-31, 200 kb/s, 25 tbn, 25 tbc
 Output #1, framecrc, to 'pipe:':
   Metadata:
     encoder         : Lavf55.0.100
     Stream #1:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1920x1080,
 q=2-31, 200 kb/s, 25 tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (png -> rawvideo)
   Stream #1:0 -> #1:0 (bmp -> rawvideo)
 Press [q] to stop, [?] for help
 0,          0,          0,        1,  6220800, 0x43fb7af4
 0,          0,          0,        1,  6220800, 0x43fb7af4
 frame=    1 fps=0.0 q=0.0 Lq=0.0 size=       0kB time=00:00:00.04 bitrate=
 14.0kbits/s
 video:12150kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 -99.999437%
 }}}
 {{{
 $ffmpeg -i out.png -i out.bmp -map 0 -f framecrc - -map 1 -f framecrc
 -pix_fmt rgb24 -
 ffmpeg version N-51338-g914f48d Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Mar 28 2013 11:17:21 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl --disable-indev=jack
   libavutil      52. 22.101 / 52. 22.101
   libavcodec     55.  1.100 / 55.  1.100
   libavformat    55.  0.100 / 55.  0.100
   libavdevice    55.  0.100 / 55.  0.100
   libavfilter     3. 48.105 /  3. 48.105
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, image2, from 'out.png':
   Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: png, rgb24, 1920x1080, 25 tbr, 25 tbn, 25 tbc
 [image2 @ 0x261c440] Stream #0: not enough frames to estimate rate;
 consider increasing probesize
 Input #1, image2, from 'out.bmp':
   Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
     Stream #1:0: Video: bmp, bgr24, 1920x1080, 25 tbr, 25 tbn, 25 tbc
 #tb 0: 1/25
 #tb 0: 1/25
 Output #0, framecrc, to 'pipe:':
   Metadata:
     encoder         : Lavf55.0.100
     Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1920x1080,
 q=2-31, 200 kb/s, 25 tbn, 25 tbc
 Output #1, framecrc, to 'pipe:':
   Metadata:
     encoder         : Lavf55.0.100
     Stream #1:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1920x1080,
 q=2-31, 200 kb/s, 25 tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (png -> rawvideo)
   Stream #1:0 -> #1:0 (bmp -> rawvideo)
 Press [q] to stop, [?] for help
 0,          0,          0,        1,  6220800, 0x03f17af4
 0,          0,          0,        1,  6220800, 0x03f17af4
 frame=    1 fps=0.0 q=0.0 Lq=0.0 size=       0kB time=00:00:00.04 bitrate=
 14.0kbits/s
 video:12150kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 -99.999437%
 }}}
 Is the problem reproducible with out.png but not out.bmp? Is there (also)
 a problem with the conversion from rgb24 to bgr24?

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2407#comment:4>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list