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.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th January 2006, 03:14   #1  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
Need your help with first anamorphic encode

Hi,

I'm encoding my first movie using anamorphic resizing. Howver after reading everything on the forum, I think I'm more confused than ever. So I'm looking for someone to help me out to endode the following movie. I have Red Eye, it's 2:40 Anamorphic, NTSC. I'm using MeGUI, to mkv.

So step 1 go to Tools, AviSynth Script Creator, select my project file.
For Input DAR, I select Custom and do I enter in 2:35?
Check REtain anamorphic resolution and set SAR in Encoder.
AVS Profile just keep at Default?
Click Autocrop, which gives me 60 off the top and 66 off the bottom and 2 off the right.
Go to Output Resolution and select ?? 720?
Resize Filter, not sure what to select here but how about Bicubic Neatrual?
Leave Deinterlace and Noise Filter unchecked.
Mpeg2 Deblocking unchecked.
Do I need Colour Correction checked?

Is that it? I noticed that when I select the Edit tab, it says to "# Set SAR in encoder to 720 : 627"
So now I go to Video and select the AviSynth script, set the output file, set it to mkv.
For Codec set to AVC and here's where I select config and enter in 720:627 for SAR in the Advanced Tab? Is the 627 right?

FYI I usually encode all my movies to about 2GB for a full 2hr movie with the AC3 track.

So do I have this right?
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 17th January 2006, 03:45   #2  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by DigitalDivide
2:40 Anamorphic, NTSC.
...
For Input DAR, I select Custom and do I enter in 2:35?
Do you mean 1:2.35? You aren't allowed to enter : in the custom section.

Quote:
Check REtain anamorphic resolution and set SAR in Encoder.
AVS Profile just keep at Default?
Click Autocrop, which gives me 60 off the top and 66 off the bottom and 2 off the right.
Go to Output Resolution and select ?? 720?
Resize Filter, not sure what to select here but how about Bicubic Neatrual?
Leave Deinterlace and Noise Filter unchecked.
Mpeg2 Deblocking unchecked.
Do I need Colour Correction checked?
A general rule which will get you through quite well: If you don't know whether you should use somethng, leave it at its default value. Anyway, your settings seem fine.

Quote:
So now I go to Video and select the AviSynth script, set the output file, set it to mkv.
For Codec set to AVC and here's where I select config and enter in 720:627 for SAR in the Advanced Tab? Is the 627 right?
Well, if you had checked 'On Save Close and Load to be encoded' in the AviSynth window, you shouldn't have needed to do this. But yes, your settings are right here, as well.

Quote:
So do I have this right?
Yes. But just to make sure, why don't you encode a small sample and see whether it is right. To encode just a little bit, add
Code:
trim(0,5000)
to the end of your AviSynth script. You can change the numbers to whatever you want, of course, but the first number is the starting frame number, and the second number is the finishing number.
berrinam is offline   Reply With Quote
Old 17th January 2006, 04:02   #3  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
Thanks good to know I have the process down. When I select custom, the 2:35 shows in the box automically. So I guess that's right.

Just curious can I trust the Edit page where it suggests to use
"# Set SAR in encoder to 720 : 627"? Is it usually right?

Also if my movie is 1:85:1 aspect ratio what do I select in the Input DAR, simply 16:9?
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 17th January 2006, 04:15   #4  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by DigitalDivide
Just curious can I trust the Edit page where it suggests to use
"# Set SAR in encoder to 720 : 627"? Is it usually right?
Would it be in MeGUI if it wasn't usually right?
berrinam is offline   Reply With Quote
Old 17th January 2006, 04:25   #5  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
Quote:
Would it be in MeGUI if it wasn't usually right?
lol just checking...the reason I ask is because I read so many posts about what to select which seemed kinda odd to me to worry about it if MeGUI already suggests the size.

Anyhow thanks for the input! Much appreciated.
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 17th January 2006, 05:32   #6  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by DigitalDivide
lol just checking...the reason I ask is because I read so many posts about what to select which seemed kinda odd to me to worry about it if MeGUI already suggests the size.
Yes, it is odd.

Quote:
Anyhow thanks for the input! Much appreciated.
It's ok. Maybe you could even give something back by writing a guide based on your findings
berrinam is offline   Reply With Quote
Old 18th January 2006, 01:23   #7  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
Quote:
I explain it here: you take the resolution after cropping (in your case 718/354 (2.028)), you take the DAR of 1.77 of the original and the AR (1.5) and make the following calculus:
718/354(2.028).........x
720/480(1.5).....1.7777
and you get x. You multiply x with the height resolution and get 850/354 wich keeps the DAR and doesn't lose res by resizing.
Okay you lost me here. I can see 718/354 = 2.028 and 720/480 = 1.5. The 1.777 I understand but when you say I get X and I should mulitply it with the height resolution and get 850/354 you lost me. As far as I can see I don't know what X... and I don't know what I'm muliplying it with to get 850/354....I feel dumb but honestly I don't see it...
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 18th January 2006, 11:16   #8  |  Link
Daodan
unrecognized user
 
Join Date: Oct 2005
Location: home of Stella Artois
Posts: 303
Quote:
Originally Posted by DigitalDivide
Okay you lost me here. I can see 718/354 = 2.028 and 720/480 = 1.5. The 1.777 I understand but when you say I get X and I should mulitply it with the height resolution and get 850/354 you lost me. As far as I can see I don't know what X... and I don't know what I'm muliplying it with to get 850/354....I feel dumb but honestly I don't see it...
That X is the display aspect ratio of your encoded movie (2.4 in your case). You should be able to see an increase in the image quality (if you use a high enough bitrate, otherwise that extra resolution will only lead to blocking). At least in PAL dvds the difference is very clear (but here the loss of height resolution is much bigger at resizing than in the case of NTSC). Of course this anamorphic thing was made mostly for widescreens but in the case of monitors the resolution is big enough to take advantege of this even if they aren't widescreen.

Quote:
Originally Posted by lenouch
Ok. So, I have to enter SAR=8960:6480 in meGui.

1) From a technical point-of-view, is SAR just a flag in the encoded stream or is there an internal resize in x264 before encoding ?

2) In this case (SAR=8960:6480), what is the value I have to enter as DAR ? 16:9 again, or 1:1 because AR is "managed" in x264 stream ?
Yes, it's just a flag, otherwise this hole anamorphic thing would be almost pointless. Let's say you have a PAL dvd with no borders in 16:9. To keep the hole details you should resize to the enourmous size of 1020/576 wich would take a lot to encode and a lot to decode. In case of anamorphic the decoded resolution is 720/576.
For question number 2 I'm not sure what you mean, you use either SAR OR DAR because they are related (height/width=SAR/DAR). (As I said before, it's less confusing if you just enter the DAR in matroska muxer after making an encode without resizing).
__________________
zzz
Daodan is offline   Reply With Quote
Old 18th January 2006, 03:13   #9  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
Quote:
It sounds like you are missing Undot.dll in your AviSynth plugins directory. You should take Undot.dll (located in C:\program files\gordianknot\avisynthplugins\undot.dll) and put it in the avisynth plugins dir (normally c:\program files\avisynth\plugins\)
Tried that but it gave me the same error. The only way I was able to get it was to create an AVS file from Gordian Knot, then modify the file. That works.

However I noticed the following locations for the file.
C:\Program Files\X264
C:\program files\avisynth 2.5\plugins
C:\program files\gordianknot\avisynthplugins
c:\program files\godianknot\dgmpgdec
Not really sure which I should be using but I tried putting the settings to c:\program files\avisynth 2.5\plugins and it still didn't work.
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 18th January 2006, 03:24   #10  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Ok, here's the standard thing you do when an avisynth script doesn't load: open it with VirtualDubMod. It will tell you what the error is (almost all of the time), and then you can go about remedying it. I was just making a guess, but it seems it didn't work.
berrinam is offline   Reply With Quote
Old 18th January 2006, 04:26   #11  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
Okay figured out the error. I had two project files and it was looking for the wrong one.

I fnished encoding a small test. To be honest I don't see any difference between it using the SAR and the same movie I encoded without the SAR. Should I be able to see a difference?
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 18th January 2006, 11:47   #12  |  Link
lenouch
Registered User
 
Join Date: Dec 2003
Posts: 15
Thanks, it's more clear for me

In my case, anamorphic resolution is 720x576 => DAR is (576x16)/(720x9) = 9216/6480 = 64/45 = 1.422

Then, according to your last sentence, it's not necessary to modify SAR in x264 encoding (keep 1:1), but I have to set 64/45 (in mkvmerge. Fine ?

In this case, decoder will decode my movie as 720x576, but will stretch it to display as (720*1.422) x 576 = 1024 x 576. Is that right ?

Last edited by lenouch; 18th January 2006 at 11:50.
lenouch is offline   Reply With Quote
Old 18th January 2006, 12:56   #13  |  Link
Daodan
unrecognized user
 
Join Date: Oct 2005
Location: home of Stella Artois
Posts: 303
Hmm, it looks right but it's somehow wrong. Let's try and keep it simple, lets' forget about SAR and use only DAR.
So you don't have any cropping so in your case is simple, you know that your final image should be 16:9 (1.77). Just multiply this to the height res and you get 1020. So put 1024/576 in mkvmerge and that's it. If you put that 1.42 the image will be too vertically stretched. (1.42 is multiplied with the vertical resolution not the horizontal one).
__________________
zzz
Daodan is offline   Reply With Quote
Old 19th January 2006, 00:35   #14  |  Link
Benedikt
Registered User
 
Join Date: Oct 2005
Posts: 20
Quote:
Originally Posted by Daodan
Hmm, it looks right but it's somehow wrong. Let's try and keep it simple, lets' forget about SAR and use only DAR.
So you don't have any cropping so in your case is simple, you know that your final image should be 16:9 (1.77). Just multiply this to the height res and you get 1020. So put 1024/576 in mkvmerge and that's it. If you put that 1.42 the image will be too vertically stretched. (1.42 is multiplied with the vertical resolution not the horizontal one).
What about just setting an aspect ratio of 16/9 in Matroska (mkvmerge)? At least that's what I'm doing and it works just fine! Isn't that easier?
Benedikt is offline   Reply With Quote
Old 19th January 2006, 11:06   #15  |  Link
Daodan
unrecognized user
 
Join Date: Oct 2005
Location: home of Stella Artois
Posts: 303
Well, now that you mention it, it is. I guess it's just a habit, since usually one has also to crop you have to recalculate the new resolution, so in that case it's easier to use the resolution.
__________________
zzz
Daodan is offline   Reply With Quote
Old 22nd January 2006, 18:11   #16  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
Quote:
DigitalDivide, try using the following script (based on the crop settings you got from megui):

# PLUGINS
LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\DGDecode.dll")

# SOURCE
mpeg2source("D:\Projects\Red Eye.d2v")

# CROPPING
crop(0,60,-2,-66)

Encode this in megui (of course you can add other filters for denoising or smoothing like undot if you want) and save as mkv or mp4. Than after the encoding is finished open the file with mkvmergeGUI, select the video stream and at display width/height put 850/354 and remux under a different name.
I usually use this method because I get confused with those settings in megui. In case you don't understand how I got that aspect ratio, I explain it here: you take the resolution after cropping (in your case 718/354 (2.028)), you take the DAR of 1.77 of the original and the AR (1.5) and make the following calculus:
718/354(2.028).........x
720/480(1.5).....1.7777
and you get x. You multiply x with the height resolution and get 850/354 wich keeps the DAR and doesn't lose res by resizing. I hope I was clear (when I read it it confuses me). The resize settings in megui have no importance since you don't resize, that's the point of anamorphic display.
And one last advice: after the autocrop in megui or gknot you should crop a bit yourself to make the resulting height/width both multiples of 16. It helps compression (but don't leave any black borders).
__________________
I also tried the method above but obviously using different numbers for the new movie. Same problem I don't get a clear picture. So what am I doing wrong?
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 23rd January 2006, 12:39   #17  |  Link
Daodan
unrecognized user
 
Join Date: Oct 2005
Location: home of Stella Artois
Posts: 303
Hard to say what the problem is. Use ChopperXp to cut a little part of your vob and use the following script:

LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\Undot.dll")mpeg2source("D:\something.d2v")
Undot()
# CROPPING
crop(8,64,-8,-64)

Without anything else (like resize). And than remux in mkvmerge using for video : 830/352. As I said before, it's best to have after cropping res that multiply by 16, but not that big. Anyway, try this and in case it turns bad also, upload somewhere the test vob and also the encoded results. (www.savefile.com lets you upload files smaller than 50 mb).
__________________
zzz
Daodan is offline   Reply With Quote
Old 24th January 2006, 23:49   #18  |  Link
iceborne
Registered User
 
iceborne's Avatar
 
Join Date: Aug 2003
Posts: 43
Quote:
Originally Posted by Daodan
Hard to say what the problem is. Use ChopperXp to cut a little part of your vob and use the following script:

LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\Undot.dll")mpeg2source("D:\something.d2v")
Undot()
# CROPPING
crop(8,64,-8,-64)

Without anything else (like resize). And than remux in mkvmerge using for video : 830/352. As I said before, it's best to have after cropping res that multiply by 16, but not that big. Anyway, try this and in case it turns bad also, upload somewhere the test vob and also the encoded results. (www.savefile.com lets you upload files smaller than 50 mb).
so basically you're saying encode the video source in 1:1 dar then tell mkvmerge to output the file at 16:9?
iceborne is offline   Reply With Quote
Old 25th January 2006, 05:36   #19  |  Link
DigitalDivide
Registered User
 
Join Date: Jul 2005
Posts: 240
I see it mentioned that resizing is not needed when doing anamorphic encodes, and yet when using MeGUI to create an avi script for anamorphic encodes, it does put in a LancosResize(x,y). Should this be removed or does MeGUI just ignore this?

I'm a little confused which DAR to select in MeGUI for the following
1.85 anamorphic - I'm assuming I should just select 16:9?
2:35 anamorphic - select custom and enter in 2:35
2:40 anamorphic - select custom and enter in 2:40
1.78 anamorphic - select custom and enter in 1:78
Fullscreen 4:3 movie ??
__________________
Toronto,ON
DigitalDivide is offline   Reply With Quote
Old 25th January 2006, 11:30   #20  |  Link
Daodan
unrecognized user
 
Join Date: Oct 2005
Location: home of Stella Artois
Posts: 303
Quote:
Originally Posted by iceborne
so basically you're saying encode the video source in 1:1 dar then tell mkvmerge to output the file at 16:9?
Yes, that's almost what I'm saying, only in his case is not 16/9 anymore because he needed to crop the black borders, so 2.35.
DigitalDivide, the input DAR should be 16:9 in your case (so what the original dvd looks like, what dgindex tells you). So if you really don't want to use my method with mkvmerge but want to use SAR in x264, fine, this is what you should do: delete the resize from that avs, I'm not sure that megui afterwards will ignore it, I don't see any reason why, that resize will already give you the normal aspect ratio, so if you change also the SAR, it will look too flattened. So after you cut that line, load the avs, in x264 config put in sample aspect ratio 1.175:1. Now encode. Unfortunately I'm not able at the moment to test this (I never used this sar thing in x264, but always dar in mmg) but it should work.
__________________
zzz
Daodan is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:33.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.