Log in

View Full Version : 16:9 from 4:3 using same source as background


travolter
13th August 2013, 19:52
http://www.kenstone6.net/fcp_homepage/images_faking_it/10_faking_it.jpg
(Sorry but I didnt find a better image since I dont know the name of this effect)
The central video should be a 4:3 and as background the same stretched video is used.

How can be created with avisynth?

An example script would be appreciated. Im not looking for quality since I plan to use the script realtime.

StainlessS
13th August 2013, 20:09
Got any particular dimensions in mind ?
ie what size source, what dest, what thickness of grey border around inner output clip ?

EDIT: Maybe something like this:


ColorBars() # 640x480@43
OUT_W = 960 OUT_H = 540

OUT169 = Spline36Resize(OUT_W,OUT_H)
OUT169 = OUT169.Blur(1.58,1.58).Blur(1.58,1.58)
OUT169 = OUT169.Levels(0,1.0,255,16+16,235-16)

IN43 = AddBorders(8,8,8,8,$808080)

XX = OUT_W/2-IN43.width/2 XX = Int(XX / 2) * 2 # Coords MOD2
YY = OUT_H/2-IN43.Height/2 YY = Int(YY / 2) * 2
OUT169.Overlay(IN43,x=XX,y=YY)

Robert Martens
13th August 2013, 21:12
My resizing helper script, SimpleSlugUpscale (http://forum.doom9.org/showthread.php?t=153860), offers this as a possibility. I don't know what the effect is properly called, either, I just know it as windowboxing with a blurred background.

With SSU installed, you can just load your clip and call my function like this:
SimpleSlugUpscale(qual="Bob()", size="boxbg", outwidth=1280, outheight=720, \
boxheight=480, boxvideoDAR=4.0/3.0)

The "Bob()" setting ensures you won't suffer the performance hit of QTGMC, or even need to install it in the first place. If you don't need to deinterlace at all, you can replace qual="Bob()" with prog=true to treat your input as progressive.

My documentation needs work, to be sure, and the script itself could use a rewrite, but those settings (which assume NTSC DV, but can be easily altered to suit other footage sizes and shapes) should get you started. Feel free to ask if you need more details, I'm always happy to help!

travolter
13th August 2013, 21:29
Thanks a lot for the fast reply StainlessS!! ;) I tested the script and is working perfectly. Ill try modifying it and do experiments with other resolutions.

@Robert Martens thanks for your help too. Im going to test your script!!

StainlessS
13th August 2013, 21:32
Travolter, I did make several changes to original post, hope you noticed.

travolter
13th August 2013, 23:26
@StainlessS

Got the changes.. thanks pal! ;)

@Robert Martens

Im testing your filter and it is working pretty nice too!!!.
At moment Im playing wit version 1.11 cause ver 1.12 reports me the following problem when using size="boxbg"

"audiodub: need and audio and a video track. Simpleslugresize line 948"


Both solutions are working nice.. Ill do more tests and use the less cpu consuming one ;)

Really big thanks for the fast replies guys :)

StainlessS
14th August 2013, 00:03
did a little bit more:


ColorBars() # 640x480@43, square pixels
#Spline36Resize(480,480) # Test for non-square pixels (Changes FAR and SAR), can comment out

# Below Config
IN_DAR = 4.0/3.0 # Input Display Aspect Ratio
OUT_DAR = 16.0/9.0 # Output Display Aspect Ratio
OUT_H = 540 # Choose output height
BORD_W = 8 # Gray border, left and right
BORD_H = 8 # Gray border, top and bottom
BORD_COL= $808080 # Gray color
MOD_W = 4 # VDubMod may require 4, VDUB current OK with 2
MOD_H = 2
# End Config

OUT_H = Int(OUT_H / MOD_H) * MOD_H # Ensure Mod 2 output height
FAR43 = Float(Width)/Height # Frame Aspect Ratio of input clip
SAR43 = IN_DAR / FAR43 # Sample (pixel) Aspect Ratio of input clip
FAR169= OUT_DAR / SAR43 # Output Frame Aspect Ratio (Input and Output SAR is SAME)
OUT_W = Int((OUT_H * FAR169 + (MOD_W/2)) / MOD_W) * MOD_W
Assert(OUT_H - BORD_H*2 >= Height,"Output Height to small")

OUT169 = Spline36Resize(OUT_W,OUT_H)
OUT169 = OUT169.Levels(0,1.0,255,16+16,235-16)
OUT169 = OUT169.Blur(1.58,1.58).Blur(1.58,1.58)

IN43 = AddBorders(BORD_W,BORD_H,BORD_W,BORD_H,BORD_COL)

XX = OUT_W/2-IN43.width/2 XX = Int(XX / 2) * 2 # Coords MOD2 (dont really matter for overlay)
YY = OUT_H/2-IN43.Height/2 YY = Int(YY / 2) * 2
OUT169.Overlay(IN43,x=XX,y=YY)


EDITED:

Robert Martens
14th August 2013, 01:02
At moment Im playing wit version 1.11 cause ver 1.12 reports me the following problem when using size="boxbg"

"audiodub: need and audio and a video track. Simpleslugresize line 948"

You'd be amazed to know how long ago I stumbled over that bug myself, only to completely forget to fix it. Try downloading the script again, version 1.13 adds a quick check that should take care of clips with no audio. Sorry for the inconvenience!

travolter
15th August 2013, 16:23
@StainlessS
I got the new script and working nicely now ;)

@Robert
problen fixed with the new version ;)