My idea how to do it goes like this. Lets assume the source to be a DV AVI, 4:3, letterboxed and interlaced.
1. Load the source
2. Separate the fields (You are left with two videos, both 720x288)
3. Crop field one (36px from the top and 36px from the bottom, you are left with a 720x216 video)
4. Crop field two (36px from top and bottom, you are left with 720x216)
5. Resize field one to 720x288
6. Resize field two to 720x288
7. Combine them line by line so it becomes interlaced again.
The result should be a 720x576 image without black borders.
Can someone replace the lines with AviSynth code?
EDIT: I found out that I can create the exact same filter inside VirtualDub.
- open file
- add filter Deinterlace method "Unfold fields side by side"
- add filter Null Transform and crop 36px from top and bottom, result 1440x216
- add filter Resize and scale to 1440x288, mode: Bicubic (or whatever you like)
- add filter Deinterlace once more and choose "Fold side-by-side fields together"
Result is a 720x576 interlaced anamorphic image that you can write to a DVD as a 16:9 video.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 14 of 14
Thread
-
Last edited by Koppel; 12th Aug 2010 at 07:31.
-
Better yet, download and install AvsP, and you will be able to visually create the script yourself.
We aware that doing converting 4:3 to 16:9 this way really only works well if the source was letterboxed 4:3 and you are removing the bars, or the source was actually framed with this cropping in mind during shooting. Otherwise you risk cropping off heads and feet unintentionally. It is akin to a straight centre crop pan and scan, without the scan.Read my blog here.
-
Resizing fields like that should be avoided if possible. It treats scanlines that are not next to each other (they are separated by one scan line) as if they are. Sharp horizontal edges will develop artifacts.
WhateverSource()
SeparateFields()
Crop(0,36,-0,-36) # you may have to adjust the top and bottom crop if the video isn't centered
BicubicResize(720,288) # or your favorite resizer
Weave()
WhateverSource()
Crop(0,72,-0,-72) # you may have to adjust the top and bottom crop if the video isn't centered
Yadif(mode=1, order=0) #25i becomes 50p
BicubicResize(720,576) # or your favorite resizer
SeparateFields()
SelectEvery(4,1,2) #assuming BFF
Weave()
Source (TFF, 720x480 NTSC):
First script:
Second script:
Last edited by jagabo; 12th Aug 2010 at 07:33.
-
Resizing fields like that should be avoided if possible. It treats scanlines that are not next to each other
I was thinking about that, but my results seemed OK.
Is there a way to do it correctly with VirtualDub?
SelectEvery(4,1,2) #assuming BFF
How do I change this to Upper Field First? -
I don't think you can do it in VirtualDub because there's no equivalent to SelectEvery().
Add AssumeTFF() just after opening the source and change SelectEvery(4,1,2) to SelectEvery(4,0,3).
WhateverSource()
AssumeTFF()
Crop(0,72,-0,-72) # you may have to adjust the top and bottom crop if the video isn't centered
Yadif(mode=1, order=0) #25i becomes 50p
BicubicResize(720,576) # or your favorite resizer
SeparateFields()
SelectEvery(4,0,3) # TFF
Weave()Last edited by jagabo; 12th Aug 2010 at 09:57.
-
+ add AssumeTFF() before separate fields, otherwise it will depend on source. A simple rule: SelectEvery(4,0,3) gives the same output field order as just before field separation, SelectEvery(4,1,2) gives inverse order.
-
What does the AssumeTFF() do? Automatically understands the field order of the source?
Is it absolutely clear that it is impossible to recreate the same thing correctly with just VirtualDub? -
It tells AviSynth to treat the video as top field first instead of bottom field first.
I don't know of any way to duplicate the SelectEvery(4,0,3) in VirtualDub. -
In most cases you have to manually adjust your script to actual field order of the source. In current version of the script it's 'order=0', which only works correctly for BFF Yadif input. AssumeTFF before Yadif only changes one thing: Yadif will declare TFF for its output progressive video and that provides the proper order of field separation later. If your input video were TFF, you'd have to use order=1 in Yadif, otherwise it would output frames out of order (with motion phases mixed up) - it would still work, but with BFF in the end of the script.
-
I would like to edit the first post, so that it contains all the correct information and the script, can someone take a look and say if all of this is correct now?
CODE tags put // infront and behind of "C:\Program... - why the hell?
LoadCPlugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
AVISource("filename.avi") #Or DirectShowSource for MPEG files
Crop(0,72,-0,-72) # you may have to adjust the top and bottom crop if the video isn't centered
Yadif(mode=1, order=0) #25i becomes 50p
BicubicResize(720,576) # or your favorite resizer
AssumeTFF()
SeparateFields()
SelectEvery(4,1,2) #assuming BFF
Weave()
Also, how to read the SelectEvery(4,1,2) command. What do the numbers mean?Last edited by Koppel; 13th Aug 2010 at 00:50.
-
Ok, so... SelectEvery(4,1,2) means:
4 - of every 4 fields
1 - select second
2 - select third
The fields are T - top, B - bottom
[T, B, T, B] - four fields
selected ones are upper case
[t, B, T, b][t, B, T, b]
Can someone confirm the script two posts up to be as correct as can be?Last edited by Koppel; 13th Aug 2010 at 03:00.
-
LoadCPlugin("full_path\yadif.dll")# not needed if yadif.dll is in "C:\Program Files\AviSynth 2.5\plugins\" folder
#LoadPlugin("full_path\DGDecode.dll")# for mpeg files; or put it into "C:\Program Files\AviSynth 2.5\plugins" folder
AVISource("filename.avi") # or MPEG2Source("filename.d2v") of DGDecode plugin for MPEG files
Crop(0,72,-0,-72) # you may have to adjust the top and bottom crop if the video isn't centred
Yadif(mode=1, order=0) #25i becomes 50p; use 'order=1' for TFF input video
BicubicResize(720,576) # or your favourite resizer
AssumeTFF()# corresponds to the desired output field order (with 4,0,3 numbers below)
SeparateFields()
SelectEvery(4,0,3)
Weave() -
Similar Threads
-
Avisynth Script for letterboxed mp4 to mpg?
By Robert Simandl in forum Video ConversionReplies: 1Last Post: 16th Sep 2011, 16:57 -
Convert 4:3 letterboxed(16:9 picture inside a 4:3 canvas)to 16:9 Anamorphic
By SatStorm in forum User guidesReplies: 30Last Post: 13th Dec 2010, 09:18 -
converting 4:3 letterboxed avi files to anamorphic?
By jakewoodblues in forum Video ConversionReplies: 7Last Post: 4th May 2010, 23:03 -
How do I get my 16x9 anamorphic clip to play letterboxed on a 4:3 screen?
By buddyreid in forum Newbie / General discussionsReplies: 6Last Post: 26th Sep 2009, 02:14 -
Convert letterboxed widescreen to anamorphic widescreen?
By ziggy1971 in forum Video ConversionReplies: 6Last Post: 7th Mar 2008, 22:15