Opened 13 years ago
Closed 13 years ago
#595 closed enhancement (fixed)
Missing GBR24P -> RGB converter
Reported by: | DonMoir | Owned by: | Michael Niedermayer |
---|---|---|---|
Priority: | wish | Component: | swscale |
Version: | git-master | Keywords: | gbr24p |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
With this sample: bunny_bad_convert_to_BGRA.mkv (13 MB)
http://sms.pangolin.com/temp/bunny_bad_convert_to_BGRA.mkv
sws_scale either doesn't do the conversion or the converted pixels are all zero. sws_scale returns success.
This file was previously named bunny_rgb_crash.mkv and you already have that. The crash and color ordering problems with this file have been fixed.
This is the last version that did the conversion to PIX_FMT_BGRA correctly that I know of. Note: this version had a color ordering problem with this file but the conversion to PIX_FMT_BGRA worked.
ffplay version N-32962-gcbf914c, Copyright (c) 2003-2011 the FFmpeg developers
built on Sep 25 2011 21:37:29 with gcc 4.6.1
configuration: --disable-static --enable-shared --enable-gpl --enable-version3
--enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype
--enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264
--enable-libxavs --enable-libxvid --enable-zlib
libavutil 51. 17. 0 / 51. 17. 0
libavcodec 53. 17. 0 / 53. 17. 0
libavformat 53. 13. 0 / 53. 13. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 43. 5 / 2. 43. 5
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
So the code for this file has gone thru some changes that fixed the important stuff and broke this conversion. The version tested where the conversion fails is:
ffplay version N-34031-ge403a97, Copyright (c) 2003-2011 the FFmpeg developers
built on Oct 25 2011 15:09:12 with gcc 4.6.1
...
(same config as above)
...
libavutil 51. 22. 0 / 51. 22. 0
libavcodec 53. 23. 0 / 53. 23. 0
libavformat 53. 17. 0 / 53. 17. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 45. 0 / 2. 45. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
Change History (10)
comment:1 by , 13 years ago
Priority: | normal → wish |
---|---|
Type: | defect → enhancement |
Version: | unspecified → git-master |
comment:2 by , 13 years ago
Not sure why you changed it to wish/enhancement... seems to be a regression problem and bug to me :) I just don't use swscale anymore for this simple conversion as a work around.
Truely I don't use ffplay or ffmpeg command line tools much. Most of the testing I do comes from internal code. As a failing command, I would need to force ffplay or ffmpeg, I think to use BGRA to show the problem. Don't think you can do it with ffplay. So question to you is how to force this output format in a way that would make sense to you. You have to be able to see the output otherwise I don't think any errors are logged.
comment:3 by , 13 years ago
I changed this to an enhancement, because this conversion never worked (as you correctly pointed out in your original report). You do not have to try to reproduce the problem with ffplay, because you can only report ffplay problems if they are unreproducible with ffmpeg.
Please search an encoder that uses RGB as input (png or rawvideo) and provide a minimal (as short as possible) failing command line together with its complete, uncut output (using Code block).
comment:4 by , 13 years ago
I reported that the conversion did work previously. The issue of color ordering is different. Previously, with the 9-25-2011 build, it did not matter what format was used and the colors were reversed. But the conversion to BGRA did work with the same reversed colors. It did this correcly. Now it seems it either does nothing or all zeros are set.
I will see what I can do to produce a failing command. It might be as simple as a conversion from one format to another and check the replay on the converted file but don't know.
comment:5 by , 13 years ago
This is another one of those simple issues where it takes me 5 minutes to fix it and god only knows how much time to report it. I look forward to the day when I have the time to be more involved and just hand out the patch :) In this case, I just avoided swscale altogether which is not the best thing.
Aha, just starting to get it... Make filing a bug report so time consuming that it's quicker just to supply the patch. haha
comment:6 by , 13 years ago
Check this png image:
http://sms.pangolin.com/temp/bunny.png
Shows build 9-25-2011 where colors are reversed but conversion is correct.
Shows build 10-25-2011 where colors are correct but conversion fails.
Shows build 10-25-2011 where colors are correct with internal conversion and is correct
comment:7 by , 13 years ago
C:\>ffmpeg -i C:\bunny_bad_convert_to_BGRA.mkv -vcodec png out.mov ffmpeg version N-34318-g8475ec1, Copyright (c) 2000-2011 the FFmpeg developers built on Oct 31 2011 17:50:05 with gcc 4.6.1 configuration: --enable-gpl --enable-version3 --enable-runtime-cpudetect --ena ble-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable- libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --ena ble-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --en able-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 51. 22. 0 / 51. 22. 0 libavcodec 53. 26. 0 / 53. 26. 0 libavformat 53. 18. 0 / 53. 18. 0 libavdevice 53. 4. 0 / 53. 4. 0 libavfilter 2. 45. 3 / 2. 45. 3 libswscale 2. 1. 0 / 2. 1. 0 libpostproc 51. 2. 0 / 51. 2. 0 Input #0, matroska,webm, from 'C:\bunny_bad_convert_to_BGRA.mkv': Duration: 00:00:32.48, start: 0.000000, bitrate: 3376 kb/s Stream #0:0(eng): Video: h264 (High 4:4:4 Predictive), gbr24p, 640x360, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 20k tbn, 50 tbc (default) Incompatible pixel format 'gbr24p' for codec 'png', auto-selecting format 'rgb24 ' [buffer @ 020B5BA0] w:640 h:360 pixfmt:gbr24p tb:1/1000000 sar:1/1 sws_param: [buffersink @ 020B5E20] auto-inserting filter 'auto-inserted scale 0' between th e filter 'src' and the filter 'out' [scale @ 020B5340] w:640 h:360 fmt:gbr24p -> w:640 h:360 fmt:rgb24 flags:0x4 Output #0, mov, to 'out.mov': Metadata: encoder : Lavf53.18.0 Stream #0:0(eng): Video: png (png / 0x20676E70), rgb24, 640x360 [SAR 1:1 DA R 16:9], q=2-31, 200 kb/s, 25 tbn, 25 tbc (default) Stream mapping: Stream #0.0 -> #0.0 (h264 -> png) Press [q] to stop, [?] for help [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 18 fps= 0 q=0.0 size= 32kB time=00:00:00.72 bitrate= 358.4kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 11 times frame= 31 fps= 0 q=0.0 size= 54kB time=00:00:01.24 bitrate= 358.2kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 50 fps= 33 q=0.0 size= 87kB time=00:00:02.00 bitrate= 358.1kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 18 times frame= 70 fps= 35 q=0.0 size= 122kB time=00:00:02.80 bitrate= 358.1kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 89 fps= 35 q=0.0 size= 156kB time=00:00:03.56 bitrate= 358.1kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 11 times frame= 102 fps= 33 q=0.0 size= 178kB time=00:00:04.08 bitrate= 358.1kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 10 times frame= 114 fps= 32 q=0.0 size= 199kB time=00:00:04.56 bitrate= 358.1kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 11 times frame= 127 fps= 31 q=0.0 size= 222kB time=00:00:05.08 bitrate= 358.1kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 11 times frame= 140 fps= 30 q=0.0 size= 245kB time=00:00:05.60 bitrate= 358.1kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 10 times frame= 152 fps= 30 q=0.0 size= 266kB time=00:00:06.08 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 11 times frame= 165 fps= 29 q=0.0 size= 288kB time=00:00:06.60 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 13 times frame= 180 fps= 29 q=0.0 size= 315kB time=00:00:07.20 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 18 times frame= 200 fps= 30 q=0.0 size= 350kB time=00:00:08.00 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 18 times frame= 220 fps= 31 q=0.0 size= 385kB time=00:00:08.80 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 16 times frame= 238 fps= 31 q=0.0 size= 416kB time=00:00:09.52 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 15 times frame= 255 fps= 31 q=0.0 size= 446kB time=00:00:10.20 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 274 fps= 32 q=0.0 size= 479kB time=00:00:10.96 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 18 times frame= 294 fps= 32 q=0.0 size= 514kB time=00:00:11.76 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 313 fps= 32 q=0.0 size= 547kB time=00:00:12.52 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 15 times frame= 330 fps= 32 q=0.0 size= 577kB time=00:00:13.20 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 14 times frame= 346 fps= 32 q=0.0 size= 605kB time=00:00:13.84 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 14 times frame= 362 fps= 32 q=0.0 size= 633kB time=00:00:14.48 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 14 times frame= 378 fps= 32 q=0.0 size= 661kB time=00:00:15.12 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 15 times frame= 395 fps= 32 q=0.0 size= 691kB time=00:00:15.80 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 15 times frame= 412 fps= 32 q=0.0 size= 720kB time=00:00:16.48 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 431 fps= 33 q=0.0 size= 753kB time=00:00:17.24 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 18 times frame= 451 fps= 33 q=0.0 size= 788kB time=00:00:18.04 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 18 times frame= 471 fps= 33 q=0.0 size= 823kB time=00:00:18.84 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 13 times frame= 486 fps= 33 q=0.0 size= 850kB time=00:00:19.44 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 14 times frame= 502 fps= 33 q=0.0 size= 878kB time=00:00:20.08 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 13 times frame= 517 fps= 33 q=0.0 size= 904kB time=00:00:20.68 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 13 times frame= 532 fps= 33 q=0.0 size= 930kB time=00:00:21.28 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 14 times frame= 548 fps= 33 q=0.0 size= 958kB time=00:00:21.92 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 9 times frame= 559 fps= 32 q=0.0 size= 977kB time=00:00:22.36 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 12 times frame= 573 fps= 32 q=0.0 size= 1002kB time=00:00:22.92 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 18 times frame= 593 fps= 32 q=0.0 size= 1037kB time=00:00:23.72 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 612 fps= 33 q=0.0 size= 1070kB time=00:00:24.48 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 15 times frame= 629 fps= 33 q=0.0 size= 1100kB time=00:00:25.16 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 12 times frame= 643 fps= 32 q=0.0 size= 1124kB time=00:00:25.72 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 14 times frame= 659 fps= 32 q=0.0 size= 1152kB time=00:00:26.36 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 14 times frame= 675 fps= 32 q=0.0 size= 1180kB time=00:00:27.00 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 694 fps= 33 q=0.0 size= 1213kB time=00:00:27.76 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 713 fps= 33 q=0.0 size= 1246kB time=00:00:28.52 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 732 fps= 33 q=0.0 size= 1280kB time=00:00:29.28 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 15 times frame= 749 fps= 33 q=0.0 size= 1309kB time=00:00:29.96 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 15 times frame= 766 fps= 33 q=0.0 size= 1339kB time=00:00:30.64 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 17 times frame= 785 fps= 33 q=0.0 size= 1372kB time=00:00:31.40 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 16 times frame= 803 fps= 33 q=0.0 size= 1404kB time=00:00:32.12 bitrate= 358.0kbits/s internal error gbr24p -> rgb24 converter [swscaler @ 0267B460] internal error gbr24p -> rgb24 converter Last message repeated 7 times frame= 812 fps= 33 q=0.0 Lsize= 1423kB time=00:00:32.48 bitrate= 359.0kbits/ s video:1419kB audio:0kB global headers:0kB muxing overhead 0.269835%
comment:8 by , 13 years ago
similar issue (ticket #297)
https://ffmpeg.org/trac/ffmpeg/raw-attachment/ticket/297/1_RGB.jpg
C:\>ffmpeg.exe -i C:\1_RGB.jpg out.bmp ffmpeg version N-34354-g0b3e9d5, Copyright (c) 2000-2011 the FFmpeg developers built on Nov 3 2011 02:35:34 with gcc 4.5.0 20100414 (Fedora MinGW 4.5.0-1.fc 14) configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch= x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect --enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 - lwinmm' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snapshots/buil d/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/snapshots/b uild/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3 --enable-n onfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-libopencor e-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx libavutil 51. 23. 0 / 51. 23. 0 libavcodec 53. 27. 0 / 53. 27. 0 libavformat 53. 18. 0 / 53. 18. 0 libavdevice 53. 4. 0 / 53. 4. 0 libavfilter 2. 45. 3 / 2. 45. 3 libswscale 2. 1. 0 / 2. 1. 0 libpostproc 51. 2. 0 / 51. 2. 0 Input #0, image2, from 'C:\1_RGB.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: N/A Stream #0:0: Video: mjpeg, gbr24p, 1024x768, 25 tbr, 25 tbn, 25 tbc Incompatible pixel format 'gbr24p' for codec 'bmp', auto-selecting format 'bgr24 ' [buffer @ 0x1ce1be0] w:1024 h:768 pixfmt:gbr24p tb:1/1000000 sar:0/1 sws_param: [buffersink @ 0x1ce1e60] auto-inserting filter 'auto-inserted scale 0' between t he filter 'src' and the filter 'out' [scale @ 0x1ce1600] w:1024 h:768 fmt:gbr24p -> w:1024 h:768 fmt:bgr24 flags:0x4 Output #0, image2, to 'out.bmp': Metadata: encoder : Lavf53.18.0 Stream #0:0: Video: bmp, bgr24, 1024x768, q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream mapping: Stream #0.0 -> #0.0 (mjpeg -> bmp) Press [q] to stop, [?] for help [swscaler @ 0x22b8ec0] internal error gbr24p -> bgr24 converter frame= 1 fps= 0 q=0.0 Lsize= -0kB time=00:00:00.04 bitrate= -4.4kbits/ s video:2304kB audio:0kB global headers:0kB muxing overhead -100.000932%
comment:9 by , 13 years ago
Keywords: | gbr24p added |
---|---|
Reproduced by developer: | set |
Status: | new → open |
Summary: | Bad convert from PIX_FMT_GBR24P to PIX_FMT_BGRA → Missing GBR24P -> RGB converter |
comment:10 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Scaling planar RGB to RGB was committed to FFmpeg.
Please add a failing command line and complete, uncut output (consider using "Code block").