Setting different resolution for encoding and display when encoding in ffmpeg I'd like to encode a video, say, in 960 x 720 but have video players automatically play it in 1280 x 720.

I know how to do this in 2 steps, by first encoding in 960 x 720 (ffmpeg with -vf scale=960:720) and then modifying the display ratio with MKVToolNix/mkvmerge, but it would be a lot more convenient if I could do it all directly with a single ffmpeg command. Is it possible?

I don't think that matters, but my current code looks like this:

ffmpeg -i "input.mkv" -vf scale=960:720 -ac 2 -codec:a libopus -b:a 96k -vbr on -compression_level 10 -frame_duration 60 -application audio -codec:v libx265 -preset slow -x265-params crf=21 "output.mkv"
There's the setsar and setdar filters for this purpose

-vf scale=960:720,setdar=16/9


Since you know the output display ratio, it's convenient to use setdar here, although both filters only alter the SAR.