Skip to content

Panic on basic encode of rgb48, 12 bpc images within ffmpeg #3435

@iyesin

Description

@iyesin

Describe the bug
ffmpeg nightly build is panicking while trying to encode rgb48/12 bpp image series.

To Reproduce

  1. Make test directory: mkdir -p test && cd test
  2. Generate random-ish samples: for n in {0..2}; do convert -size 4946x3280 -depth 12 plasma:red-blue -gravity Center -pointsize 50 -fill green output_${n}.jxl & done; wait
  3. Try to generate video: RUST_BACKTRACE=full ~/opt/ffmpeg-master-static_noauto/bin/ffmpeg -y -hide_banner -start_number 1 -r 25 -i ./output_%d.jxl -pix_fmt yuv444p12le -c:v librav1e test.mp4

Expected behavior
We get some playable video.

Required Information
Version:

v0.8.0 (cda12985b9bebd2f4d940ac5d32c945b78752e5b)

Operating system:

Linux caverock 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux
AND
Darwin my-mbp 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:29 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6030 arm64

Console Output

Linux x86_64:
Input #0, image2, from './output_%d.jxl':
  Duration: 00:00:00.08, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: jpegxl (libjxl), rgb48le(pc, gbr/bt709/iec61966-2-1), 4946x3280, 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (jpegxl (libjxl) -> av1 (librav1e))
Press [q] to stop, [?] for help

thread '<unnamed>' panicked at src/api/context.rs:369:33:
called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: "excessive value for bits written" }
stack backtrace:
   0:     0x5652fbfc59b3 - <unknown>
   1:     0x5652fbf7f7b3 - <unknown>
   2:     0x5652fbfc3b43 - <unknown>
   3:     0x5652fbfc5812 - <unknown>
   4:     0x5652fbfc6c50 - <unknown>
   5:     0x5652fbfc67d5 - <unknown>
   6:     0x5652fbfc73a2 - <unknown>
   7:     0x5652fbfc716a - <unknown>
   8:     0x5652fbfc5e89 - <unknown>
   9:     0x5652fbfc6e0d - <unknown>
  10:     0x5652f80dd5d0 - <unknown>
  11:     0x5652f80dd996 - <unknown>
  12:     0x5652fbedeb9d - <unknown>
  13:     0x5652f7fe4415 - <unknown>
  14:     0x5652f86c51ea - <unknown>
  15:     0x5652f81633bc - <unknown>
  16:     0x5652f817c18a - <unknown>
  17:     0x5652f81675f0 - <unknown>
  18:     0x5652f8167e4e - <unknown>
  19:     0x5652f816ab0d - <unknown>
  20:     0x5652f817cd15 - <unknown>
  21:     0x7f7aeb8ae1f5 - start_thread
                               at ./nptl/pthread_create.c:442:8
  22:     0x7f7aeb92e89c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81:0
  23:                0x0 - <unknown>

thread '<unnamed>' panicked at library/core/src/panicking.rs:225:5:
panic in a function that cannot unwind
stack backtrace:
   0:     0x5652fbfc59b3 - <unknown>
   1:     0x5652fbf7f7b3 - <unknown>
   2:     0x5652fbfc3b43 - <unknown>
   3:     0x5652fbfc5812 - <unknown>
   4:     0x5652fbfc6c50 - <unknown>
   5:     0x5652fbfc67d5 - <unknown>
   6:     0x5652fbfc73a2 - <unknown>
   7:     0x5652fbfc7136 - <unknown>
   8:     0x5652fbfc5e89 - <unknown>
   9:     0x5652fbfc6e0d - <unknown>
  10:     0x5652f80dd60d - <unknown>
  11:     0x5652f80dd6a2 - <unknown>
  12:     0x5652f80dd765 - <unknown>
  13:     0x5652fbedecc3 - <unknown>
  14:     0x5652f7fe4415 - <unknown>
  15:     0x5652f86c51ea - <unknown>
  16:     0x5652f81633bc - <unknown>
  17:     0x5652f817c18a - <unknown>
  18:     0x5652f81675f0 - <unknown>
  19:     0x5652f8167e4e - <unknown>
  20:     0x5652f816ab0d - <unknown>
  21:     0x5652f817cd15 - <unknown>
  22:     0x7f7aeb8ae1f5 - start_thread
                               at ./nptl/pthread_create.c:442:8
  23:     0x7f7aeb92e89c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81:0
  24:                0x0 - <unknown>
thread caused non-unwinding panic. aborting.
Aborted (core dumped)
MacOS 15.5 on M3
Started at: Sun Jun  1 20:15:52 UTC 2025
Input #0, image2, from './output_%d.jxl':
  Duration: 00:00:00.08, start: 0.000000, bitrate: N/A
  Stream #1:0: Video: jpegxl (libjxl), rgb48le(12 bpc, pc, gbr/bt709/iec61966-2-1), 4946x3280, 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #1:0 -> #0:0 (jpegxl (libjxl) -> av1 (librav1e))
Press [q] to stop, [?] for help
[librav1e @ 0x138607f20] Invalid value for key_frame_interval: -1.

thread '<unnamed>' panicked at src/api/context.rs:369:33:
called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: "excessive value for bits written" }
stack backtrace:
   0:        0x1074ddf5c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h92c4e918781d801b
   1:        0x1074a2d78 - core::fmt::write::h8f75e776556839a0
   2:        0x1074eab28 - std::io::Write::write_fmt::hc2a765a75039a837
   3:        0x1074dde1c - std::sys::backtrace::BacktraceLock::print::ha7a698681566e125
   4:        0x1074e4608 - std::panicking::default_hook::{{closure}}::hf90e930ff3e69c2d
   5:        0x1074e4504 - std::panicking::default_hook::had80bb8af3f6815c
   6:        0x1074e4c64 - std::panicking::rust_panic_with_hook::h77f9a822db4ac97a
   7:        0x1074de35c - std::panicking::begin_panic_handler::{{closure}}::hdef05f72e863ecab
   8:        0x1074de190 - std::sys::backtrace::__rust_end_short_backtrace::h04755aa67467b613
   9:        0x1074e46a4 - __rustc[1fd9a2239dcb543a]::rust_begin_unwind
  10:        0x10752a0e8 - core::panicking::panic_fmt::h613da67238a5aeb3
  11:        0x10752a714 - core::result::unwrap_failed::h4a384f1588aef5b3
  12:        0x1073b4ab8 - _rav1e_container_sequence_header
  13:        0x1046d4954 - _avpriv_elbg_free
  14:        0x10417bdec - _avcodec_open2
  15:        0x102c78d24 - _enc_open
  16:        0x102c8cfd4 - _sch_filter_send
  17:        0x102c7e580 - _fg_send_command
  18:        0x102c7db98 - _fg_send_command
  19:        0x102c7b15c - _fg_create
  20:        0x102c8d308 - _sch_filter_command
  21:        0x191482c0c - __pthread_cond_wait

thread '<unnamed>' panicked at library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:        0x1074ddf5c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h92c4e918781d801b
   1:        0x1074a2d78 - core::fmt::write::h8f75e776556839a0
   2:        0x1074eab28 - std::io::Write::write_fmt::hc2a765a75039a837
   3:        0x1074dde1c - std::sys::backtrace::BacktraceLock::print::ha7a698681566e125
   4:        0x1074e4608 - std::panicking::default_hook::{{closure}}::hf90e930ff3e69c2d
   5:        0x1074e4504 - std::panicking::default_hook::had80bb8af3f6815c
   6:        0x1074e4c64 - std::panicking::rust_panic_with_hook::h77f9a822db4ac97a
   7:        0x1074de334 - std::panicking::begin_panic_handler::{{closure}}::hdef05f72e863ecab
   8:        0x1074de190 - std::sys::backtrace::__rust_end_short_backtrace::h04755aa67467b613
   9:        0x1074e46a4 - __rustc[1fd9a2239dcb543a]::rust_begin_unwind
  10:        0x10752a11c - core::panicking::panic_nounwind_fmt::h919f8dea01bdbaf4
  11:        0x10752a194 - core::panicking::panic_nounwind::h991711032f1b83de
  12:        0x10752a238 - core::panicking::panic_cannot_unwind::h88b30e8491b5aeb2
  13:        0x1073b4bdc - _rav1e_container_sequence_header
  14:        0x1046d4954 - _avpriv_elbg_free
  15:        0x10417bdec - _avcodec_open2
  16:        0x102c78d24 - _enc_open
  17:        0x102c8cfd4 - _sch_filter_send
  18:        0x102c7e580 - _fg_send_command
  19:        0x102c7db98 - _fg_send_command
  20:        0x102c7b15c - _fg_create
  21:        0x102c8d308 - _sch_filter_command
  22:        0x191482c0c - __pthread_cond_wait
thread caused non-unwinding panic. aborting.
Command terminated by signal 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions