Using ffmpeg, how can I burn in one of multiple SRT subtitles tracks while also using -filter-complex?

Ah, I figured it out.

ffmpeg -y -i source.mkv -c:v vp9 -row-mt 1 -crf 24 -s 720x480 -sar "32:27" \
    -filter_complex "[0:v]zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709, \
        tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p[v0]; \
        [v0]subtitles=source.mkv:si=1[v]" -map "[v]" -an -dash 1 \
    -map_chapters -1 -f webm out.webm

I didn’t realize that close to the same syntax as is used for a simple filter can be added to a complex filter, so long as you use the proper parameter naming to chain the filter components.

I also learned that the file name of a video with multiple embedded subtitle tracks can be supplemented with a track selector in the form :si=index.

I’m using this command to generate pre-converted video streams at various resolutions for adaptive streaming. The non-subtitle part of the filter is for converting HDR video to SDR.

Read more here: Source link