Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
5th December 2009, 07:13 | #1 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
DVD function, automaticaly add borders and resize
Hi, I don't know if a function like that already exists but I wrote a small one which automaticaly adds borders and resizes to matche with dvd resolutions to feed your mpeg2 encoder or dvd rebuilder. I also added an option ('care' Correct Aspect Ratio Estimation) if the input has not the correct aspect ratio, just set it to have only one resizing in the script.
LAST UPDATE (v0.3a) : http://forum.doom9.org/attachment.ph...1&d=1261000196
__________________
We are spitting food to these hungry eyes. You see they ask, we know they are greedy of our rot. Better than to give jam to pigs. x264 r2146 MOD Last edited by MatLz; 27th November 2011 at 23:10. |
9th December 2009, 13:09 | #2 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
Already 35 downloads and no bug report? Nice!
Update: *Change lanczos4resize to spline16resize to limit halos artifacts *Add 'hq' mode using nnedi2 upscaling. Particulary usefull for low resolution sources, specialy on animes: [img=http://img187.imageshack.us/img187/893/00000j.th.jpg] Here it is:
__________________
We are spitting food to these hungry eyes. You see they ask, we know they are greedy of our rot. Better than to give jam to pigs. x264 r2146 MOD Last edited by MatLz; 11th December 2009 at 10:32. |
9th December 2009, 13:13 | #3 | Link |
HDConvertToX author
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
|
since script is very small post it as with CODE tag
BHH
__________________
HDConvertToX: your tool for BD backup MultiX264: The quick gui for x264 AutoMen: The Mencoder GUI AutoWebM: supporting WebM/VP8 |
9th December 2009, 13:20 | #4 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
I can't write more 500 or 502 bytes in posts, I'm on a crappy phone!
Edit: After PMing myself, it appears my limit is 515 bytes. Good to know.
__________________
We are spitting food to these hungry eyes. You see they ask, we know they are greedy of our rot. Better than to give jam to pigs. x264 r2146 MOD Last edited by MatLz; 9th December 2009 at 14:56. Reason: Now, I know |
9th December 2009, 16:23 | #5 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,532
|
A very handy little function, but it (first version anyway) doesn't incorporate overscan (edit: sorry, not overscan; nominal analogue blanking). It should scale up to a target of 702x576 (PAL) or 704x480 (NTSC) [these dimensions define the 4:3/16:9 box], then addborders to 720 (or 704, which is also legal for DVD).
David Last edited by wonkey_monkey; 9th December 2009 at 16:37. |
9th December 2009, 19:38 | #6 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
Urrrh
99% of dvd I've see hadn't these lateral borders... If someone else ask for, I will include that as an option. But that maybe means too much difficulties to code for my tiny brain! Thx for the info. |
9th December 2009, 21:44 | #7 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
Here it is maybe with 'nominal analogue blanking'...I repeat: maybe...
__________________
We are spitting food to these hungry eyes. You see they ask, we know they are greedy of our rot. Better than to give jam to pigs. x264 r2146 MOD Last edited by MatLz; 16th December 2009 at 22:59. Reason: Previous post deleted |
11th December 2009, 13:00 | #8 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
As I said, and as expected, my previous code seems to be wrong...
I'm a little lost. And in some cases, it's a real nonsense to use nominal analogue blanking: *letterboxing when input aspect ratio is less (there is a proportionnality to calculate) than the output aspect ratio, because we lost height's pixels for nothing... Examples: 1.2 in 4/3, 1.6 in 16/9.... New attempt: |
11th December 2009, 14:26 | #9 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,532
|
Quote:
Just think of the 720x576 box as having an aspect ratio of either ~16.4:9 or ~4.1r:3 rather than 16:9 or 4:3. The result would be the same as if you'd applied your original script, then scaled down to 704 width (or 702 for PAL) and added borders back to 720. The image's height would be the same. Of course this all assumes that the video was scaled down correctly in the first place, which may not be the case... David |
|
11th December 2009, 20:50 | #10 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
Well...I don't understand a lot...english is not my native language and it's too much technical...
And you can't see the new code...the attachments aren't approved...it's long very long... See you later. |
12th December 2009, 10:55 | #11 | Link |
Registered User
Join Date: Apr 2008
Location: St. Petersburg, Russia
Posts: 337
|
In other words, if you use the final horizontal size 720 (rather than 704), the planned (for DVD) height of a 4:3 or 16:9 image must be first adjusted in 720/704 proportion, then in case of anamorphic - cropped to 480 or 576, in case of letterboxed - rounded to a multiple of 16/8/4 (with addition of horizontal borders).
That is because the standard DV/DVD AR's are defined for the limited area of 704x576(480) within 720x576(480). |
16th December 2009, 22:52 | #12 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
Thanks, really big thanks for all the explanations guys...but...
dvd 0.3a Total reversion of the process order so new calculations of the ratios: *Depending of the input and the output AR, there is a huge speedup compared to other versions (50% with 2.5:1 in 16/9, 100% in 4/3 !!!) *Better quality near the added borders (this "kindofsubsamplingartifact" isn't present anymore) *Maybe Nominal Analogue Blanking at least right coded?? |
18th February 2010, 14:38 | #14 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
Just put the avsi in the Avisynth plugins directory and call the function in your script.
You can simply use: dvd() for outputing pal 16/9. If you need other standard, format, quality or the nominal analogue blanking, just write your settings in the (). |
19th February 2010, 02:33 | #15 | Link |
Registered User
Join Date: Jul 2009
Posts: 9
|
MatLz, thanks, but I am new in scripting and I am only used to the most common scripts of AVIsynth. How do I call your script?
The way I encode is that I create a simple AVIsynth script and open with CCE and start encoding. How do I work with this? Can you help me? |
19th February 2010, 03:03 | #16 | Link |
I often say "maybe"...
Join Date: Jul 2009
Location: France
Posts: 583
|
Ok....download the attachement dvd_0.3a.avsi.txt. Rename this txt file in .avsi and put it in the Avisynth plugin directory.
And post your script and tell me the specs you want : if you want pal or ntsc, 16/9 or 4/3, if you need the nominal analogue blanking Like that I will give you the last line of your script. |
20th February 2010, 15:46 | #17 | Link |
Registered User
Join Date: Jul 2009
Posts: 9
|
This is the script I have, its an NTSC 23.976fps clip. Im looking for a 4:3. I don't need the black borders on the left or right (nab).
AVISource("H:\FUN\NEWYEARS2010\BASH.avi",FALSE) LanczosResize(720,360,0,0,640,352) AddBorders(0,56,0,64) ConvertToYUY2() |
20th February 2010, 20:55 | #20 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,532
|
Quote:
Code:
addborders(0,60,0,60) |
|
Tags |
dar, dvd, ntsc, pal, par |
Thread Tools | Search this Thread |
Display Modes | |
|
|