From 6c4b504eca88f4083cfbd99b04e997691db94380 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 7 Nov 2013 17:54:16 +0100 Subject: encoding-example-profiles: support setsar in FFmpeg-git --- etc/encoding-example-profiles.conf | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'etc') diff --git a/etc/encoding-example-profiles.conf b/etc/encoding-example-profiles.conf index 25186bb2b9..cedb8066a2 100644 --- a/etc/encoding-example-profiles.conf +++ b/etc/encoding-example-profiles.conf @@ -159,7 +159,7 @@ omaxfps = 30 profile-desc = "MP4 for Nokia N900" profile = enc-f-mp4 # DW = 800, DH = 480, SAR = 1 -vf-add = lavfi=graph="scale=floor(min(min(800\,dar*480)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(min(800/dar\,480)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=1" +vf-add = lavfi=graph="scale=floor(min(min(800\,dar*480)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(min(800/dar\,480)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=sar=1" ovcopts-add = profile=baseline,level=30,maxrate=10000k,bufsize=10000k,rc_init_occupancy=9000k,refs=5 omaxfps = 30 @@ -212,7 +212,15 @@ profile = enc-f-mp4 omaxfps = 30 ovcopts-add = profile=high # DW = 1024, DH = 600, DAR = 97:54 (=> SAR = 2425:2304) -vf-add = lavfi=graph="scale=floor(min(1024*min(1\,dar*54/97)\,in_w*max(1\,sar*2304/2425))/2+0.5)*2:floor(min(600*min(97/54/dar\,1)\,in_h*max(2425/2304/sar\,1))/2+0.5)*2,setsar=1" +vf-add = lavfi=graph="scale=floor(min(1024*min(1\,dar/(97/54))\,in_w*max(1\,sar/(2425/2304)))/2+0.5)*2:floor(min(600*min((97/54)/dar\,1)\,in_h*max((2425/2304)/sar\,1))/2+0.5)*2,setsar=sar=1" + +[enc-to-hp-slate-7-git] +profile-desc = "MP4 for HP Slate 7 (1024x600, crazy aspect), FFmpeg-git" +profile = enc-f-mp4 +omaxfps = 30 +ovcopts-add = profile=high +# DW = 1024, DH = 600, DAR = 97:54 (=> SAR = 2425:2304) +vf-add = lavfi=graph="scale=floor(min(1024*min(1\,dar/(97/54))\,in_w)/2+0.5)*2:floor(min(600*min((97/54)/dar\,1)\,in_h)/2+0.5)*2,setsar=sar=sar/(2425/2304)" # Advanced scaling for specific output devices - how it works: # DW = display width (px) (1024) @@ -220,9 +228,9 @@ vf-add = lavfi=graph="scale=floor(min(1024*min(1\,dar*54/97)\,in_w*max(1\,sar*23 # SAR = display sample aspect ratio, i.e. DAR * DH / DW (2425:2304) # DAR = display aspect ratio, i.e. SAR * DW / DH (97:54) # Variant: zoomed out -# vf-add = lavfi=graph="scale=floor(min(DW*min(1\,dar/DAR)\,in_w*max(1\,sar/SAR))/2+0.5)*2:floor(min(DH*min(DAR/dar\,1)\,in_h*max(SAR/sar\,1))/2+0.5)*2,setsar=1" +# vf-add = lavfi=graph="scale=floor(min(DW*min(1\,dar/DAR)\,in_w*max(1\,sar/SAR))/2+0.5)*2:floor(min(DH*min(DAR/dar\,1)\,in_h*max(SAR/sar\,1))/2+0.5)*2,setsar=sar=1" # Variant: zoomed in -# vf-add = lavfi=graph="scale=floor(min(DW*max(1\,dar/DAR)\,in_w*max(1\,sar/SAR))/2+0.5)*2:floor(min(DH*max(DAR/dar\,1)\,in_h*max(SAR/sar\,1))/2+0.5)*2,setsar=1" +# vf-add = lavfi=graph="scale=floor(min(DW*max(1\,dar/DAR)\,in_w*max(1\,sar/SAR))/2+0.5)*2:floor(min(DH*max(DAR/dar\,1)\,in_h*max(SAR/sar\,1))/2+0.5)*2,setsar=sar=1" # How it works: # 1a: DW, DH*dar/DAR - fit to display width # 1b: DH*DAR/dar, DH - fit to display height @@ -231,23 +239,21 @@ vf-add = lavfi=graph="scale=floor(min(1024*min(1\,dar*54/97)\,in_w*max(1\,sar*23 # 2b: in_w*sar/SAR, in_h - fit to original height # 2: the max of 2a and 2b (i.e. avoid enlarging both dimensions - let HW scaling handle this) # output: the min of 1 and 2 (i.e. fulfill both constraints) -# setsar=1 to prevent scaling on the device (skip this if the device actually wants the proper SAR to be specified for not performing needless scaling) +# setsar=sar=1 to prevent scaling on the device (skip this if the device actually wants the proper SAR to be specified for not performing needless scaling) # # Simplified special case for SAR == 1, DAR == DW/DH: # Variant: zoomed out -# vf-add = lavfi=graph="scale=floor(min(min(DW\,dar*DH)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(min(DW/dar\,DH)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=1" +# vf-add = lavfi=graph="scale=floor(min(min(DW\,dar*DH)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(min(DW/dar\,DH)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=sar=1" # Variant: zoomed in -# vf-add = lavfi=graph="scale=floor(min(max(DW\,dar*DH)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(max(DW/dar\,DH)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=1" -# setsar=1 to prevent nasty almost-1 SAR to be passed to the codec due to the rounding which can fail +# vf-add = lavfi=graph="scale=floor(min(max(DW\,dar*DH)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(max(DW/dar\,DH)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=sar=1" +# setsar=sar=1 to prevent nasty almost-1 SAR to be passed to the codec due to the rounding which can fail # # If the device supports file SAR properly, we can make use of it to avoid -# upscaling. Note that setsar cannot be used to fake a different output SAR by -# applying a multiplier to the original one, so e..g it can't be used for the -# HP Slate 7! +# upscaling. The setsar=sar=sar/SAR at the end serves to fake the SAR for devices that don't know their own display's SAR. # Variant: zoomed out -# vf-add = lavfi=graph="scale=floor(min(DW*min(1\,dar/DAR)\,in_w)/2+0.5)*2:floor(min(DH*min(DAR/dar\,1)\,in_h)/2+0.5)*2" +# vf-add = lavfi=graph="scale=floor(min(DW*min(1\,dar/DAR)\,in_w)/2+0.5)*2:floor(min(DH*min(DAR/dar\,1)\,in_h)/2+0.5)*2,setsar=sar=sar/SAR" # Variant: zoomed in -# vf-add = lavfi=graph="scale=floor(min(DW*max(1\,dar/DAR)\,in_w)/2+0.5)*2:floor(min(DH*max(DAR/dar\,1)\,in_h)/2+0.5)*2" +# vf-add = lavfi=graph="scale=floor(min(DW*max(1\,dar/DAR)\,in_w)/2+0.5)*2:floor(min(DH*max(DAR/dar\,1)\,in_h)/2+0.5)*2,setsar=sar=sar/SAR" # Simplified special case for SAR == 1, DAR == DW/DH: # Variant: zoomed out # vf-add = lavfi=graph="scale=floor(min(min(DW\,dar*DH)\,in_w)/2+0.5)*2:floor(min(min(DW/dar\,DH)\,in_h)/2+0.5)*2" -- cgit v1.2.3