View Full Version : Anamorphic or not Anamorphic
PuzZLeR
6th May 2007, 00:37
What are the true advantages of going anamorphic? This is new to me since I used to encode in DivX where it wasn't supported (due to AVI's square pixel assumption).
For example, if you have content that is MPEG-2, 4:3, 720x480, two possible encoding choices are:
a) Encode at 640x480 with PAR 1:1.
b) Encode anamorphic and produce 720x480 with PAR 8:9.
Neither is distorted. Both seem to look similar in quality. However b) has about 12%-13% more pixels and needs 12%-13% more bitrate as well for the same quality.
Encoding with a) has better compatibility with QT and iPods, but that's not really my long-term interest for archiving video.
However b) seems more "natural" to the source. As well, BD/HD-DvD support 720x480 AVC if I want to better "future-proof" my clips. Is the extra bitrate/file size worth it?
I am clueless which I should use. Am I missing something?
Thanks in advance!
[P]ako
6th May 2007, 03:02
If I were you, I would encode them at 848x480. As for your question about whether the extra bitrate/file size is worth, my answer is yes, quality comes to a price: larger files.
PuzZLeR
6th May 2007, 04:17
Hi, thanks for the reply.
Yes, bigger screen, more pixels, better quality, bigger file.
But why 848 width from a 720 width source? What benefit would that serve?
[P]ako
6th May 2007, 04:37
Oops, sorry, I missed the fact you are working with 4:3 material. I gather your source is fullscreen, since your are encoding at 640x480. If so, I would be encoding at 720x544. Why? First, it is mod16, second, when you go 640x480 you are losing "data". When the AR is supposed to be 4:3, the DVD player keeps the horizontal and changes the vertical to 540. So, if you go from 720 to 640 horizontal, you really are discarding data.
galaxy001
6th May 2007, 09:30
When you play the video at fullscreen, usually, it will be upsampled to 1024x768, no matter whether it is Anamorphic or not Anamorphic.
So, if there is always a upsample , I don't think 848x480 will be better than 720x480.
I know Lacus3 is better that what the directshow filter done, but you will always use directshow filter to get a fullscreen size. Can the benefit be kept during the 848-to-1024 upsampling ?
Awatef
6th May 2007, 12:25
@ puzz
We're talking here about very little difference of only 10% (I think you probably have to crop to 704 anyway). It shouldn't make a noticeable difference in quality using the same bitrate.
Since we're using x264 here, I'll go for anamorphic, unless the bitrate is very limited (less than 1 mbit/s), in which case I would even think about going even lower than 640x480!
PS: IMHO, upsizing is not an option, the offline resizers may be of better quality, but you will have to target a resolution one way or another, and you'll definitely bump up on a screen with a different resolution, so better don't go beyond the original resolution.
if i were to use anamorphic i would not resize the source at all, but only crop the black bars to a mod 16 resolution
that is, if your cpu is able to decode such a stream in realtime of course
PuzZLeR
6th May 2007, 20:20
Thanks for the insight!
I'm now leaning more towards anamorphic. As of this writing, we are just at the time of the release of the first TB drives, so the extra 12% shouldn't make a big difference.
However, lots was mentioned about cropping, black bars, sizing, etc.
What kind of apps do this?
What I'd really like to know is of apps which can change a clip from square pixels to anamorphic or vice versa, whichever is possible (not talking playback, talking about actually changing the DAR/PAR/etc.).
If there's one that does it without re-encoding (with a batch feature as a bonus) that would be grand.
Thanks again for the input.
legoman666
6th May 2007, 21:40
VLC can change the cropping and aspect ratio during playback very easily. It's nice for sources whose aspect ratio is wrong or have hard coded black bars.
PuzZLeR
7th May 2007, 01:02
Yes, I'm sure no matter how "wrong" a resolution, or PAR can be, some decoders can "fix" it with certain settings.
However, is there a way to do this to the actual video itself before playback?
For example is there any way to change a 640x480 PAR 1:1 to 720x480 PAR 8:9, or vice versa without re-encoding? Sure there may be lossiness if such an app exists that does that, but certainly not as much as re-encoding.
The reason I ask is that I currently have some older clips from years ago, with "bad settings" that I want to change without having to rely on a decoder setting or having to re-encode them again.
Actually, my initial reason for this thread was to "future-proof" my vidz as best as possible, but wasn't the case a few years ago when I chose some wrong options.
akupenguin
7th May 2007, 01:41
is there any way to change a 640x480 PAR 1:1 to 720x480 PAR 8:9, or vice versa without re-encoding?
To rephrase that question, "is there any way to re-encode a video without re-encoding?". That makes no more sense than other questions such as "can I change the bitrate without re-encoding", or "can I scale/filter/etc without re-encoding".
Anyway, how is PAR a "decoder setting"? It's part of the video stream. Sure, there are a few decoders out there that ignore PAR, but that just means they're not correctly decoding the video.
PuzZLeR
7th May 2007, 06:16
Is there any way I can improve the quality of a VCD clip to HD level without re-encoding?
Just kidding....
Thanks for your answer akupenguin. I knew it was a long-shot anyhow but I threw it out there "just in case". I figured there may be a way to mux it into another format, but it's probably silly thinking anyhow.
...still leaning towards anamorphic if anybody's got other opinions on it...
Awatef
7th May 2007, 12:23
@ puzz
About your older encodings with bad settings: you can re-pack your old AVI files in MKV using mkvmerge, which enables you to force a specific aspect ratio. This is especially useful if you -for example- ripped a 16:9 DVD in 720x480. Here you specify 16:9 in mkvmerge and you're done ;)
SpAwN_gUy
8th May 2007, 08:27
I'm sorry to bother,.. but... i'm also confused...
for like 3 years i'm making scripts with GKnot (and i do love it.. i think..).
and i'm kinda confused with anamorphic encodings..
okay, what do i have now..
if i encode anamorphic, so Video should be less or equal then the original vidoe on the DVD.. (720x480 for 16:9(i have now..) and.. the same for 4:3).. so then.. i should crop blackbars and mod16 to encode,... right?
and for non anamorphic:
GKnot suggests (for 16:9) something near 720x400 and for 4:3 - 720x544... (or less then 100% of original video size)..
but WHY [P]ako suggests 848x480 for 16:9 and 720x544 for 4:3(just found that it is the same with GKnot.. hehe)..
so my question is WHY 848???? for non anamorphic?
and why when encoded anamorphic with video size 704x480 MPC plays me 853x480 ?? .... should i be encoding non anamorphic at that resolution?
foxyshadis
8th May 2007, 09:09
Because he's suggesting a pure upsize-only method, in order to eliminate any possible loss of detail and also compensate for typical bilinear resizing on playback. The cost of this is that if you provide the same bitrate that would look great at a lower resolution, you end up with significantly worse artifacts than a small loss of detail, so you need to create a much larger video. It helps to do a compressibility check to determine how much upsizing instead of downsizing or some mix will cost you.
On playback, 853x480 is just a size made with the default method of expanding the horizontal. There's only ever one resize from source->screen, you shouldn't worry about double-resizing in fullscreen.
[P]ako
8th May 2007, 17:50
Because 848 is mod16.
PuzZLeR
9th May 2007, 04:55
Sorry to picky, but the expression for a number x "is mod 16" is as wrong as saying "5 is plus 1 and 6" for "5+1=6".
The correct expression is "x mod 16 = 0", meaning the remainder is 0 when you divide x by 16.
Ok, smarta$$ time is over.
I have since figured out how to change the PAR within an .mkv (with MKVMerge->Format specific options) and also an .mp4 (with mp4box command line). Thanks to the posts, some muxing and more mathematics, I have "un-wronged" my previous older clips without re-encoding. They now play great!
BTW - I have two questions.
Is there any way I can put a 640x480 clip within an "all-black" 720x480 clip, such as on a black canvas, with the result being a clip within the black bars at the sides? Or can I mat a 640x480 clip with adding black bars each side? (I can then play with the PAR value to adjust if necessary.)
As well, I'd love to know people's opinion on this. Do you think that when the AVC stand-alones come out sometime, will they support anamorphic clips? I think they should, and the only reason it wasn't supported with DivX was because of the AVI container, but it still makes me wonder.
[P]ako
9th May 2007, 05:58
Why would you want to have the black bars back? They are a waste of bitrate.
PuzZLeR
9th May 2007, 07:27
Mostly just curious how this is done.
I do make DvDs out of some of my AVC 640x480 stuff for certain occasions and sometimes the clip doesn't fit the way I like it on-screen and I just want to try black bars to see if that will improve the situation.
Yes it would be a waste of bitrate with the clips on their own, but when burning on a DvD(RW), it doesn't really matter when you sometimes have extra room on the disc that would have been empty otherwise after finalizing it.
Maybe it's my software instead or even the player itself.
Dr.Khron
9th May 2007, 12:10
I think we need a sticky on this... Maybe not in this specific forum, but cropping/resizeing is a topic that lots of people have difficulty with.
And some of it is open to debate too.
[P]ako
9th May 2007, 15:59
@PuzZLeR. Avisynth has an internal filter to add borders:
http://avisynth.org/mediawiki/AddBorders
PuzZLeR
9th May 2007, 17:30
I think we need a sticky on this... Maybe not in this specific forum, but cropping/resizeing is a topic that lots of people have difficulty with.
And some of it is open to debate too.
Agreed.
I find even the most experienced digital video enthusiasts and video encoders have trouble with this concept.
Awatef
10th May 2007, 11:41
Experienced encoders don't have any difficulty with this. This is basic math! Doom9 has guides on this anyway.
Kuukunen
10th May 2007, 13:22
One thing that has been sort of bothering me is the term "anamorphic". When talking about anamorphic video I've understood it usually (always?) means when you have widescreen material scaled as 4:3. In the case of DVD, when you you watch it, the TV/whatever will scale it to 16:9, or if the TV can't do it, the DVD-player will drop the scanlines (and add letterbox?) to get the right aspect ratio.
I understand the word "anamorphic" means "pertaining to a kind of distorting optical system", so referring to non-square (rectangular?) pixels as anamorphic would be ok in theory, but whenever I've seen the term used when talking about video, it's used in a sense I described earlier. Neither PAL nor NTSC has PAR of 1:1, but I can't say I remember ever seeing the word "anamorphic" having been used to describe them.
Or am I wrong?
Sorry to picky, but the expression for a number x "is mod 16" is as wrong as saying "5 is plus 1 and 6" for "5+1=6".
The correct expression is "x mod 16 = 0", meaning the remainder is 0 when you divide x by 16.
Woo, more nitpicking, if you want to be a smartass, I want to be one too. When talking about mathematics, the correct way would be "x ≡ 0 (mod 16)". Or, "x is congruent to 0 modulo 16". (I hope it shows properly for you.)
In computer languages, there is usually a remainder operator, because for programming, it's often very convenient. So if you consider it as some sort of pseudocode, I guess it works, but usually people don't nitpick on pseudocode, so I assume you're talking about in the sense of theoretical mathematics.
When I read "x mod 16 = 0", of course I know what you mean. And I guess in some occasions that can be considered right mathematically too since the mathematical notation isn't all strictly defined, for example some math books have different notation. But usually they explain it beforehand. Still I'd put it under "works well enough", and normally wouldn't care, but when talking about video, "x is mod 16" works well enough too, so I thought I'd bring up this point. Naturally I could be wrong here too.
Awatef
10th May 2007, 15:27
@kuuk.
As long as we're talking DVDs, only videos w/ 16:9 AR are considered anamorphic.
But when we talk MPEG-4, everything that is not encoded in the proper AR is considered anamorphic ;)
PuzZLeR
10th May 2007, 16:50
@[P]ako
Thanks for the tip. I'm now experimenting with borders if I need to change size.
@Kuukunen:
It's really a matter of notation relative to reference. All expressions are correct: "x mod 16 = 0" and "x ≡ 0 (mod 16)" and "x is congruent to 0 modulo 16" as long as they are defined from source. You can even call it "x and 16 are mod 0 dude" if you define context beforehand as such.
I guess where I should have made my point was that "x is mod 16" was incomplete. Without the "0" it simply does not make sense theoretically (although most would know what you're talking about).
@Awatef:
I think you cleared alot of confusion in your last post. (And I thank you for your previous helpful ones too.) It was a definition thing really.
"Anamorphic" has never been used for 4:3 DvD video and it would de-rail me when I would notice this in MPEG-4 4:3 video. Huh?
If I understood correctly, "anamorphic" defines a form of resizing to "fit" by changing the horizontal dimension of pixels. With DvD video, it was the 16:9 videos that would need to "resize" in some way. However, with the square pixel assumption of computers/monitors, both 4:3 and 16:9 would have to "resize" to be a certain "fit" when it comes to MPEG-4, which is by nature, native to computers, not television, where pixels need to be more rectangular.
Ok, I think I'm on my way. But this is my real problem, and my reason for starting this thread.
PC assumes square pixels. You have to tell it in advance with a PAR ratio otherwise it will distort it, and some playback apps still may even have problems with rectangular pixels in playback and converting. Television playback needs rectangular pixels in video playback, even with BD/HD-DvD coming out, unless some hardware/software compensates in some way for it.
I'm assuming that AVC will make the trek to stand-alones via disc/hard-drive/network/etc very soon. I want my video to be playable on BOTH in the long-run, as I assume do most in this forum.
I really would like to go anamorphic for 4:3 MPEG-4 encoded video because you do retain more of the original without as much data loss. The extra 12% bitrate/file size is worth it.
However, when televison playback will happen in the future, will these stand-alone devices be playing it with the assumption that "this is PC content" and play it with square pixels or will they consider the PAR that has been implemented in advance and play it "as is"?
Ok, no one knows the answer to that question, and it may be specific to a certain model, however the last thing I want to do is encode a bunch of video in anamorphic and the playback devices assume it's "PC material" when migrating to television and my videos look "fatter" than should.
It's not like you can encode at one resolution and just change the PAR any time you need to. (Is there a "one-deal-fits-all"?)
I miss DivX where it was so easy. No anamorphic was supported since AVI was built for PCs and assumed square pixels. All you had to do was just encode a 720x480 NTSC MPEG-2 clip to 640x480, give it the appropriate bitrate, and you're done.
akupenguin
10th May 2007, 17:22
It's not like you can encode at one resolution and just change the PAR any time you need to.
You can change the PAR any time you want to. But for any given resolution of a given video, only one PAR will be correct, so why would you want to change it unless you made a mistake in the original encode? And if your hypothesis is that some player would ignore PAR, why are you even asking?
I miss DivX where it was so easy. No anamorphic was supported since AVI was built for PCs and assumed square pixels. All you had to do was just encode a 720x480 NTSC MPEG-2 clip to 640x480, give it the appropriate bitrate, and you're done.
ODML AVI does support anamorphic, or you can store aspect ratio in the mpeg4 stream itself. Maybe VirtualDub and DivX didn't use those features, but mencoder and XviD do.
SicMX
10th May 2007, 17:52
In Handbrake if you choose "anamorphic" it will rip the DVD at the full 720x480 (if NTSC) and when the video is played in say Quicktime the width will be upscaled to keep the aspect ratio correct.
If e.g. the film is really widescreen i usually end up with a 1024x480 file in Quicktime. Note that file is still 720x480 but when stretched to get the aspect ratio it is 1024x480.
This is how i think it work. Not 100% certain though =)
Also if the source is letterboxed just crop those and then the hight will be less than 480pixels.
Note that when using anamporhic mode you need to have a pretty high bitrate (i use around 3000kbps with H.264) because of the high resolution.
PuzZLeR
10th May 2007, 18:15
You can change the PAR any time you want to. But for any given resolution of a given video, only one PAR will be correct, so why would you want to change it unless you made a mistake in the original encode?
Exactly. Changing the PAR within an .mp4 or .mkv container is simple, but pointless anyway unless you got the original rez wrong. This is why it's frustrating. You can't just encode in one rez, and then just change the PAR when you need to. It doesn't make sense that way. You have to make the right decision on rez from the start (or re-encode).
And if your hypothesis is that some player would ignore PAR, why are you even asking?
Well, I'm not sure exactly. I just wanted to see if anybody has any insight on this, or any reasonable logical hunch on the market and tech.
ODML AVI does support anamorphic, or you can store aspect ratio in the mpeg4 stream itself. Maybe VirtualDub and DivX didn't use those features, but mencoder and XviD do.
ODML AVI however wasn't supported universally as AVI was. The assumption was that anything playing ODML AVI plays AVI, which made the choice easy (for me at least). I believe .mp4 and .mkv are very different in this respect. They actually have this feature built in without enhancement. This would be fine and dandy but, unfortunately even so, not all playback/decoding/converting software recognizes anything other than PAR 1:1, no matter what's there. (I can name a few if you like, however some are obvious.)
Frankly, this sucks, hence reason for my dilema as to which method of encoding I should go with. Go with better, "natural" quality of anamorphic, or just "play safe" with PAR 1:1? That is IF 1:1 is safe (hello BD/HD-DvD conversion).
DivX/Xvid stand-alone players always assumed a 1:1 PAR. In other words, you will always be safe just encoding with the proper rez and assuming square pixels for your PC AND stand-alone.
I don't feel that security with H.264/.mp4/.mkv etc.
PuzZLeR
10th May 2007, 18:27
In Handbrake if you choose "anamorphic" it will rip the DVD at the full 720x480 (if NTSC) and when the video is played in say Quicktime the width will be upscaled to keep the aspect ratio correct.
Yes, I adore HandBrake, my favorite x264 GUI (but my opinion only). Actually, what the HB devs did here was provide some sort of "hack" embedded in the encoded clip to get QT to play anamorphic content.
Not sure of the tech details behind it, but QT is not playing the anamorphic video under "natural" circumstances. If you hit ^I you will notice different readings for "Format" as opposed to "Normal Size" and "Current Size".
And as far as bitrate is concerned, there really is about a 12.5% increase for same quality going from 640x480 to 720x480 anamorphic (307,200 to 345,600 pixel count).
(I'm in NTSC-land.)
DivX/Xvid stand-alone players always assumed a 1:1 PAR. In other words, you will always be safe just encoding with the proper rez and assuming square pixels for your PC AND stand-alone.
I think you can apply the same logic to H.264 in whatever container: if the player doesn't support anamorphic encodes, it will certainly assume a 1:1 PAR. On the other hand, if the player can read the flags and PAR values correctly from your container of choice, it will also be able to correctly play back video with 1:1 PAR. So, you are always safe with that. Personally I wouldn't buy a standalone that doesn't do these things correctly, so I'll just happily encode with the original PAR of the source.
Awatef
10th May 2007, 22:49
@ puzz
As far as I'm concerned, I wouldn't care about player compatibility since player compatibility always means restrictions.
I would definitely go the HTPC way (you can assemble your own HD capable device starting 450$ canadian). The way I see it, this is a one time investment for 10 years to come. You won't even have to replace the DVD-ROM drive w/ a BD one, a double-layer DVD is fully sufficient for a full length movie in 1080p! (Amazing 8.8 Mbit/s for a 2h movie w/ a 448kbps DD5.1 soundtrack!)
Kuukunen
11th May 2007, 10:28
@Kuukunen:
It's really a matter of notation relative to reference. All expressions are correct: "x mod 16 = 0" and "x ≡ 0 (mod 16)" and "x is congruent to 0 modulo 16" as long as they are defined from source. You can even call it "x and 16 are mod 0 dude" if you define context beforehand as such.
I guess where I should have made my point was that "x is mod 16" was incomplete. Without the "0" it simply does not make sense theoretically (although most would know what you're talking about).
.
If you take it like that, in my opinion "x is mod16" should be considered correct too. It should be considered to be part of the jargon here as it has been used on these forums hundreds of times and everyone knows what it means. I was just saying if you take that out of the context and speak about theoretical mathematics, congruence is more correct way than the remainder operation. Oh and the two expressions I gave are the same, it's just how the mathematical notation is read.
You asked about cropping and resizing, but didn't get an answer. Avisynth does that too and a lot more. :P
@kuuk.
As long as we're talking DVDs, only videos w/ 16:9 AR are considered anamorphic.
But when we talk MPEG-4, everything that is not encoded in the proper AR is considered anamorphic ;)
Thanks for clearing stuff, so I'm sorry to be nitpicking again, but...
All I was saying I don't remember it being used in a sense other than the DVD/film sense. Especially not with NTSC or PAL broadcasts that technically ARE anamorphic. That wasn't my point though... Point was that if you have non-anamorphic (which actually IS non-square pixels) content on DVD and you re-encode it to MPEG-4 AVC of same resolution, it "suddenly" is anamorphic. But when you copy the exact same stream to a BD, again, it is not anamorphic, even though you might watch it on a computer, maybe even the same program as you'd watch the file. Again sorry, and yes, I would guess what you meant is MPEG-4 file played on computer, but this is why I thought it was kind of confusing to used the term anamorphic differently for playback from a file and playback from a disc...
@ puzz
As far as I'm concerned, I wouldn't care about player compatibility since player compatibility always means restrictions.
If you don't care about player compatibility at all, you might as well encode in something like Snow. And when they change the bitstream format, tough luck. Not to mention the whole point was to make them "future proof", so if ignoring player compatibility was an option, he wouldn't have made this thread in the first place. Puzzler didn't define what kind of future proofing it is though. Playback from computer, disc, possible future technology x? I assume possibly all.
So back to the topic. When you talk about the future, it always means predictions. My prediction, however, is that in the future non-square pixels are more and more supported. At least the way I see it, things are moving more and more in that direction. So I vote go for it.
Awatef
11th May 2007, 14:04
OK, let's put some Tabasco on this :D
I think the future is going "square" since HD resolutions are "square": 1920x1080 & 1280x720 are both perfect 16:9 ;)
Kuukunen
11th May 2007, 15:11
You're right.
I was basing my predictions on the fact the new container formats support PAR better. But on the other hand, anamorphic video in the first place was just a hack to get better quality with certain technical limitations: that it was easier to store stuff in 4:3. Now BD and HD-DVD support wide variety of resolutions, highest being square pixels, and logically it makes no sense why vertical quality should be better than horizontal.
However, that still doesn't mean the support for non-square pixels isn't going to be better in the future. (I still can't bring myself to say "anamorphic". :P)
delacroixp
10th December 2007, 01:47
anamorphic video in the first place was just a hack to get better quality with certain technical limitations: that it was easier to store stuff in 4:3.
Now BD and HD-DVD support wide variety of resolutions, highest being square pixels, and
logically it makes no sense why vertical quality should be better than horizontal.
Quite right... anamorphism was a kludge (http://searchcio.techtarget.com/sDefinition/0,,sid19_gci212446,00.html) to produce wide-angle movies on 'regular' 35mm film and it was then perpetuated when film was digitised onto DVD.
There is no intrinsic value in maintaining the anamorphic format when transcoding to MP4.
An 864x480 resolution has the same number of pixels as 720x576 (PAL 16:9), rearranged into a more natural 16:9 format.
(MKV will let you signal 864x486 for complete visual accuracy while maintaining MOD 16 all round)
Any resolution less than 864x480 (excluding cropping) will result in a loss of data and detail.
:):devil::D
Pascal
Sagekilla
10th December 2007, 04:05
Quite right... anamorphism was a kludge (http://searchcio.techtarget.com/sDefinition/0,,sid19_gci212446,00.html) to produce wide-angle movies on 'regular' 35mm film and it was then perpetuated when film was digitised onto DVD.
There is no intrinsic value in maintaining the anamorphic format when transcoding to MP4.
An 864x480 resolution has the same number of pixels as 720x576 (PAL 16:9), rearranged into a more natural 16:9 format.
(MKV will let you signal 864x486 for complete visual accuracy while maintaining MOD 16 all round)
Any resolution less than 864x480 (excluding cropping) will result in a loss of data and detail.
:):devil::D
Pascal
Whole heartedly agree, I never use anamorphic encoding and always encode using 864x480/464/368. But, even though I'm against it, I have tried and seen what anamorphic encoding has to offer and I find it very compelling that you can encode a scene at, say, 768x576 and have it stretched to 1024x576 with very minimal quality difference over native 1024x576.
Still, when it comes to the fact that I'm encoding once with the intention of keep my video as is without re-encoding, I'd rather resize to the actual resolution rather than stretch it at playback.
onesloth
10th December 2007, 08:07
If you have a 16:9 source ripped from a DVD it's originally 720x480. If you resize either of those dimensions down (ex. 720x400) you will be losing original pixels and detail, right? If you upsize (say 864x480), when encoding, you're adding pixels without adding detail, just more bitrate. If your justification for this added bitrate is the better quality of the pre-encode resize vs. the playback resizing, won't that only really be true if your video is always being played back at your upsized resolution (864x480). If you playback at a higher resolution (like 1280x720) won't you lose any benefit of your pre-encode resize when the vid is resized again during playback?
delacroixp
10th December 2007, 11:33
If you have a 16:9 source ripped from a DVD it's originally 720x480.
If you resize either of those dimensions down (ex. 720x400) you will be losing original pixels and detail, right?
If you upsize (say 864x480), when encoding, you're adding pixels without adding detail, just more bitrate.
If your justification for this added bitrate is the better quality of the pre-encode resize vs. the playback resizing, won't that
only really be true if your video is always being played back at your upsized resolution (864x480).
If you playback at a higher resolution (like 1280x720) won't you lose any benefit of your pre-encode resize when the vid is resized again during playback?
Quite right...
I live in PAL land (we're all friends) where movies are released in 720x576 @ 25 fps.
We have more detail than you guys in NTSC but you have more fps (which enhances high-motion action scenes).
NTSC:
720x480 = 345,600 pixels (Anamorphic)
768x432 = 331,776 pixels (16:9)
At 768x432 you have slightly fewer pixels than the original anamorphic setup but the numbers are both MOD 16 and also have the the correct DAR (16:9).
768x448 = 344,064 pixels is a little closer... it's MOD 16 but you'll have to signal 784x448 to attain the correct DAR (all calcs exclude cropping).
:):devil::D
Pascal
delacroixp
10th December 2007, 11:57
But, even though I'm against it, I have tried and seen what anamorphic encoding has to offer and I find it very compelling that you can encode a scene at, say, 768x576 and have it stretched to 1024x576 with very minimal quality difference over native 1024x576.
Still, when it comes to the fact that I'm encoding once with the intention of keep my video as is without re-encoding, I'd rather resize to the actual resolution rather than stretch it at playback.
"Smoke and Mirrors (http://en.wikipedia.org/wiki/Smoke_and_mirrors)"
Let's face it... you'll never watch a movie at 868x480 (unless you watch in window mode).
Your movie will always be stretched... to
1024x576 (if you're watching on a 1024x768 PC screen) or 1280x720 and even
1680x945 (if you have one of those fancy 1680x1050 wide-angle PC screens).
858x480 was always the natural viewing format (1024x576 is a poorer quality version of the same thing).
I guess that's why Sony introduced their Superbit (http://www.sonypictures.com/cthe/superbit/catalog.html) range of DVD's.
:):devil::D
Pascal
btw
Sony officially discontinues Superbit DVDs (http://www.cdfreaks.com/news/Sony-officially-discontinues-Superbit-DVDs.html)
Brother John
10th December 2007, 19:43
You could make the point, though, that the smaller resizing from 858x480 to 1024×576 might produce less artifacts than the larger resizing from 720×480 to 1024×576. There’s no denying that the first priority of on-the-fly resizing is speed rather than quality. There’s also no denying that those effects should be minimal and probably not visible at all.
In the end what it boils down to is: Can you spare the bitrate and CPU cycles? Personally I’ve never seen the point in upsizing to a square-pixel resolution.
delacroixp
11th December 2007, 12:19
You could make the point, though, that the smaller resizing from 858x480 to 1024×576 might produce less artifacts than the larger resizing from 720×480 to 1024×576.
In the end what it boils down to is: Can you spare the bitrate and CPU cycles? Personally I’ve never seen the point in upsizing to a square-pixel resolution.
Quite right... certainly people from NTSC land will struggle more than PAL to upscale their movies onto HD big-screen TV's or 720p projecters.
It's probably the No. 1 reason they've adopted HD TV and Blu-Ray so quickly... the quality (of NTSC) was atrocious.
That said, there is an increase in time and complexity to convert your cropped-anamorphic figures into a square-pixel equivalent (same no of pixels) but I should imagine that the actual encoding time should be pretty similar.
It's interesting to note that some older movies (especially more than 20 or 30 years) have been given far more pixels than they deserve (merely to fill up the 720x576 quota).
They may have been released on PAL 16:9 but you can quite happily encode them at 800x448 or less without loss-of-detail... anime and cartoons also spring to mind.
In fact, one of my favourite movies The Great Escape (1963) (http://en.wikipedia.org/wiki/The_Great_Escape) was released in "wideangle 4:3 anamorphic" with an on-DVD resolution of 720x320.
Incidently, it was released 10 years after the first anamorphic movie (http://en.wikipedia.org/wiki/The_Robe_%28film%29).
:):devil::D
Pascal
.
delacroixp
11th December 2007, 13:12
1) Make an anamorphic snapshot... MPClassic (http://www.softpedia.com/get/Multimedia/Video/Video-Players/Media-Player-Classic-for-Win2kXP.shtml) works well: (see attachment 1)
2) Crop using something like MS (http://office.microsoft.com/en-us/help/HP010017211033.aspx) Office Picture Manager (http://www.youtube.com/watch?v=4Zg2Sf9m2Jw) which allows you to crop step-wise on all sides: (see attachment 2)
A preview setup like Dr DivX (http://forum.doom9.org/showthread.php?p=969913#post969913) is gr8 since it forces you to crop MOD 2 and adjusts for MOD 16 width and height.
3) Calculate the Encode resolution: (see attachment 3)
In my case Phantom of the Opera (http://en.wikipedia.org/wiki/The_Phantom_of_the_Opera_(2004_film)).
Cropping L = 2 ; R = 4 ; Top = Bottom = 76
Cropped Image = 714x424 [302,736 pixels]
Encode resolution (MP4)
= 832 x (832/2.4017)
= 832 x 346
-> 832 x 352 (MOD 16) [292,864 pixels... as good as it gets]
4) Enter the Signalling aspect ratio: (see attachment 4)
Signalling aspect ratio (MKV)
= (716/720 x 1024) / 424
= 2.4017 or 845x352
:):devil::D
Pascal
.
Honeyko
20th January 2008, 13:45
Crop using something like MS (http://office.microsoft.com/en-us/help/HP010017211033.aspx) Office Picture Manager (http://www.youtube.com/watch?v=4Zg2Sf9m2Jw) which allows you to crop step-wise on all sides.
A tool I use is Adobe ImageReady (a quick-n-dirty photo-manipulation component of Photoshop; an older version,
such as v6, serves well for this purpose); I can zoom in until the pixels are the size of Chicklets -- telling good
and bad rows and columns is very easy at level.
Phantom of the Opera
Cropping L = 2 ; R = 4 ; Top = Bottom = 76
Cropped Image = 714x424 [302,736 pixels]
Encode resolution (MP4)
= 832 x (832/2.4017)
= 832 x 346
-> 832 x 352 (MOD 16) [292,864 pixels... as good as it gets]
While you have close to the same number of pixels with these settings, you've actually lost a fair bit of your
vertical data (424 height vs. 352 height = 83% vertical data retention.)
An anamorphic encode would retain all of the data thusly: 424 > 432 (MOD16),
714 > 720 (MOD16) ....encode 720x432 (311,040 pixels, or a 102% increase)
You could also crop two more horizontal columns and encode MOD8 712x424 and not resize any of the source pixels
at all. (Or leave the two columns in and encode 720x424; 305,280 pixels; 100.8% increase)
==//==
For those who like anamorphically encoding, the next step is to bump up cropped vertical and horizontal dimensions to
mod16 (or drop, if you're only one or two rows or columns away). After encoding, I'll either use MPEG4modifier
(xvid) or MKVmerge (x264) to anamorphically stretch the horizontal.
Here are a few screen-captures of my mainly NTSC 720x(cropped>mod16) anamorphic encodes, as widened
during play and then snapped by VLC:
Real Genius:
http://i2.photobucket.com/albums/y19/mike18xx/real_genius_crossbow_shot.png
Superman Doomsday:
http://i2.photobucket.com/albums/y19/mike18xx/SupermanDoomsday-06RainofShards.png
Becket (poor quality source restored from grainy "pink" stock):
http://www.cinema-obscura.com/mempics/honeyko/Becket1964/becket2.jpg
Paint Your Wagon:
http://i2.photobucket.com/albums/y19/mike18xx/pyw_claim.jpg
Brother John
20th January 2008, 14:34
Why are you all making your life so bloody difficult with those calculations.
1. Crop
2. Set the appropriate PAR (http://forum.doom9.org/showpost.php?p=1058927&postcount=11) in the encoder.
3. MKVMerge usually recognises the PAR automatically. With MP4Box, set the PAR again.
4. Done. No calculations necessary at all.
Atak_Snajpera
20th January 2008, 15:45
Why are you all making your life so bloody difficult with those calculations.
I also don't understand why some people like to complicate things... :)
ShadowVlican
20th January 2008, 17:29
Why are you all making your life so bloody difficult with those calculations.
1. Crop
2. Set the appropriate PAR (http://forum.doom9.org/showpost.php?p=1058927&postcount=11) in the encoder.
3. MKVMerge usually recognises the PAR automatically. With MP4Box, set the PAR again.
4. Done. No calculations necessary at all.
+1
except i take advantage of MKV's AR instead of the encoders
SeeMoreDigital
20th January 2008, 17:33
I also don't understand why some people like to complicate things... :)Because if you just "crop", you don't always arrive at a "mod-16" image size!
Meaning you have to re-size your cropped image to a mod-16 image before encoding and prior to adding PAR signalling.
Now... Although there are encoding applications that will allow you to generate MPEG-4 Part-2/Part-10 encodes at non "mod-16" sizes. Such encodes might not work correctly in all makes/models of stand-alone players!
Brother John
20th January 2008, 18:15
Meaning you have to re-size your cropped image to a mod-16 image before encoding and prior to adding PAR signalling.
You mean distort the image by reszing to the nearest mod16 and then compensate by using an individual custom PAR? Yes of course, such crazy scenarios don’t work without calculations.
It’s rather useless in a PC environment altough a good example of AR signalling’s flexibility. But if you start arguing with compatibility to “all makes/models of stand-alone players” you’d better forget non-square video completely.
SeeMoreDigital
20th January 2008, 18:28
But if you start arguing with compatibility to “all makes/models of stand-alone players” you’d better forget non-square video completely.That's a ridiculous statement.....
It's not that difficult to work out how to generate "image only" mod-16 encodes with the correct level of PAR signalling... Thus maintaining compatibility with all makes/models of stand-alone players... that support aspect ratio signalling!
Perhaps if you had a stand-alone player that handled PAR signalling detection properly, you'd understand.
Brother John
20th January 2008, 19:11
with the correct level of PAR signalling... Thus maintaining compatibility with all makes/models of stand-alone players!
Wrong. That implies all SAPs properly support AR signalling with arbitrary PARs. Which is not the case as you say yourself in the following sentence. Incidentally, that was exactly what I tried so say with that “ridiculous” statement... If you want to be compatible with each and every SAP out there, using non-square at all will get you into trouble.
Another thing to consider with the resizing trick. Resizing makes the video harder to encode. If you can’t spare the bitrate, you might end up with a visibly worse result. In that case overcropping might be the better choice.
SeeMoreDigital
20th January 2008, 19:23
Two things...
Do you actually generate anamorphic MPEG-4 encodes. And do you have a stand-alone player that correctly supports such encodes?
Brother John
20th January 2008, 19:29
Yes and no.
SeeMoreDigital
20th January 2008, 22:02
Yes and no.Well... If you don't have a player that supports MPEG-4 encodes generated with PAR signalling correctly. I'm bemused as to why you feel compelled to argue with those people who do?
Tell you what! Here's as short sample from an MPEG-2/DVD movie (http://rapidshare.de/files/38361267/Lawrence_of_Arabia__PAL_.zip.html). Can you generate an anamorphic MPEG-4 encode for me so I test it for accuracy with my hardware players?
Honeyko
20th January 2008, 22:33
Why are you all making your life so bloody difficult with those calculations.
1. Crop
2. Set the appropriate PAR (http://forum.doom9.org/showpost.php?p=1058927&postcount=11) in the encoder.
3. MKVMerge usually recognises the PAR automatically. With MP4Box, set the PAR again.
4. Done. No calculations necessary at all.
Because....
A. MKV might not be the container the project goes into.
B. Aspect-ratios change when you crop, and I like to be certain that it's going to be correct in the final.
It's actually pretty easy: take a screen-clip in VLC (which displays the picture anamorphically), and then, in Imageviewer or other highly zoomable picture viewer, measure the number of (width x height) of the "good" DAR image you want to keep (you'll need to round height down to an even number for MOD2). Let's say you get something like 853x362 as a fairly typical 2.35:1 NTSC film anamorphically letterboxed at 16x9 onto 720x480 VOBs. Now take a source PAR snapshot in MPC for determining the actual number of pixel rows and columns you'll crop prior to their being anamorphically stretched. (For widescreen output, the top and bottom crop values will be the same, i.e. 362, and the right and left a few less than is apparent after anamorphic stretching -- often you'll discover you don't need to crop the right and left at all.)
Crop, run the encode with the height and width resized slightly to next mod8 or mod16 step, then adjust anamorphic DAR as a hard width x heigth number in one of several utilities (MKVmergeGUI, MPEG4modifier, etc, or the encoder itself if it permits that rather than only pre-factored ratios).
In the above case, height increases from 362 to 368, and width is kept at the original 720.
853x(368/362) = desired anamorphic display width of 867. So 867x368 if your target.
-- Do it that way, and your output width will always be within one pixel of actual DAR. (In contrast, if you simply multiplied 368 by 2.35 for your DAR, you'd get 864 and be off by three....almost certainly not noticeably different to the human eye, but hey: points given for neatness!)
valnar
20th January 2008, 23:45
Because....
A. MKV might not be the container the project goes into.
B. Aspect-ratios change when you crop, and I like to be certain that it's going to be correct in the final.
It's actually pretty easy: take a screen-clip in VLC (which displays the picture anamorphically), and then measure the number of (width x height) of "good" pixels, even number (MOD2) for height, of the desired viewable image. Let's say you get something like 853x362 as a fairly typical 2.35:1 NTSC film anamorphically letterboxed at 16x9 onto 3:2 720x480 VOBs.
Crop, run the encode with the height and width resized slightly to next mod8 or mod16 step, then adjust anamorphic DAR as a hard width x heigth number in one of several utilities (MKVmergeGUI, MPEG4modifier, etc, or the encoder itself if it permits that rather than only pre-factored ratios).
In the above case, height increases from 362 to 368.
853x(368/362) = DAR, or anamorphic display width of 867.
-- Do it that way, and your output width will always be within one pixel of actual DAR. (In contrast, if you multiplied 368 by 2.35 for your DAR, you'd get 864 and be off by three....almost certainly not noticeably different to the human eye, but hey: points givenfor neatness!)
In the example of your 2.35 film, can you show me a typical avinaptic report of one of your movies?
I don't mind having the AR off by .5-1% or so if it means that resulting encode isn't a "mess" regarding software AR.
-Robert
delacroixp
21st January 2008, 03:25
Why are you all making your life so bloody difficult with those calculations.
1. Crop
2. Set the appropriate PAR (http://forum.doom9.org/showpost.php?p=1058927&postcount=11) in the encoder.
3. MKVMerge usually recognises the PAR automatically. With MP4Box, set the PAR again.
4. Done. No calculations necessary at all.
I also don't understand why some people like to complicate things... :)
+1
except i take advantage of MKV's AR instead of the encoders
Very neat... certainly simple and definitely one of the best candidates for the KISS principle (http://en.wikipedia.org/wiki/KISS_principle) !!!
My take on complexity is that...
complexity is the spice of life... simplicity is for losers who can't cope with creeping featurism and marketroid (http://www.faqs.org/docs/jargon/K/KISS-Principle.html) !
Complexity is a "good thing"... it expands the IQ (http://en.wikipedia.org/wiki/IQ), EQ (http://en.wikipedia.org/wiki/Emotional_intelligence), personality and character.
Let's all stand together and celebrate complexity... perhaps even vote for complexity as a national public holiday... up there with religious public holidays.
:):devil::D
Pascal
delacroixp
21st January 2008, 04:12
While you have close to the same number of pixels with these settings, you've actually lost a fair bit of your
vertical data (424 height vs. 352 height = 83% vertical data retention.)
An anamorphic encode would retain all of the data thusly: 424 > 432 (MOD16),
714 > 720 (MOD16) ....encode 720x432 (311,040 pixels, or a 102% increase)
I think my 4th pic of signalled and DAR "Phantom of the Opera" is a little bit off because I only used 1 decimal AR instead of 4.
Perhaps you're not looking at Anamorphic encoding in quite the right dimension. It's a bit like Alice saying You’re nothing but a pack of cards ! (http://www.ruthannzaroff.com/wonderland/cards1.htm).
Anamorphic images are like a piece of gum... you can rearrange the shape to your hearts content as long as you maintain the "same number of pixels" and supporting "bitrate" (the foundation to your structure).
For all intents and purposes I could have encoded at 640x640 resolution and let our old friend Lanczos deal with the details.
Quite frankly... we could conceivably encode the resolution as a 3-dimensional matrix array like 74x74x74... it's just a digital representation of a quirky format. This makes no sense on film... but in the digital arena, everything is possible.
Maintaining, the original anamorphic PAR makes perfectly good sense especially when dealing with potential hardware inconsistencies (SAP's).
That said... I prefer to resize to approximately PAR 1:1 while still maintaining a marginal level of anamorphic substance because the layout makes more sense to humans and I can maintain a fairly high degree of flexibility in the " Cropping -> Resizing -> Encoding -> Display " process.
The 2-step hybrid strategy eventually achieves the correct DAR on playback... downto to micro-pixel accuracy !
I can see how purists would prefer to maintain original PAR or alternatively, transcode directly into PAR 1:1 .
:):devil::D
Pascal
Honeyko
21st January 2008, 04:46
In the example of your 2.35 film, can you show me a typical avinaptic report of one of your movies?
I don't mind having the AR off by .5-1% or so if it means that resulting encode isn't a "mess" regarding software AR.
What information are you looking for?
I encoded "Paint Your Wagon" at 720x448. The DAR is 1044x448.
The picture is a VLC snapshot rendered into a 90% quality jpeg.
I can see how purists would prefer to maintain original PAR or alternatively, transcode directly into PAR 1:1.I once used to do it your way, until I started doing older, grainier films and was on a "visually lossless" kick -- I just couldn't get "de-anamorphed" output (your PAR 1:1) to look quite as good at a given file-size/bit-rate. I now try to keep encoder resizing to a minimum.
Brother John
21st January 2008, 16:08
@SeeMoreDigital
Maybe we’re missing each others point?
I was opposing your statement that mod16 would be enough to ensure compatibility of non-square MPEG-4 with “all makes/models of stand-alone players”. Since SAPs exist that don’t support non-square video at all, this statement is false.
I’m not trying to lecture you about your own player. That’d be ridiculous indeed! Sorry if that came across wrong.
Aspect-ratios change when you crop
PAR doesn’t. When using it you’ll always get correct results regardless of how much cropping you did.
delacroixp mentioned the word »approximate«. That describes the whole world of anamorphic video (as input or output or both) precisely. Always keep that word in mind because that’s the maximum you’ll get. Aiming for the »perfect correct AR« is in vain. You’ll never reach it. And if by chance you do, you very likely won’t know.
Sharktooth
21st January 2008, 16:20
... overcrop to mod16 ... no resize, no hassles ... problems solved.
SeeMoreDigital
21st January 2008, 17:31
@SeeMoreDigital
Maybe we’re missing each others point?
I was opposing your statement that mod16 would be enough to ensure compatibility of non-square MPEG-4 with “all makes/models of stand-alone players”. Since SAPs exist that don’t support non-square video at all, this statement is false.I have amended my above statement to clarify that I was refering to players that support aspect ratio signalling.
Aiming for the »perfect correct AR« is in vain. You’ll never reach it. And if by chance you do, you very likely won’t know.You can get to within a pixel
Cheers
delacroixp
22nd January 2008, 00:49
In the example of your 2.35 film, can you show me a typical avinaptic report of one of your movies?
I don't mind having the AR off by .5-1% or so if it means that resulting encode isn't a "mess" regarding software AR.
What information are you looking for?
I encoded "Paint Your Wagon" at 720x448. The DAR is 1044x448.
The picture is a VLC snapshot rendered into a 90% quality jpeg.
I think valnar was curious about the orginal anamorphic resolution... sans black matte.
1044/448 = 2.3303 which is clearly NOT 2.35... a couple of rows or collumns have gone AWOL or otherwise, gone under the hammer.
It's bound to happen but your method can require some quite severe cropping to maintain MOD 16 or even MOD 8 (either under or over).
I'm almost sure that it's less computer intense since there is no radical resizing but someone has to pay the piper.
I can see how purists would prefer to maintain original PAR or alternatively, transcode directly into PAR 1:1 .
I once used to do it your way, until I started doing older, grainier films and was on a "visually lossless" kick -- I just couldn't get "de-anamorphed" output (your PAR 1:1) to look quite as good at a given file-size/bit-rate. I now try to keep encoder resizing to a minimum.
I'm sure that resizing has a penalty, perhaps most obviously in poor quality prints from way back in the 60's or even 50's.
That said... I don't resize to PAR 1:1 and I certainly don't encode at SAR 1:1 (which is where valnar is heading)... my encodes are still fractionally anamorphic eventhough I resize to approximately, display layout... but stretch my pixels ever so slightly to achieve the perfect PAR 1:1 during playback.
If you encode to PAR 1:1 but still signal modifications on playback... you have lost some pixel information during encoding. X264 assumes PAR 1:1 is the final DAR... if NOT PAR 1:1, X264 adds a spot of extra punch or elasticity to your pixels (like std anamorphic content but less severe) to allow the stretch on playback.
(It's like designing sway into a tall building to cope with strong winds... PAR 1:1 is rock solid. Sure you can stretch it... but it's like stretching a pyramid slighly in one direction. If you play a 800x331 movie on a 1440x900 screen... the entire image is upscaled... there is no lobsided stretch from one side)
This hybrid-system lets me mess with the pixels and encode a similar-no-of-pixels to the original... if I so choose !
:):devil::D
Pascal
ps
Perhaps the paper work, the unlimited possibilities and the "impure" approach may also coerce me to change my evil ways at some point in the future.
Untill then... 800 width, Q20 (with variations for animations, older, shabbier and B&W) and HE-AAC v2 @ 90kbps (http://forum.doom9.org/showthread.php?p=1088432#post1088432) stereo, makes my heart sing.
valnar
22nd January 2008, 01:43
@delacroixp
I think having a slightly off PAR/DAR at your discretion is what worries me in the long run. I can't speak from experience because I am still waiting for my first STB decoder in the form of the Sage HD Extender. However, if its anything like the software Sage client, it only understands AR of "source, "4:3", "16:9" or "fill". I think that may mean it won't understand arbitrary anamorphic values. So either I encode to 1:1, or I leave DVD's in their original anamorphic state, which may include encoding black borders on 2.35 movies for instance.
Of course, this is just one hardware decoder of probably many to come which will support H.264. With the flurry of announced H.264/MPE2/4 decoders out there, I think the days of the HTPC cornering the video-playing market are numbered. I don't sit and watch 2 hour movies on my PC monitor. TV, yes.
So assuming (yes, assuming once again) that PAR 1:1 is the safest, I'm willing to give up a 1% AR to achieve a 1:1 PAR and standard DAR. I think the ideal of getting near 1 pixel and the expense of the file being taffy flexible to software players is not worth it.
Unfortunately, in this case of an anamorphic DVD, that means upscaling the horizontal to 848 or 864 or downscaling to lose vertical resolution. 'Not much choice there as I'm finding out.
If somebody can convince me that my worries are for naught and any hardware decoder can interpret any ARS, then I'll be more exact in my encodes.
Robert
delacroixp
22nd January 2008, 02:23
So assuming (yes, assuming once again) that PAR 1:1 is the safest, I'm willing to give up a 1% AR to achieve a 1:1 PAR and standard DAR. I think the ideal of getting near 1 pixel and the expense of the file being taffy flexible to software players is not worth it.
If somebody can convince me that my worries are for naught and any hardware decoder can interpret any ARS, then I'll be more exact in my encodes.
My concern was not so much the 1% error in DAR... but the 1% loss in quality when encoding in PAR 1:1 ...
if your... encoding aspect resolution is not equal to display aspect resolution .
That said, your worries could be further compounded by X264 incompatibilities with early SAP's.
:):devil::D
Pascal
Inventive Software
22nd January 2008, 02:33
In PAL land, if you're cropping, use 720x432 for Aspect Ratios between 2.35 and 2.40, or 720x448 for Aspect Ratios between 2.2 and 2.3 (had to use this once, with Crash :devil:). You're aiming for a 1024x??? AR, height being either 432 or 448.
@Sharktooth: surely that's undercrop? You lose data otherwise if it's a kooky AR. 432 or 448 are mod-16, that's the target, right?
And a quick resize tip: Bicubic or Lanczos if you want 1:1 aspect ratio. Bilinear's good for downscaling and quick resizing, that's about it.
delacroixp
22nd January 2008, 03:17
... overcrop to mod16 ... no resize, no hassles ... problems solved.
It sounds just wayy too easy... what do you do with all that extra free time ?
You must have 48 hours in your day after that "instant coffee" and "fully automatic" solution !
:):devil::D
Pascal
delacroixp
22nd January 2008, 03:25
And a quick resize tip: Bicubic or Lanczos if you want 1:1 aspect ratio. Bilinear's good for downscaling and quick resizing, that's about it.
Granny Weatherwax (http://en.wikipedia.org/wiki/Granny_Weatherwax) wants to know if Bilinear really is better than Lanczos for downsizing.
I did one test where Bilinear was 10% smaller than Lanczos... but Lanczos was still clearer (hardly overwhelming evidence).
Does anyone else have some thoughts on the matter ?
:):devil::D
Pascal
Honeyko
22nd January 2008, 09:12
1044/448 = 2.3303 which is clearly NOT 2.35... a couple of rows or collumns have gone AWOL or otherwise, gone under the hammer.It wasn't perfectly 2.35 to start with. In fact, most, especially older, films are off by a bit. Some are actually off by quite a lot, because the DVD print may contain extra material on the top and bottom that wasn't shown to theater audiences (if carried too far, this results in boom-mikes and the like shown hanging down). Example: "5 Card Stud" is a 1.85 film, but is 1.75 on DVD.It's bound to happen but your method can require some quite severe cropping to maintain MOD 16 or even MOD 8 (either under or over).I don't crop for that purpose; I only remove black, then upsize to a multiple.PAR 1:1 is rock solid. Sure you can stretch it... but it's like stretching a pyramid slighly in one direction. If you play a 800x331 movie on a 1440x900 screen... the entire image is upscaled... there is no lobsided stretch from one side)If the original material was anamorphic (stretched) in the first place, resizing it to PAR 1:1 cannot make the picture look any better. Entropy, and all that. (You can repair damage to the imagery (such as graininess) via filters, but that's another matter.This hybrid-system lets me mess with the pixels and encode a similar-no-of-pixels to the originalThere are limits to the "plasticity" of the original data -- it's not endlessly malleable. I try to keep encoder resizing to a raw minimum and headed in the same direction as player-software resizing on-the-fly during playback (i.e., larger, as virtually everyone's viewing device will be larger than 720x480)).
Sharktooth
23rd January 2008, 02:54
It sounds just wayy too easy... what do you do with all that extra free time ?
You must have 48 hours in your day after that "instant coffee" and "fully automatic" solution !
:):devil::D
Pascal
anamorphic IS easy.
just overcrop to mod 16, apply the source PAR, encode...
just that.
delacroixp
23rd January 2008, 04:12
I don't crop for that purpose; I only remove black, then upsize to a multiple. If the original material was anamorphic (stretched) in the first place, resizing it to PAR 1:1 cannot make the picture look any better. Entropy, and all that.
I can't think why I thought you maintain original PAR... like Brother John and Sharktooth.
It seams that you do, in fact, modify the anamorphic AR ever so slightly... and then rely on signalling to achieve DAR
(or do you simply rely on standard anamorphic playback and accept the +/- 1% error in DAR).
You certainly minimise any resizing during encoding (which should enhance the finished product).
:):devil::D
Pascal
Sharktooth
23rd January 2008, 04:46
PAR is not DAR and it doesnt change if you only crop...
Inventive Software
23rd January 2008, 05:44
Granny Weatherwax (http://en.wikipedia.org/wiki/Granny_Weatherwax) wants to know if Bilinear really is better than Lanczos for downsizing.
I did one test where Bilinear was 10% smaller than Lanczos... but Lanczos was still clearer (hardly overwhelming evidence).
Does anyone else have some thoughts on the matter ?
:):devil::D
Pascal
Granny Weatherwax (along with His Excellency Arch Chancellor Mustrum Ridcully) would like to point out that at no point did I say Bilinear was better than Lanczos for downsizing, and vice versa, or that BiCubic was better than any of them. They all have their merits and caveats. Bilinear is softer than BiCubic (which is reasonably sharp), Lanczos is a bit sharper (hence your smaller file size; softer = blurrier, less artefacts, sharper = more detail / noise / clearer image). Plus, if you feel brave, Lanczos4 might on that rare occasion give you that wonder of magical wonders the Octarine (http://en.wikipedia.org/wiki/Octarine#Octarine) scale! :devil: ;)
(I made that last bit up, just in case I get sceptical questions. Hint: read Terry Pratchett's Discworld series. Hilarious. :D)
And while we're comparing resize algorithms, what's Spline16 and Spline36's benefits and caveats? I can tell no difference between them and Bicubic / Lanczos(4)...... :confused:
PAR is not DAR and it doesnt change if you only crop...
How true this is cannot be emphasised enough. PAL 16:9 video at resolution 720x576 has a Sample AR of 64:45. This doesn't change after cropping horizontally or vertically. Really, it doesn't.
No. Really. Honest. I don't lie. Go try it and see! :rolleyes:
foxyshadis
23rd January 2008, 08:01
And while we're comparing resize algorithms, what's Spline16 and Spline36's benefits and caveats? I can tell no difference between them and Bicubic / Lanczos(4)...... :confused:
You have to be very anal to care about the differences. Spline36 is supposed to be just about as sharp as lanczos3 without the edge enhancement artifacts, spline16 mirrors lanczos2 in the same way. Blackman (avisynth 2.5.8 or a plugin) is supposed to be similar for 4+ taps. (Spline64 is just broken.) All of them are fine for a sharp resize, though lanczos will be slightly large because its halos are harder to code.
Differences are practically invisible until you have at least a 50% resize.
Inventive Software
23rd January 2008, 14:38
Thank you for the explanation foxy. :)
Honeyko
24th January 2008, 09:12
Originally Posted by Honeyko View Post
I don't crop for that purpose; I only remove black, then upsize to a multiple. If the original material was anamorphic (stretched) in the first place, resizing it to PAR 1:1 cannot make the picture look any better. Entropy, and all that.I can't think why I thought you maintain original PAR... like Brother John and Sharktooth.Not exactly; Shark, according to his post, overcrops. From my standpoint, working mainly with NTSC of old movies, that can murder quite a lot of a picture -- particularly the vertical dimension. Therefore I crop only the black and maybe a couple "scummy" adjacent lines, and resize the output dimension to the next MOD16 (this is generally not more than a 2% resize). I sometimes resize downward, if the numbers are very close (i.e., 706 > 704 width, after cropping 8 right and 6 left, etc).It seams that you do, in fact, modify the anamorphic AR ever so slightly... and then rely on signalling to achieve DAR (or do you simply rely on standard anamorphic playback and accept the +/- 1% error in DAR).I'm not sure what you mean. What I do is measure the film's actual DAR prior to encoding, based upon playback snapshots, by counting the width and height of the "good part" of the picture (i.e., the part I will not crop). w/h = n. Then, after the vertical is resized to MOD16, multiply "h2" by n to yield new anamorphic horizontal value to apply during the final mux to produce output of the same ratio of the original inset letterboxed imagery.
-- This is particularly effective for older XviD utilities like AutoGK which automatically resize to MOD16 (you have no choice in the matter); I just run the output file through MPEG4modier with the appropriate width setting for whatever vertical resolution the output file was slightly upsided to.You certainly minimise any resizing during encoding (which should enhance the finished product).Exactly. I let the playback device and software take care of virtually all of the resizing -- because that's what they're expected and designed to do anyway.
SeeMoreDigital
24th January 2008, 10:01
Worth the effort or not. This is how I work out my anamorphic encodes: -
http://forum.doom9.org/showthread.php?p=1034465#post1034465
Honeyko
24th January 2008, 11:42
Exactly. (I just do it manually instead of permitting an autocropper to possibly hack away good lines.)
Example, with film I'm doing right now:
1. Source: NTSC 720x480
2. play movie in MPC; clip; view "squashed" image.
3. establish crop values: L0, R0, T6, B13
4. play movie in VLC; clip; view anamorphically stretched image.
5. DAR = 853x480, with letterboxed image of 853x461.
6. aspect-ratio is 853/461.
Now to encode....(example follows using AutoGK):
1. make five-second MPEG2 clip using VideoRedoPlus for tests.
2. in AutoGK, set width to 720.
3. ctrl-F9, and Override Aspect to "original"
4. enter crop values; threshhold 0.
5. 100% quality xvid encode; height auto-sized up to 464.
6. open output file in MPEG4modifier.
7. width x height values are [853.33333*x(464/461)] x 464. save.
8. open in AVImuxGUI for final muxing of audio, subtitles, etc.
Result, in this case, is a 720x464 file (anamorphic 859x464) of 2.2gb when unaltered AC3 audio was re-muxed. File-size is satisfactory to me, because I'm after quality, not file-size (provided it's under 4.3gb anyway). Due to the density of bits/pixel, it can be zoomed much larger than a smaller file "spread thin".
(*853.3333 is [480x16/9]; 853 is just the round-down display value; whenever an NTSC DVD needs no right or left cropping, I go with the extra .3333 in the arithmetic. It won't change width by more than a pixel...I mainly do it just for fun.)
Brother John
24th January 2008, 13:01
One thing to keep in mind when using custom values with the bitstream AR flag: For MPEG-4 (A)SP numerator and denominator of the final PAR both must not be larger than 255 because the standard defines an unsigned 8-bit integer each for storing the two values. For H.264 the limit is 65535.
Xvid_Encraw scales down too large values automatically but isn’t too successful. I’m not sure what x264 does.
delacroixp
25th January 2008, 01:44
Worth the effort or not. This is how I work out my anamorphic encodes: -
How to... Generate anamorphic 720x??? (http://forum.doom9.org/showthread.php?p=1034465#post1034465)
A pity VoidShell messed up that thread with all his '$ million', 'bigger is better' and 'far too many' jpegs that take forever to load...
:):devil::D
Pascal
ps
Let's ban his ass... lol
delacroixp
25th January 2008, 01:52
3. establish crop values: L0, R0, T6, B13
(*853.3333 is [480x16/9]; 853 is just the round-down display value; whenever an NTSC DVD needs no right or left cropping, I go with the extra .3333 in the arithmetic. It won't change width by more than a pixel...I mainly do it just for fun.)
It's great that you can crop by odd numbers... NTSC has so much less 'real estate' that each pixel really is gold dust... nice job !
As to the extra .3333
You're clearly having wayy tooo much fun... there should be a law against that kind of thing !
lol
:):devil::D
Pascal
Honeyko
27th January 2008, 10:10
It's great that you can crop by odd numbers...
I have annoyingly discovered that they are, in fact, rounded by AutoGK (this means my DARs may be off by a couple pixels in the calculations on the last page if both numbers on the height axis are odd).
==//==
Here's a handy trick: Adding anamorphic DAR during after-mux to a non-anamorphic encode.
Situation: DVD "extra" which is mostly interviews; you intend to smash the crap out of it and don't want to commit the time to it that using x264 would require, but still hate the "skew" that XviD encoder adjustments to MOD16 can impart to smaller width/height files.
Source file: NTSC 720x480 with anamorphic letterboxed 720x458 imagery. The crop values yielding 458 are odd numbers, meaning that 456 is the height the encoder will actually work with after rounding. 456 has some convenient properties....
DAR of rounded-to-even cropped image: 853x456
Target output height: 304 (exactly two-thirds of 456, and MOD16)
Encoder file width: 560 (why? glad you asked... 853.333x[304/456] = 568.889, so a setting of 560 width will yield a height value somewhat less than 304, which will then be rounded up the next MOD16 increment, or 304)
Then, just wham-bam-thank-ya-ma'am XviD 100% in AutoGK, (I recommend checking the "Force sharp matrix" box in the Ctrl-F9 panel), then open the finished file up in MPEG4Modifier, and re-stream it to 569x304.
delacroixp
8th February 2008, 23:29
@ Honeyko
I finally did an anamorphic vs resize comparison test (AutoMKV 0.95a) and the results are pretty interesting.
I took a 1 minute clip from Band of Brothers (http://en.wikipedia.org/wiki/Band_of_Brothers) (PAL 16:9), did 2 encodes @ Q20 and
720 x 576 anamorphic
864 x 480 resized
I took a native snapshot with MPC, upscaled to 1024x576 in Photoshop and saved the result in 75% jpeg (Repeated with intro).
The encoding times between the two were almost identical.
The anamorphic encode was less than ½ % larger (I was expecting more).
See particularly, the mouth of the front right soldier and the eyes of '1st Lt Sobel in the jeep' (of Friends (http://en.wikipedia.org/wiki/Friends) fame).
See also 'top of H' in HBO.
If you run the 2 pics in a folder as a slideshow... the differences all but pop out at you.
Overall, the quality of the anamorphic encode is marginally better.
:):devil::D
Pascal
Conclusions
Mpeg2 at 1024x576 playback has less quality than an original encode at 1024x576 but more quality than an original at 864x480.
720x576 has been pre-engineered to enhance colour and detail on playback.
An anamorphic transcoding may be the most cost-effective way to unlock that marginal increase in quality (colour & detail) from 414,720 pixels to 589,824 pixels.
PAR 1:1 is an end in itself and the end of the road...
Anamorphic is always looking ahead, creating something bigger and better (more than seams possible) !
It may be feasible to downsize anamorphically too...
In other words, a normal 720x400 (PAL 16:9) downsize could be encoded at 608x480 (anamorphically) -> 853x480 (DAR).
The increase in display area is 40% compared to the normal 42% increase.
.
Atak_Snajpera
8th February 2008, 23:35
upscaled to 1024x576 in Photoshop and saved the result in 75% jpeg.
Next time use png and upload images to imageshack.us otherwise it will take forever to see your screenshots
Sagekilla
8th February 2008, 23:40
If you were to do a "proper" PAR 1:1 encode from a 720x576 source, you would stretch to 1024x576 for 16:9. Also, the reason why anamorphic @ 720x576 vs 1:1 @ 864x480 are practically the same size is because they have the same number of pixels.
delacroixp
9th February 2008, 12:57
Next time use png and upload images to imageshack.us otherwise it will take forever to see your screenshots
PNG would have been the real deal... but
I couldn't figure out how to coax VLC media player to output a 1024x576 snapshot of the 864x480 encode.
Media Player Classic has a super-delux option to take snapshots of exact frame numbers (outputs original file-resolution bitmaps).
ImageShack (http://imageshack.us/), MediaFire (http://www.mediafire.com/) or my own webserver would have been great !!!
Sorry for the delay.
If you were to do a "proper" PAR 1:1 encode from a 720x576 source, you would stretch to 1024x576 for 16:9.
Also, the reason why anamorphic @ 720x576 vs 1:1 @ 864x480 are practically the same size is because they have the same number of pixels.
True...
I didn't do a PAR 1:1 and even the source Mpeg2 had 2 rows of black stuff at the bottom which forced a slight resize (change in original PAR) of the 720 anamorphic transcode.
I chose 864x480 because the pixel-count is equal eventhough it's not 100% 16:9 (864x486).
However, resolution is only half the story and Mpeg2 bitrates have been boosted to cater for the stretch.
I was expecting X264 to boost the bitrate slightly more to help maintain colour and detail during the expansion process on playback.
A more thorough and exacting test could be next but I believe the results would be much the same.
:):devil::D
Pascal
*** ps ***
Each movie is so unique, similar and different that I certainly wouldn't recommend the same treatment for each... but
anamorphic encoding is certainly a usefull tool in your bag of tricks !
Perhaps, it's an example where the whole (DAResolution) is greater than the sum of the parts (original pixels) !
Gannjunior
25th March 2008, 16:10
so, guys...at the end...when i encode, should i have to think about the players upscaling "problem" or do i only think about usually important variables: resolution, saturation, CT etc ?
i explain me with an example. Let's think about new "generations" of backup encodes: backup a BD in 1xDVD5...keeping a couple of ac3 or e-ac3 audio languages, it is reasonable to think that you will achieve a resolution video encoding near 720p...in most cases.
Let's suppose to have a very compressable source that hypothetically should give us to get some 2pass AVC encoding like these:
1-1280x560 with medium Q of 15
2-1440x656 medium Q of about 19-20 (reasonably)
3-960x1040 medium Q of about 20
3rd hypothesis keeps the anamorphic height (only crop). of course the target container is mkv so that you can flag the correct AR.
So, since target size is DVD5...1st encode stuffs DVD5 but with Qmedium=15, a theorical CT >> 100% (using mpeg4 ASP we would have obtain something like 1.5 quantizers rip...)...So it is reasonable, conditions equality (given bitrate -our dvd5-), that we can achieve better perceptible quality rising the resolution (for example 2nd encode).
But i never considered the player work: i mean, let's consider 3rd case, that get a similar saturation level close to 2nd encode...3rd keeps 'intact' the height resolution ( that, according to H.V.S., larger influences our quality perception) but, presuming to reproduce it on 1920x1200 lcd, our player will have to do a big width resolution upscaling.
I hope to have enough explained myself...Which is the 'weight' I have to give to player unavoidable upscaling? which will be the best choice between 1,2,3 hypothesis ?
thanks in advance
Gannjunior
26th March 2008, 20:00
Any opinions ?
tnks :-)
delacroixp
27th March 2008, 11:22
Any opinions ?
I think that the issue is less about any 'upscalling problems" and more about getting the most bang for your buck !
Naturally, if you have an 1920x1200 lcd screen and your BD source is 1080p HD then you should aim for the maximum resolution an DVD5 will allow. Invariably it's a compromise between resolution and colour (more resolution, fewer no of colours... and vice versa).
Try 1-pass CQ-crf 17 to 20 starting at 720p... to get a feeling for the results of your particular movie (2-pass will do everything automatically without you really knowing what happened).
Once you've decided on a suitable resolution... do a 2-pass to maximise the DVD (if necessary).
Have a good one !
:):devil::D
Pascal
QUEENFAN
9th June 2008, 14:46
A very interesting thread.
I'm just changing from AutoGK (nearly everything is done automaticaly) to AutoMKV (you can do everything yourself) as Encoding-GUI for the future. I want to convert some of my (original) TV-Series-DVD-Boxes (16:9 AR) as well as Full-HD DVD-HD's to xvid/AVI or x264/mkv.
One thing that concerns me most at the moment is the best AR for my encoded file/container. So I have to decide wether crop the source together with a resize to preserve 16:9 for my destination or manually crop and do an anamorphic encode.
Maybe you can help me with this decision for the future ;-))
Thanks a lot in advance.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.