Best way to convert form Widescreen to Television Format?

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
OtakuForLife
Joined: Wed Sep 25, 2002 3:37 pm
Status: In relationship
Location: Endsvill (North Providence, RI , USA)
Org Profile

Best way to convert form Widescreen to Television Format?

Post by OtakuForLife » Sun May 30, 2010 9:44 am

I was thinking of using avisynth for this, anyone know a good script for this purpose?
Much thanks in advance :)

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by Qyot27 » Sun May 30, 2010 10:10 pm

To do it right, there isn't a one-size-fits-all solution. You have to judge by eye the section you want to retain.

Theoretically, it's just (assuming that you're talking about 848x480 here, not 720x480 with 16:9 flags, or non-16:9 ratios that have been letterboxed, like 2.39:1*¹):
Crop(104,0,-104,0)

But like I said, the best way is to make sure you adjust for the action in the frame, which means the above values for cropping the left and right sides are probably not the 'correct' ones to use. The way to determine what are the right values is to open the video in VirtualDub*² and crop a total of 208 pixels on the horizontal (x) values, so you end up with a video that's 640x480 (new versions of VDub actually tell you what size the resulting video will be inside the Crop dialog, so you can make sure everything's ok). Then just plug the crop values you got in VDub into the Crop() command in the script.

*¹ If you need to convert 2.39:1 to 4:3, then you first have to crop out the borders and resize (or just resize, if the source is already cropped) proportionally to a height of 480. Then crop however much is needed - such as 256 pixels on either side (2.39:1 is roughly 1152x480, given mod16) - to get a result of 640x480.

If you don't want to lose any action at all, meaning you want to letterbox, then the solution is (assuming regular 16:9 content, not 2.39:1 or other wide aspect ratios):
*method*Resize(640,352)
AddBorders(0,64,0,64)

where *method* is the preferred resizer: Bilinear, Bicubic, Lanczos, Spline, etc.

*² Go to Filters and add Null Transform, then click the Cropping button. Pure cropping is pretty much the entire reason for Null Transform anyway. If you need to open something other than AVI, make sure you're using VirtualDub 1.9.9 and have the MPEG2, WMV, and DirectShow vdplugins in the plugins32 folder in VDub's directory. If plugins32 doesn't exist, create it yourself and then place the .vdplugin files in it.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

User avatar
Phantasmagoriat
Joined: Mon Feb 06, 2006 11:26 pm
Status: ☁SteamPunked≈☂
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by Phantasmagoriat » Sun May 30, 2010 10:47 pm

Qyot27 wrote:there isn't a one-size-fits-all solution
There just might be ...soon... :uhoh:
Though you'll still have to decide if you want to "resize," "crop," or "addborders."
PLAY FREEDOOM!! | Phan Picks! | THE424SHOW | YouTube | "Painkiller" | Vanilla MIDI's
"Effort to Understand; Effort to be Understood; to See through Different Eyes."

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by Mister Hatt » Mon May 31, 2010 1:15 am

>implying x264 will take over the encoding world

User avatar
OtakuForLife
Joined: Wed Sep 25, 2002 3:37 pm
Status: In relationship
Location: Endsvill (North Providence, RI , USA)
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by OtakuForLife » Wed Jun 02, 2010 8:41 am

Thanks for the info, all I have to do now is add that code to the Dv2 files and it all works out :)

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by mirkosp » Wed Jun 02, 2010 1:22 pm

OtakuForLife wrote:Thanks for the info, all I have to do now is add that code to the Dv2 files and it all works out :)
You add those in the avs not in the d2v. Normally you don't really touch the code of the d2v (unless it's something small and you know what you're doing).
Image

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by Mister Hatt » Thu Jun 03, 2010 9:03 am

mirkosp wrote:Normally you don't really touch the code of the d2v (unless it's something small and you know what you're doing).
To clarify: no, you do not know what you are doing, so don't even try; that goes to pretty much everyone here. I don't think there are more than a handful of people globally who actually know the ins and outs of a d2v file properly, even I barely understand it.

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by mirkosp » Thu Jun 03, 2010 9:18 am

Mister Hatt wrote:
mirkosp wrote:Normally you don't really touch the code of the d2v (unless it's something small and you know what you're doing).
To clarify: no, you do not know what you are doing, so don't even try; that goes to pretty much everyone here. I don't think there are more than a handful of people globally who actually know the ins and outs of a d2v file properly, even I barely understand it.
I was more referring to the beginning bit which holds framerate/aspect ratio/field operation/etc info. Sometimes I touch a couple of those when I want to change a d2v from honor pulldown to forced film without having to reindex the whole thing. :roll:
Image

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by Scintilla » Thu Jun 03, 2010 5:14 pm

mirkosp wrote:
Mister Hatt wrote:
mirkosp wrote:Normally you don't really touch the code of the d2v (unless it's something small and you know what you're doing).
To clarify: no, you do not know what you are doing, so don't even try; that goes to pretty much everyone here. I don't think there are more than a handful of people globally who actually know the ins and outs of a d2v file properly, even I barely understand it.
I was more referring to the beginning bit which holds framerate/aspect ratio/field operation/etc info. Sometimes I touch a couple of those when I want to change a d2v from honor pulldown to forced film without having to reindex the whole thing. :roll:
To give an even simpler example, I edit D2V files all the time when the VOBs they refer to have been moved from one partition on my computer to another. It's just changing one letter and they work fine afterwards.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Best way to convert form Widescreen to Television Format?

Post by Mister Hatt » Thu Jun 03, 2010 10:51 pm

I thought as much, although I use relative paths so it's not as much a problem here. For some reason I thought you guys meant the main part of the d2v >.>

Locked

Return to “AviSynth Help”