Opened 3 months ago

Last modified 9 days ago

#11207 open defect

error in jpeg2000 decoder on sample file

Reported by: 03302024 Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: jpeg2000
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by 03302024)

I use Icaros (https://github.com/Xanashi/Icaros) for thumbnail generation in Windows 11. It uses ffmpeg for that. Icaros has trouble with some jp2 files. I reported the issue here: jp2 support #108 (https://github.com/Xanashi/Icaros/issues/108) and got a response that it is ffmpeg's fault.

I reported the issue here again: jp2 support #152 (https://github.com/GyanD/codexffmpeg/issues/152) and got a responce that it is the file's fault:
SOC marker not present
error during processing marker segment ff55

However, there are many jp2 files on archive.org website with the same issue. XnViewMP and IrfanView can show the files OK. So, may be the errors are not severe and ffmpeg could just treat the errors as warnings and move on?

Here are two sample files, for which, I get black thumbnails:
1) https://archive.org/download/dr_pratts-high-test-plan-of-the-eastern-counties-and-the-midlands-12471000/12471000.jp2
2) Attached "test file.zip". It is a scan of an empty white page.

Can you please have a look?

Attachments (1)

test.file.zip (414 bytes ) - added by 03302024 3 months ago.

Download all attachments as: .zip

Change History (4)

by 03302024, 3 months ago

Attachment: test.file.zip added

comment:1 by 03302024, 3 months ago

Description: modified (diff)

comment:2 by 03302024, 3 months ago

Description: modified (diff)

comment:3 by compn, 9 days ago

Component: undeterminedavcodec
Keywords: jpeg2000 added
Status: newopen
Summary: jp2 supporterror in jpeg2000 decoder on sample file
Version: unspecifiedgit-master

testing with https://archive.org/download/dr_pratts-high-test-plan-of-the-eastern-counties-and-the-midlands-12471000/12471000.jp2

ffmpeg -i 12471000.jp2 -vf scale=640:480 out.avi

ffmpeg version N-117760-gfe18ed3f2a-20241112 Copyright (c) 2000-2024 the FFmpeg developers

built with gcc 14.2.0 (crosstool-NG 1.26.0.120_4d36f27)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-

mingw32- --arch=x86_64 --target-os=mingw32 --enable-version3 --disable-debug --enable-shared --disable-static --disable-
w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable
-libxml2 --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --
enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --disable-avisynth --ena
ble-chromaprint --enable-libdav1d --disable-libdavs2 --disable-libdvdread --disable-libdvdnav --disable-libfdk-aac --ena
ble-ffnvcodec --enable-cuda-llvm --disable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-l
ibass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-
libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-libopen
core-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --
disable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtw
olame --enable-libuavs3d --disable-libdrm --enable-vaapi --disable-libvidstab --enable-vulkan --enable-libshaderc --enab
le-libplacebo --enable-libvvenc --disable-libx264 --disable-libx265 --disable-libxavs2 --disable-libxvid --enable-libzim
g --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --e
xtra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64
-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20241112

libavutil 59. 46.100 / 59. 46.100
libavcodec 61. 24.100 / 61. 24.100
libavformat 61. 9.100 / 61. 9.100
libavdevice 61. 4.100 / 61. 4.100
libavfilter 10. 6.101 / 10. 6.101
libswscale 8. 9.101 / 8. 9.101
libswresample 5. 4.100 / 5. 4.100

[jpeg2000 @ 00000170ed2733c0] SOC marker not present
[jpeg2000 @ 00000170ed2733c0] error during processing marker segment ff55
Input #0, j2k_pipe, from '12471000.jp2':

Duration: N/A, bitrate: N/A
Stream #0:0: Video: jpeg2000, rgb24, 9958x7686, 25 fps, 25 tbr, 25 tbn

File 'out.avi' already exists. Overwrite? [y/N] y
Stream mapping:

Stream #0:0 -> #0:0 (jpeg2000 (native) -> mpeg4 (native))

Press [q] to stop, ? for help
[jpeg2000 @ 00000170ed273900] SOC marker not present
[jpeg2000 @ 00000170ed276cc0] error during processing marker segment ff55
[vist#0:0/jpeg2000 @ 00000170ed1b7900] [dec:jpeg2000 @ 00000170ef1d0880] Decoding error: Invalid data found when process
ing input
[vist#0:0/jpeg2000 @ 00000170ed1b7900] [dec:jpeg2000 @ 00000170ef1d0880] Decoding error: Operation not permitted
[vist#0:0/jpeg2000 @ 00000170ed1b7900] [dec:jpeg2000 @ 00000170ef1d0880] Decode error rate 1 exceeds maximum 0.666667
[vist#0:0/jpeg2000 @ 00000170ed1b7900] [dec:jpeg2000 @ 00000170ef1d0880] Task finished with error code: -1145393733 (Err
or number -1145393733 occurred)
[vist#0:0/jpeg2000 @ 00000170ed1b7900] [dec:jpeg2000 @ 00000170ef1d0880] Terminating thread with return code -1145393733

(Error number -1145393733 occurred)

[vf#0:0 @ 00000170ed2859c0] No filtered frames for output stream, trying to initialize anyway.
Output #0, avi, to 'out.avi':

Metadata:

ISFT : Lavf61.9.100

Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p(progressive), 640x480, q=2-31, 200 kb/s, 25 fps, 25 tbn

Metadata:

encoder : Lavc61.24.100 mpeg4

Side data:

cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A

[out#0/avi @ 00000170ed21dcc0] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhea
d: unknown
[out#0/avi @ 00000170ed21dcc0] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame= 0 fps=0.0 q=0.0 Lsize= 6KiB time=N/A bitrate=N/A speed=N/A
Conversion failed!

Note: See TracTickets for help on using tickets.