Opened 10 years ago

Closed 10 years ago

#3284 closed defect (fixed)

libopenjpeg produces wrong color output for yuv422p10le JPEG2000 source

Reported by: Frank Ma Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: libopenjpeg regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

We have a J2k file in yuvp10le format. But the latest ffmpeg-git with openjpeg-1.5.1 could NOT output it with correct color (by default).

How to reproduce:

$ ../builds/ffmpeg-git/bin/ffmpeg -vcodec libopenjpeg -i ./output00510.j2k -pix_fmt rgba output00510.j2k.png -loglevel verbose
ffmpeg version N-59694-g2be1e1b Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  8 2014 16:56:29 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/home/fma/netflixdev/users/frankma/encoding_services/transcoder/dev/builds/ffmpeg-git --disable-doc --arch=x86 --target-os=linux --enable-runtime-cpudetect --disable-ffserver --disable-avdevice --disable-static --enable-shared --enable-libopenjpeg --enable-libx264 --enable-libvorbis --enable-libfreetype --enable-gpl --enable-nonfree --disable-optimizations --disable-stripping --disable-asm --disable-mmx --disable-sse2 --disable-ssse3 --enable-debug=3 --extra-cflags=-I/home/fma/netflixdev/users/frankma/encoding_services/transcoder/dev/builds/include --extra-ldflags=-L/home/fma/netflixdev/users/frankma/encoding_services/transcoder/dev/builds/lib --extra-ldflags=-Xlinker --extra-ldflags='-rpath='\''rpath_placeholder_rpath_placeholder'\''' --extra-libs=-ldl --extra-libs=-lpthread
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from './output00510.j2k':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: jpeg2000, yuv422p10le, 3840x2160, 25 tbr, 25 tbn, 25 tbc
[graph 0 input from stream 0:0 @ 0x19aa830] w:3840 h:2160 pixfmt:yuv422p10le tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[auto-inserted scaler 0 @ 0x199f780] w:iw h:ih flags:'0x4' interl:0
[format @ 0x199e100] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[auto-inserted scaler 0 @ 0x199f780] w:3840 h:2160 fmt:yuv422p10le sar:0/1 -> w:3840 h:2160 fmt:rgba sar:0/1 flags:0x4
Output #0, image2, to 'output00510.j2k.png':
  Metadata:
    encoder         : Lavf55.22.102
    Stream #0:0: Video: png, rgba, 3840x2160, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (libopenjpeg -> png)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.4:-32:-22.-77 bitrate=N/A    
frame=    1 fps=0.2 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A    
video:37kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.058476%

ffmpeg version N-59694-g2be1e1b Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  8 2014 16:56:29 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)

However, if we hard-code the input pixel format as yuv422p16le, the output image color becomes correct.

$ ../builds/ffmpeg-git/bin/ffmpeg -vcodec libopenjpeg -pix_fmt yuv422p16le -i ./output00510.j2k -pix_fmt rgba output00510.j2k.png -loglevel verbose
ffmpeg version N-59694-g2be1e1b Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  8 2014 16:56:29 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/home/fma/netflixdev/users/frankma/encoding_services/transcoder/dev/builds/ffmpeg-git --disable-doc --arch=x86 --target-os=linux --enable-runtime-cpudetect --disable-ffserver --disable-avdevice --disable-static --enable-shared --enable-libopenjpeg --enable-libx264 --enable-libvorbis --enable-libfreetype --enable-gpl --enable-nonfree --disable-optimizations --disable-stripping --disable-asm --disable-mmx --disable-sse2 --disable-ssse3 --enable-debug=3 --extra-cflags=-I/home/fma/netflixdev/users/frankma/encoding_services/transcoder/dev/builds/include --extra-ldflags=-L/home/fma/netflixdev/users/frankma/encoding_services/transcoder/dev/builds/lib --extra-ldflags=-Xlinker --extra-ldflags='-rpath='\''rpath_placeholder_rpath_placeholder'\''' --extra-libs=-ldl --extra-libs=-lpthread
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from './output00510.j2k':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: jpeg2000, yuv422p16le(10 bpc), 3840x2160, 25 tbr, 25 tbn, 25 tbc
File 'output00510.j2k.png' already exists. Overwrite ? [y/N] y
[graph 0 input from stream 0:0 @ 0x117f7c0] w:3840 h:2160 pixfmt:yuv422p16le tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[auto-inserted scaler 0 @ 0x1174760] w:iw h:ih flags:'0x4' interl:0
[format @ 0x117dee0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[auto-inserted scaler 0 @ 0x1174760] w:3840 h:2160 fmt:yuv422p16le sar:0/1 -> w:3840 h:2160 fmt:rgba sar:0/1 flags:0x4
Output #0, image2, to 'output00510.j2k.png':
  Metadata:
    encoder         : Lavf55.22.102
    Stream #0:0: Video: png, rgba, 3840x2160, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (libopenjpeg -> png)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.4:-32:-22.-77 bitrate=N/A    
frame=    1 fps=0.1 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A    
video:20800kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.000103%

Change History (4)

comment:1 by Frank Ma, 10 years ago

The original j2k file is also uploaded to:
http://upload.ffmpeg.org/upload/
with file name "output00510.j2k.

Thanks!

comment:2 by Carl Eugen Hoyos, 10 years ago

Are you sure that the issue is reproducible with the image you attached here?

comment:3 by Carl Eugen Hoyos, 10 years ago

Keywords: regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen

Regression since 7412a4a4 (related to ticket #2943)

comment:4 by Carl Eugen Hoyos, 10 years ago

Resolution: fixed
Status: openclosed

Should be fixed in 8298b541
Thank you for the report!

Note: See TracTickets for help on using tickets.