Opened 12 years ago

Closed 9 years ago

#538 closed defect (fixed)

J2K files with 444p are incorrectly written

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: j2k
Cc: Michael Niedermayer Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Files written with yuv444p cannot be read.

./ffmpeg -i tests/lena.pnm -pix_fmt yuv444p -strict experimental out.jp2
ffmpeg version N-33430-gcb50ada, Copyright (c) 2000-2011 the FFmpeg developers
  built on Oct  9 2011 20:28:29 with gcc 4.5.3
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc
  libavutil    51. 20. 1 / 51. 20. 1
  libavcodec   53. 19. 1 / 53. 19. 1
  libavformat  53. 14. 0 / 53. 14. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 43. 6 /  2. 43. 6
  libswscale    2.  1. 0 /  2.  1. 0
Input #0, image2, from 'tests/lena.pnm':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: ppm, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
[buffer @ 0x12d9e20] w:256 h:256 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x12cf7e0] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
[scale @ 0x12d0000] w:256 h:256 fmt:rgb24 -> w:256 h:256 fmt:yuv444p flags:0x4
Output #0, image2, to 'out.jp2':
  Metadata:
    encoder         : Lavf53.14.0
    Stream #0:0: Video: j2k, yuv444p, 256x256, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0 (ppm -> j2k)
Press [q] to stop, [?] for help
frame=    1 fps=  0 q=0.0 Lsize=      -0kB time=00:00:00.04 bitrate=  -4.4kbits/s
video:89kB audio:0kB global headers:0kB muxing overhead -100.024241%
/ffmpeg -i out.jp2
ffmpeg version N-33430-gcb50ada, Copyright (c) 2000-2011 the FFmpeg developers
  built on Oct  9 2011 20:28:29 with gcc 4.5.3
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc
  libavutil    51. 20. 1 / 51. 20. 1
  libavcodec   53. 19. 1 / 53. 19. 1
  libavformat  53. 14. 0 / 53. 14. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 43. 6 /  2. 43. 6
  libswscale    2.  1. 0 /  2.  1. 0
Input #0, image2, from 'out.jp2':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: j2k, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

Change History (9)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: j2k added
Reproduced by developer: set
Status: newopen

comment:2 by Michael Niedermayer, 11 years ago

Resolution: worksforme
Status: openclosed

Seems this has been fixed, i cant reproduce it anymore

comment:3 by Carl Eugen Hoyos, 11 years ago

Resolution: worksforme
Status: closedreopened
$ ./ffmpeg -i tests/lena.pnm -pix_fmt yuv444p -strict experimental out.jp2
ffmpeg version N-48385-g5ed5e90 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan  1 2013 21:30:44 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 85.100 / 54. 85.100
  libavformat    54. 59.100 / 54. 59.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.102 /  3. 30.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, image2, from 'tests/lena.pnm':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: ppm, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
Output #0, image2, to 'out.jp2':
  Metadata:
    encoder         : Lavf54.59.100
    Stream #0:0: Video: jpeg2000, yuv444p, 256x256, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (ppm -> j2k)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:89kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.024236%
./ffmpeg -strict -2 -i out.jp2
ffmpeg version N-48385-g5ed5e90 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan  1 2013 21:30:44 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 85.100 / 54. 85.100
  libavformat    54. 59.100 / 54. 59.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.102 /  3. 30.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, image2, from 'out.jp2':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: jpeg2000, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

comment:4 by Michael Niedermayer, 11 years ago

Resolution: worksforme
Status: reopenedclosed

the testcase works now, one of the many changes to jpeg2000 must have fixed it

comment:5 by Carl Eugen Hoyos, 11 years ago

Resolution: worksforme
Status: closedreopened

I don't think it can be expected behaviour if an encoder is fed with yuv444p and encodes rgb24.

$ ffmpeg -i tests/lena.pnm -pix_fmt yuv444p -strict -2 out.jp2
ffmpeg version N-55749-g6067186 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 24 2013 11:53:22 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.102 / 55. 14.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.102 /  3. 82.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'tests/lena.pnm':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: ppm, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
Output #0, image2, to 'out.jp2':
  Metadata:
    encoder         : Lavf55.14.102
    Stream #0:0: Video: jpeg2000, yuv444p, 256x256, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (ppm -> jpeg2000)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:76kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.028340%
$ ffmpeg -i out.jp2
ffmpeg version N-55749-g6067186 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 24 2013 11:53:22 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.102 / 55. 14.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.102 /  3. 82.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'out.jp2':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: jpeg2000 (JPEG 2000 codestream restriction 0), rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified
$ ffmpeg -i out.jp2
ffmpeg version N-55750-gbbe0045 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 24 2013 12:08:27 with gcc 4.7 (SUSE Linux)
  configuration: --enable-libopenjpeg --disable-decoder=jpeg2000
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.102 / 55. 14.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.102 /  3. 82.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
Input #0, image2, from 'out.jp2':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: jpeg2000, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

in reply to:  5 comment:6 by Michael Niedermayer, 9 years ago

Replying to cehoyos:

I don't think it can be expected behaviour if an encoder is fed with yuv444p and encodes rgb24.

The encoder does not do that or at least not anymore

your testcase shows yuv444p here

comment:7 by Michael Niedermayer, 9 years ago

Cc: Michael Niedermayer added

comment:8 by Carl Eugen Hoyos, 9 years ago

$ ffmpeg -i fate-suite/lena.pnm -pix_fmt yuv444p -strict -2 out.jp2
ffmpeg version N-72794-gdbbb31e Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration:
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
Input #0, image2, from 'fate-suite/lena.pnm':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 39333 kb/s
    Stream #0:0: Video: ppm, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
Output #0, image2, to 'out.jp2':
  Metadata:
    encoder         : Lavf56.36.100
    Stream #0:0: Video: jpeg2000, yuv444p, 256x256, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.41.100 jpeg2000
Stream mapping:
  Stream #0:0 -> #0:0 (ppm (native) -> jpeg2000 (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-1.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:76kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
$ ffmpeg -i out.jp2
ffmpeg version N-72794-gdbbb31e Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration:
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
Input #0, j2k_pipe, from 'out.jp2':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: jpeg2000 (JPEG 2000 codestream restriction 0), rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified
$ ffmpeg -i out.jp2
ffmpeg version N-72794-gdbbb31e Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-libopenjpeg --disable-decoder=jpeg2000
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
Input #0, j2k_pipe, from 'out.jp2':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: jpeg2000, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
At least one output file must be specified

comment:9 by Michael Niedermayer, 9 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.