macOS: Use hardware encoder failing

You must use the English language in a bug report. If you do not speak English please use a translation service instead of trying your best to write English. Thank you

  • What is your operating system? macOS Tahoe, Macbook Pro M2 and M4

  • What is your Shotcut version (see Help > About Shotcut)? 26.1.30 (Was also broken in last release)

  • Can you repeat the problem? If so, what are the steps? Choose YouTube Preset, Check/Enable Use Hardware Encoder. Export fails.

[h264 @ 0x724d7aa00] Reinit context to 1920x1088, pix_fmt: yuv420p

[h264 @ 0x724d7aa00] Increasing reorder buffer to 1

[h264 @ 0x724d7ad80] Reinit context to 1920x1088, pix_fmt: yuv420p

[h264 @ 0x724d7ad80] Increasing reorder buffer to 1

[h264 @ 0x724d7b480] Reinit context to 1920x1088, pix_fmt: yuv420p

[h264 @ 0x724d7b480] Increasing reorder buffer to 1

[producer avformat] audio: total_streams 1 max_stream 1 total_channels 2 max_channels 2

[AVIOContext @ 0x725b08dc0] Statistics: 736106 bytes read, 3 seeks

[chain avformat-novalidate] /Users/MRAI/IAV/italy/02026-02-02_16-46-14.mkv

hwaccel videotoolbox_vld av_hwdevice_ctx_create() success

[chain avformat-novalidate] /Users/MRAI/IAV/italy/02026-02-02_16-46-14.mkv

checking VFR: pkt.duration 33

[h264 @ 0x725934e00] Reinit context to 1920x1088, pix_fmt: videotoolbox_vld

[h264_videotoolbox @ 0x724d7a300] Color range not set for nv12. Using MPEG range.

[mp4 @ 0x723cac000] pts (512) < dts (1024) in stream 0

[consumer avformat] error writing video frame: -22

[mp4 @ 0x723cac000] Starting second pass: moving the moov atom to the beginning of the file

[AVIOContext @ 0x725b09180] Statistics: 164205 bytes read, 0 seeks

[aac @ 0x724d7a680] Qavg: 45563.289

[aac @ 0x724d7a680] 2 frames left in the queue on closing

[AVIOContext @ 0x725b08c80] Statistics: 329894 bytes written, 4 seeks, 5 writeouts

Failed with exit code 1

As you had previously suggested: changed B frames to 0 and it works.

That’s also interesting for me. Can you tell me what “B frames to 0” is or how to change this setting?

Thank you

1 Like

Thank you very much :folded_hands:t2:

I was pulling my hair out trying to figure out why the Toolbox encoder kept failing after the update. Manually setting B frames to 0 under the Export > Codecs tab fixed it immediately.

It does default to 0 B frames when that is turned on (at least on startup), but it does not strictly enforce it, and it possible through some presets or certain sequences of clicks to alter the default. Also, HEVC on VideoToolbox supports B frames on my Macs.

It looks like I relaxed the strictness of this when I made a recent change in version 25.10 for the following bug:

For version 26.2 I will change it back to strictly enforced for h264_videotoolbox