0

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"
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.