2023-10-27, 02:40 AM
(2023-10-27, 02:18 AM)TheDreadPirate Wrote: What ffmpeg options do I use to scale 4K videos to 1080P? And, of course, how would that handle the HDR side channel? Working on making 1080P SDR versions of my 4K HDR media so I can keep the 4K media in a separate library.
give this a try, i use a variation of it
run in the jellyfin server/docker, uses jellyfin's ffmpeg which is already setup for hwaccel
produces yuv420p10le, VBR min 50M max 60M (very high bitrate, probably lower would be better)
add -map 0:s if you want to copy subs, audio is already copied
adding 'setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709' to -vf produces a 709 but looks washed out
set width 1920, maintain aspect for height
Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:,driver=iHD -filter_hw_device va -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 \
-i <input.mkv> -threads 4 -vf 'scale_vaapi=w=1920:h=-2' \
-map 0:0 -map 0:a -c:0 hevc_vaapi -c:a copy -c:s copy -tag:v:0 hvc1 -rc_mode VBR -b:v 50M -maxrate 60M -y output.mkv
any ffmpeg gurus please point out my flaws, its just put together from the documentation