Search code examples
filterffmpegoverlayresolutionvideo-subtitles

Ffmpeg - Scale down video with overlay


I am trying to transcode a video with a subtitle overlay but I need to scale it down from 4k to 1080. How would I go about doing that with a complex filter?

ffmpeg -ss 00:00:00 -i myVideo.mkv -filter_complex[0:v][0:s:0]overlay[v] -map [v] -map 0:a:0 -y -acodec aac -ac 6 -pix_fmt yuv420p10le -vcodec libx265 -x265-params colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc -start_number 0 -hls_time 5 -force_key_frames expr:gte(t,n_forced*5) -hls_list_size 0 -f hls `output.ts`

Solution

  • Simply add a scale filter after the overlay.

    -filter_complex [0:v][0:s:0]overlay,scale=1920:1080[v]