Advertisement
khardwick

SAR.avs

Apr 19th, 2013
953
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. # All credit goes to ajpanton for creating this script.
  2. # You are legend, and we all have higher quality encodes to download thanks to you.
  3. avsfile = "script.avs" # Encoding script
  4. format = 1 # 1=NTSC, 0=PAL
  5. wide = 1 # 1=Widescreen 16:9, 0=Full screen 4:3
  6. #########################
  7. ITU = (format==1?10:12)/11.0*(wide==1?4.0/3:1)
  8. SARs = """"12:11","16:11","10:11","40:33","16:15","64:45","8:9","32:27""""
  9. ITUprof = ""+(wide==1?"ANAMORPHIC ":"")+(format==1?"NTSC":"PAL")
  10. i=import(avsfile).converttorgb
  11. i
  12. ab = round(height*(sqrt(45.0/44)-1))
  13. a = spline36resize(round(width*ITU),height)
  14. a = a.addborders(0,floor(ab/2.0),0,ceil(ab/2.0))
  15. bb = width(a)-round(width*ITU/sqrt(45.0/44))
  16. b = spline36resize(round(width*ITU/sqrt(45.0/44)),height+ab)
  17. b = b.addborders(floor(bb/2.0),0,ceil(bb/2.0),0)
  18. interleave(a,b)
  19. scriptclip("""subtitle("Playback Resolution: "+\
  20. string(round(width(i)*ITU*pow(44.0/45,current_frame%2)))+"x"+string(height(i))+\
  21. "\n"+ITUprof+(current_frame%2==1?" NON-ITU":"")+\
  22. "\nx264 --sar "+eval("select(2*format+wide+current_frame%2*4,"+SARs+")"),lsp=0)""")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement