<p>There's the setsar and setdar <a href="https://ffmpeg.org/ffmpeg-filters.html#setdar_002c-setsar" rel="nofollow noreferrer">filters</a> for this purpose</p>

<pre><code>-vf scale=960:720,setdar=16/9
</code></pre>

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

CC BY-SA 4.0
2018-09-07T09:19:03.367Z
2018-09-07T09:19:03.367Z
Gyan
<p>I'd like to encode a video, say, in 960 x 720 but have video players automatically play it in 1280 x 720.</p>

<p>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?</p>

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

<pre><code>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"
</code></pre>

<ffmpeg><encoding><scale>
Setting different resolution for encoding and display when encoding in ffmpeg
user14764
# Setting different resolution for encoding and display when encoding in ffmpeg

(Asked by: username_0 on 2018-09-07)

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"

**Tags:** ffmpeg, encoding, scale


---

## 1 answers

### Answer by username_1 on 2018-09-07. Score: 1 | Accepted answer

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.


---

