u/rnclark

▲ 4 r/ffmpeg

How to produce 4K HDR youtube video

I want to thank those how have helped me over the last couple of years with ffmpeg.

I have produced several videos with ffmpeg and posted a couple of 4K SDR timelapses on youtube. They worked great.

I also want to put 4K HDR 10-bit/channel video on youtube and have struggled to find the right settings.

The videos below were produced entirely with ffmpeg (with some pre-work in audacity editing the 5.1 surround sound).

I first made the complete video in prores yuv422p10le

Then I converted the video to 420 with -pix_fmt yuv420p10le -crf 17 -c:v hevc -x265-params colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc

and played it on an LG OLED TV via a USB stick. The TV shows that is it HDR and the video looks great (to me).

Ffmpeg shows it as:

hevc (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084, progressive), 3840x2160, q=2-31, 59.94 fps

I converted for youtube with the following

ffmpeg -probesize 100M -i input-prores-422.mkv -crf 17 -preset slow -c:a aac -c:v hevc -pix_fmt yuv420p10le -x265-params colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc -movflags +faststart output-youtube.mp4

Ffmpeg also shows the result as yuv420p10le as above.

I uploaded to youtube and the uploaded file is here (I hope this is OK to post here):

https://www.youtube.com/watch?v=VWR1nlZn22U

When played youtube on my LG OLED TV, the TV does not report it as HDR, and there are posterization artifacts typical of that when I played my video (before youtube) on an SDR display.

So what can I do to get youtube to play 4K HDR?

reddit.com
u/rnclark — 4 days ago
▲ 4 r/ffmpeg

setting volume and ramping up to a different volume with ffmpeg

I have a 5.1 audio wave file from audacity. I merge it with 4k yuv420p10le video. It plays great on both my linux machine (of course video not in hdr) and on my OLED TVs with surround system.

But I need to change the volume at the beginning:

volume = 0.1 from time 0 to 110 seconds, then ramp up to 1.0 from 110 to 214 seconds.

I used the following command:

ffmpeg -i input.wav -af "volume=enable='between(t,0,110)':volume=0.1,volume=enable='between(t,110,214)':volume='0.1+(t-110)/104*0.9'" output.wav

But I get:

ffmpeg version 6.1.1-3ubuntu5
Input #0, wav, from 'kilauea-eruption-2026-04-23-v5-4k-420hdr+audio-5,1-filtered-g.wav':
  Metadata:
    encoder         : Lavf61.1.100 (libsndfile-1.0.31)
    Software        : Lavf61.1.100
  Duration: 00:10:54.97, bitrate: 4608 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))

[Parsed_volume_1 @ 0x57b626ed6d80] Invalid value NaN for volume
[Parsed_volume_1 @ 0x57b626ed6d80] Failed to configure output pad on Parsed_volume_1
[af#0:0 @ 0x57b626e4df40] Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while filtering: Invalid argument

I used ffmpeg to select a smaller interval (say 5 minutes), and ffmpeg worked fine, so was able to read the original file without any problem. But ffmpeg gives the same error message on the reduced size file.

I've searched the internet and can't see what I am doing wrong. Any help is greatly appreciated.

reddit.com
u/rnclark — 12 days ago