Opened 11 years ago
Closed 11 years ago
#4689 closed defect (fixed)
jpeg2000: kakadu doesn't like ffmpeg-generated jp2 files
| Reported by: | ami_stuff | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avcodec |
| Version: | git-master | Keywords: | j2k |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | yes | |
| Analyzed by developer: | no |
Description
irfanview also refuses to process them
C:\>ffmpeg -i test.bmp -vcodec jpeg2000 -strict -2 out.jp2
ffmpeg version N-73189-g7728d23 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 45.100 / 56. 45.100
libavformat 56. 38.102 / 56. 38.102
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 18.100 / 5. 18.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, bmp_pipe, from 'test.bmp':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: bmp, bgr24, 999x749, 25 tbr, 25 tbn, 25 tbc
File 'out.jp2' already exists. Overwrite ? [y/N] y
Output #0, image2, to 'out.jp2':
Metadata:
encoder : Lavf56.38.102
Stream #0:0: Video: jpeg2000, rgb24, 999x749, q=2-31, 200 kb/s, 25 fps, 25 t
bn, 25 tbc
Metadata:
encoder : Lavc56.45.100 jpeg2000
Stream mapping:
Stream #0:0 -> #0:0 (bmp (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:881kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing o
verhead: unknown
C:\>kdu_render.exe -i out.jp2 -o out.bmp Kakadu Core Error: Code-stream must start with an SOC marker! Error in Kakadu Region Compositor: Unable to create imagery layer for direct rendering of image components from codestream (index starting from 0) 0: codestream cannot be opened.
Attachments (6)
Change History (16)
by , 11 years ago
by , 11 years ago
comment:1 by , 11 years ago
comment:2 by , 11 years ago
| Component: | undetermined → avcodec |
|---|---|
| Keywords: | j2k added |
| Version: | unspecified → git-master |
And with -format j2k.
follow-up: 4 comment:3 by , 11 years ago
- "-pred 1" alone doesn't change anything
but
- "-format j2k" file decodes correctly with kakadu/irfanview (with or without "-pred 1")
follow-up: 5 comment:4 by , 11 years ago
Replying to ami_stuff:
- "-format j2k" file decodes correctly with kakadu/irfanview (with or without "-pred 1")
Then I assume there is just a missing feature in kakadu: You could also test with jasper jp2 encoding or image_to_j2k jp2 encoding.
comment:5 by , 11 years ago
Replying to cehoyos:
Replying to ami_stuff:
- "-format j2k" file decodes correctly with kakadu/irfanview (with or without "-pred 1")
Then I assume there is just a missing feature in kakadu: You could also test with jasper jp2 encoding or image_to_j2k jp2 encoding.
I belive it's a bug in ffmpeg's code. Attached jp2 file decodes correctly with kakadu.
by , 11 years ago
by , 11 years ago
| Attachment: | jasper.jp2 added |
|---|
by , 11 years ago
| Attachment: | image_to_j2k.jp2 added |
|---|
follow-up: 7 comment:6 by , 11 years ago
Could be an issue with the length of the ftyp atom. Do the attached samples also work?
comment:7 by , 11 years ago
Replying to cehoyos:
Could be an issue with the length of the ftyp atom. Do the attached samples also work?
yes
C:\>kdu_render.exe -i jasper.jp2 -o out.bmp Rendering finished, using 8 parallel threads of execution. C:\>kdu_render.exe -i image_to_j2k.jp2 -o out.bmp Rendering finished, using 8 parallel threads of execution.
by , 11 years ago
| Attachment: | patchftyp.diff added |
|---|
comment:9 by , 11 years ago
| Reproduced by developer: | set |
|---|---|
| Status: | new → open |
No need to test, it works, I will send the patch in a moment.
comment:10 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | open → closed |
Should be fixed in 0f5b99653120ca6d75cb668ff6cc5685dbda345c



Could you also test with
-pred 1(to activate the lossless mode)?