Totally fair to want HW accel. You can still use it—just use it safely so the output stays Mac-friendly.
Why your earlier HW run went sideways:
- NVDEC (CUDA decode) can fail on some H.264 streams (too many decode surfaces, odd profiles), which then cascades into a bad transcode.
- NVENC defaults may emit formats Apple won’t open (e.g., 10-bit or 4:4:4, wrong level/profile, odd VBV).
- If audio stays as a weird codec inside MP4, QuickTime chokes.
Below are three solid options. All hit ~60 Mb/s and produce files that open in QuickTime and VLC on macOS.
You still get GPU-fast encoding, skip the fragile CUDA decode, and force Apple-safe settings.
-r 30 -c:v h264_nvenc -rc vbr_hq -b:v 60M -maxrate 70M -bufsize 140M \
-preset p7 -tune hq -spatial_aq 1 -aq-strength 8 \
-profile:v high -level:v 5.1 -pix_fmt yuv420p -g 60 -bf 3 -rc-lookahead 32 \
-c:a aac -b:a 320k -movflags +faststart output.mp4
Why this works: Apple-safe 8-bit 4:2:0, explicit profile/level for 4096×4096@30, MP4 faststart, and a high-quality NVENC rate control (vbr_hq + AQ).
Use this if you really want GPU-to-GPU. We keep the frames on GPU, but tame NVDEC.
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -threads 1 -extra_hw_frames 8 \
-r 30 -c:v h264_nvenc -rc vbr_hq -b:v 60M -maxrate 70M -bufsize 140M \
-preset p7 -tune hq -spatial_aq 1 -aq-strength 8 \
-profile:v high -level:v 5.1 -pix_fmt yuv420p -g 60 -bf 3 -rc-lookahead 32 \
-c:a aac -b:a 320k -movflags +faststart output.mp4
If you still see NVDEC errors, fall back to Option 1 (CPU decode).
Swap the encoder; still Mac-compatible:
-r 30 -c:v hevc_nvenc -rc vbr_hq -b:v 60M -maxrate 70M -bufsize 140M \
-preset p7 -tune hq -spatial_aq 1 -aq-strength 8 \
-profile:v main -level:v 5.1 -pix_fmt yuv420p -g 60 -bf 4 -rc-lookahead 32 \
-c:a aac -b:a 320k -movflags +faststart output.mp4
- Inspect output:
ffprobe -hide_banner -select_streams v:0 -show_streams output.mp4
Verify pix_fmt=yuv420p, profile=High (H.264) or Main (HEVC), level=5.1, and avg_frame_rate=30/1.
- If QuickTime still won’t open it, try forcing a stricter level or lower refs/B-frames:
add
-refs 4 -bf 2 -g 60.
This way you do use HW accel, but with guardrails so the file plays everywhere on macOS.