1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00

encoding-example-profiles: for Nokia N900, avoid upscaling

This yields generally smaller files, by avoiding upscaling at all times.
This method may or may not be useful for iOS, needs testing there.

Note: this uses three instances of vf_scale:

1. Scale to target dimensions, ONLY if both are <= original video
   dimensions.
2. Failing that, scale to width*<calculated height by display aspect>,
   ONLY if <calculated height by display aspect> <= original video
   height.
3. Failing that, scale to <calculated width by display aspect>*height.
   When the test before failed, we KNOW that <calculated width by
   display aspect> <= original video width.

So basically, only one of the three scalers should ever be active, as
the last two scalers only can ever have an effect if the aspect ratio
mismatches the video.

As for danger of roundoff errors:

If scaler 1 succeeded, we have won. Scalers 2 and 3 will never do
anything, because display resolution == video resolution. Here it is
crucial that no rounding of video size to display size takes place; in
other words, the target display size already MUST be even, which it is
because we pass 2 to the rounding parameter of the dsize filter.

Scaler 2 and 3 are obviously mutually exclusive, as they depend on
opposite aspect ratio conditions.

We later should put this functionality directly into vf_scale...
This commit is contained in:
Rudolf Polzer 2013-03-18 13:22:39 +01:00
parent d17e0977ea
commit 3ef58d85ba

View File

@ -156,7 +156,7 @@ ovcopts-add = maxrate=1500k,bufsize=1000k,rc_init_occupancy=900k,refs=1,profile=
[enc-to-nok-n900]
profile-desc = "MP4 for Nokia N900"
profile = enc-f-mp4
vf-add = dsize=800:480:0:2,scale=w=0:h=0,dsize=-1:-1 # native screen res, letterbox
vf-add = dsize=800:480:0:2,scale=w=0:h=0:noup=1,scale=w=-1:h=-2:noup=1,scale=w=-2:h=-1:noup=1,dsize=-1:-1 # native screen res, letterbox
ovcopts-add = profile=baseline,level=30
[enc-to-nok-6300]