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 > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th April 2017, 12:24   #21  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
I forgot to mention it earlier but try this calculator. When you enter the cropping it calculates the new display aspect ratio for you as well as calculating the aspect error if you happen to be resizing. Plus it can help to wrap your brain around aspect ratios.

YodaResizeCalculator.zip
hello_hello is offline   Reply With Quote
Old 19th April 2017, 12:41   #22  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
I thought I'd accidentally deleted it, but I found it hiding when I looked again. It's a newer version of the calculator that as far as I know was never officially released, but it includes mpeg4 in the drop down PAR list.

YodaResizeCalculator 0.4.0.1.zip
hello_hello is offline   Reply With Quote
Old 19th April 2017, 14:01   #23  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
I had a look at the elevator clip. Taking the elevator floor at the end of the clip as a reference circle it appears that the the pixel aspect ratio is indeed slightly off the kilter. It seems to be 1.125 rather than 1.09 (12:11). But as Hello_Hello mentioned the perspective could be misleading.
You can try the following script (which doesn't crop anything) to get the circle exactly back for both 4:3 playback and for PAR signalling:

Code:
DirectShowSource("C:\......\VTS_02_2_2.MPG")
tdeint(mode=1,order=1)  #bob (deinterlace) the interlaced clip before resizing
spline36resize(720,546).addborders(0,14,0,16)
Now encode with --sar 16:15.

Have fun!

P.S.
And be careful with MeGUI for setting the --sar 16:15. Don't select Bluray-Compatibility, otherwise the --sar 16:15 will always and silently be overwritten by 12:11, even though you set Force SAR 16:15.

Last edited by Sharc; 19th April 2017 at 18:39. Reason: P.S.
Sharc is offline   Reply With Quote
Old 19th April 2017, 16:40   #24  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by Logan9778 View Post
...I downloaded Mpeg2cut2 that will cut and pull out clips of the Mpeg2 stream from the .vob .....
Just for your info: you can extract a segment from a .vob with DGIndex as well. Simply select the range with the brackets [.......] and save.
Sharc is offline   Reply With Quote
Old 20th April 2017, 08:10   #25  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
I refer to my post #23 here.
Thinking about it, the Pixel Aspect Ratio of your uploaded elevator clip VTS_02_2_2.mpg is 1.125 which is 9:8. This is exactly the inverse of NTSC 4:3 Generic PAR of 8:9 !
So either something has been messed up when this DVD was transferred from NTSC to PAL in an attempt to restore it to square pixels or whatever, or mpeg2cut2 (which I don't use) did some processing (resizing) of the original .vob.
Any idea?

Edit:
So you could actually encode with x264 --sar 9:8 without any resizing. It works, but it is beyond any standard. If your player follows the --sar the playback will be undistorted. However, when you force 4:3 playback you will get a distortion of about 6%. Therefore I recommend to resize it properly e.g. according to post #23.

Last edited by Sharc; 20th April 2017 at 08:44.
Sharc is offline   Reply With Quote
Old 20th April 2017, 08:45   #26  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Sorry, nope! I don't think the cutter did anything. Things in this video are just freaking strange. Some circles seem 1.333 or very close. Other's seem to be about 1.45 DAR. Its like they cut out parts of other video and stuck them in. Like it's been photoshopped. And yeah, I get the feeling this is not from original film, or if its even a standard PAR. How did you get the 1.125 par? I was wondering about that.

I did finally see how you guys are using Yoda's Resize Calculator. I never understood the calculators till now. What is the benefit of resizing though? I do see a very slight amount of noise and data loss from the resize.

Last edited by Logan9778; 20th April 2017 at 08:49.
Logan9778 is offline   Reply With Quote
Old 20th April 2017, 09:20   #27  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by Logan9778 View Post
How did you get the 1.125 par? I was wondering about that.
2 methods here:

Method 1: (quick and dirty)
- Navigate to the picture with the circle e.g. with DGindex.
- with a pixel ruler, measure the horizontal and vertical diameter of the "circle" (ellipse)
- Divide the vertical by the horizontal => PAR
For your clip I am getting approx. 356/316 = 1.127

Method 2:
- Stretch the picture horizontally e.g. via Avisynth until the ellipse becomes a perfect circle,
e.g. spline36resize(x,576) #your original height is 576 pixels
- change x until you get a nice circle (check with pixel ruler or overlay a true circle)
- PAR=x/original width (in your example the original width is 720)
For your clip I got a circle for x=810 => PAR = 810/720=1.125

You can do similar with VirtualDub of course. Just be a bit careful with "any" player as it may do some unwanted processing.

Last edited by Sharc; 20th April 2017 at 09:25.
Sharc is offline   Reply With Quote
Old 20th April 2017, 09:37   #28  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by Logan9778 View Post
... What is the benefit of resizing though?
For example:
- Make it look the same (undistorted) for forced DAR or PAR signalling playback (post#23)
- Make it compliant with a video standard (resolution, PAR ....)
- Crop off dirty borders or head-switching noise; add the borders back or resize for standards compliance.
- make it playback device compatible
Sharc is offline   Reply With Quote
Old 20th April 2017, 09:50   #29  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
Quote:
Originally Posted by Logan9778 View Post
I did finally see how you guys are using Yoda's Resize Calculator. I never understood the calculators till now. What is the benefit of resizing though? I do see a very slight amount of noise and data loss from the resize.
Technically encoding anamorphically is probably the best method (crop & set the original SAR, no resizing) as after cropping it encodes the remaining video "as-is".

Technically the next best method would be to resize to square pixels by stretching the width but without resizing the height (after cropping).

Third best would be to resize to some other square or anamorphic pixel dimensions.

Don't forget the calculator can help you crop to a particular aspect ratio (ie 4:3). You don't have to resize, and if you're not, just ignore the calculated aspect error (it doesn't apply) and set the original SAR.

The only disadvantage to anamorphic encoding is if you have a player that ignores aspect ratios in MKV/MP4 files. The media player in my TV ignores them, as does one of the Bluray players in my house (when playing video via USB), so I resize everything to square pixels. That way there's no worrying about it always displaying correctly.

I find for interlaced content you can usually get away with resizing down a bit (after de-interlacing). It's a bit like 1080i vs 720p. You can usually de-interlace the former and resize down to 720p without losing much detail, if any. By resizing down you generally save some bitrate for a given CRF value, or you can use a lower CRF value and increase the encoding quality. If all resizing down costs you is noise, that's probably not a bad thing.

And I quite like the sharpening effect that can result from resizing with Spline36, most of the time.
https://forum.videohelp.com/threads/...ty#post2444902

They're probably the main pros and cons. However you prefer to do it is probably the right way.

Last edited by hello_hello; 20th April 2017 at 10:04.
hello_hello is offline   Reply With Quote
Old 23rd April 2017, 07:25   #30  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Thanks guys! In the end, I decided to just keep doing what I was, as Plex seems to not try and force 4:3, and keeps the video at aspect as-is, with just cropping.
Logan9778 is offline   Reply With Quote
Old 28th May 2017, 21:46   #31  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Hey guys, if anyone is interested, just found something neat. The old Gspot program will tell you the PAR of a VOB file. Just confirmed the old Doctor Who is indeed 16:15 PAR.
Logan9778 is offline   Reply With Quote
Old 28th May 2017, 22:44   #32  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
We are all tool believers, aren't we?
As has been said many times there is no tool which can determine the PAR (PixalAspectRatio) of a DVD reliably because it is neither written in the stream nor in the container nor anywhere else.
So what GSpot probably does is it applies the formula PAR=DAR/SAR. In your case PAR = 4:3/(720:576) = 16:15. That's all, but not the whole truth and is typically misleading as soon as borders are added. There is no other way to find out the true PAR than the circle (or square) test as shown in previous posts.
Sharc is offline   Reply With Quote
Old 28th May 2017, 23:13   #33  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Yeah, but the more and more I look at the DVD, I'm becoming convinced it's 16:15. Unfortunately, the circles in it are just all over the place, ratio wise.

I've pretty much given up with the circles in it. I'm just trying to make the MKV and the original VOB look the same in MPC.

Edit: Eh, your probably right, crazy MPC looks like its gone back to displaying the DVD at 12:11 now. Ugh. But I did just manage to find a circle looking straight at me. Like someones looking through a scope in a video game. Now to try and measure it. I'm having problems with Photoshop, but I just saw MATLAB has a program to pick out perfect circles. I will try to see what that does.

Last edited by Logan9778; 29th May 2017 at 00:12.
Logan9778 is offline   Reply With Quote
Old 29th May 2017, 06:41   #34  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
Don't forget those old Doctor Who episodes aren't the originals. Probably little of the original video tape survives. I was watching a DVD extra a while back explaining how episodes were filmed for distribution by playing the original video tape and literally pointing a film camera at a TV screen, and those films were sent to other countries for airing, where they were often cut for censoring etc. Many of the early episodes now come from recovered film recordings, a few are from very early home video recordings, and some from other sources, and not always the same source per episode. I think the latest restoration process also includes some sort of frame/field interpolation to give them the original "video" look again, and from the little I've seen, under the circumstances the end result has been fairly good, but it isn't surprising the aspect ratio might have been fudged now and them.

The aspect ratio fudging seems a bit obvious in your samples, once you're looking for it, so maybe it's a pity nobody picked up on it, or maybe someone did before it was restored and originally it was much worse? Who knows.

I don't know where the aspect ratio information is stored on DVDs but sometimes a player will get it wrong if you're just opening the vob files directly. Some of the extras on your DVD would no doubt be 16:9.

Have you tried using Irfanview for the circle test? It doesn't "detect" circles as such but it has a "paint" plug-in that either comes standard or as part of the plugins pack. Probably most image programs have a similar function, but you can draw perfect circles by selecting the circle function and holding down Ctrl+Shift while you drag the mouse, so you can click on the centre of an object that should be round and drag the mouse to draw a perfect circle around it. Holding down shift while dragging with the rectangle function selected draws perfect squares.
hello_hello is offline   Reply With Quote
Old 29th May 2017, 10:36   #35  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
I remembered the name of the interpolation process they use. It's called VidFIRE (Video Field Interpolation Restoration Effect). According to Wikipedia, it's not used for much else aside from old Doctor Who.

I'll confess I'm somewhat dubious as to how effective it'd be for those old Doctor Who episodes though. Even after restoration they're still quite noisy and there's plenty of motion blur so I don't know if it'd make much difference. I guess the way to find out would be to de-interlace one with QTGMC to 25fps and then again to 50fps to see if it's easy to tell them apart.

The couple I've seen were actually NTSC DVDs where they'd taken the freshly restored video and field blended them for 29.970fps, and that looked really good....
hello_hello is offline   Reply With Quote
Old 30th May 2017, 03:22   #36  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Yeah, thanks. These old movies are just a hot mess. Circles seem all over the place. They'll look right at 12:11 PAR and then look bulged in another spot. I guess all DVDs are 16:15 PAR at FAR x PAR = DAR, or at least seem to be. Just gives you 4:3.
I'm still trying to understand ITU and Non-ITU. As far as I can guess, I'm guessing that the ITU ones are the old DVDs that were meant for CRT TVs with rectangular pixels and 704 horizontal display. So the video is stretched to 720 with 704 horizontal showing the whole video and the black bars going off the screen as overscan. With non-ITU, the whole video is supposed to be shown in the 720 horizontal with no overscan. Anyone know if I'm right? Really trying to understand why ITU and non-ITU are different.

QTGMC is really nice. It does a great job clearing up some of the noise and garbage when you set it to Placebo, and really doesn't take up that much CPU.

And yeah, I think a LOT of these old videos are from video tape and broadcasts captured from TV. Not film. I have a Faulty Towers DVD that has horrible ghosting because you can tell its from some old captured broadcast where the signal bounced and hit the antenna a couple of times.
Logan9778 is offline   Reply With Quote
Old 30th May 2017, 09:40   #37  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
The way I understand it, the analogue ITU spec is the basis for determining the PAR when sampling an analogue signal and converting it to digital (there's no pixels in an analogue image). The upshot is, only 704 of the width ends up contributing to the 4:3 aspect ratio, so you'd crop 8 pixels from each side and what's left would be 4:3.
For PAL, I think it works out to roughly a width of 703 and a PAR of 59/54, which doesn't work in the digital world so 704 and 12/11 are used instead.

Digital square pixel sampling would use 4:3 worth of square pixels, ie 768x576, and I guess that's where the difference is, because if you resize that to 720x576, then resize it back on playback using the ITU method you end up with 786x576, so it's slightly stretched.

This is an interesting read, at least in respect to 4:3 analogue vs digital. http://lurkertech.com/lg/video-systems/#pixelaspect

I tend to go with mpeg4 or ITU PARs for 4:3 and generic PARs for 16:9.
I've compared quite a few old PAL 16:9 DVD encodes resized to square pixels based on a non-ITU PAR (64/45) with newer HD versions, and I can only recall a couple of times where there was an ITU vs non-ITU difference in the aspect ratio. Mostly, they've been the same.
The 4:3 DVDs I have tend to be video sources originally and are most likely ITU. Film transferred to 4:3 DVDs might very well be a different story, along with old sources such as Doctor Who that've gone through an extensive digital restoration process.

Last edited by hello_hello; 30th May 2017 at 09:59.
hello_hello is offline   Reply With Quote
Old 30th May 2017, 11:06   #38  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
About Sampling Rate and Pixels see also here.

https://forum.doom9.org/showpost.php...3&postcount=17

Actually (or unfortunately) studios can squeeze and distort a picture almost to their liking. As long as they pad it with borders to standard DVD resolution and declare its DAR as either 4:3 or 16:9 no player will ever complain.
Sharc is offline   Reply With Quote
Old 30th May 2017, 16:05   #39  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
Now I've read it again, the way the currently used PARs are explained on the page I linked to seems to be easy way to look at it.
It says the industry had settled on a convention of sampling analogue 480i at exactly 12 3/11 MHz, and 576i at exactly 14.75 MHz, so because the ITU spec says a line contains exactly 720 pixels, the sampling rates being used in the real world are divided by the sampling rate in the ITU spec for the real world PARs.

For NTSC that's 12 3/11 MHz / 13.5 MHz = 10 / 11 (640*11/10=704)
For PAL that's 14.75 MHZ / 13.5 MHz = 59 / 54 (768*54/59=702.9) which I assume for mpeg4 would be the "fudged" to 12/11 to round it to 704.
hello_hello is offline   Reply With Quote
Old 31st May 2017, 01:04   #40  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Thanks guys! I THINK I'm beginning to understand it now! Let me mull over this new info.

Edit: I'm working on one of my Fawlty Towers DVDs and it has 16 pixel wide black bars on both sides. So I re-calculated PAR assuming 688 pixels width was the actual video, and came out with 48:43 PAR. 12:11 never did look exactly right. Circles are looking a lot better! I'm beginning to think some of the time, wider or thinner bars than 8 pixels wide might mean a custom PAR. I just can't believe how they did whatever they felt like in putting these videos to DVD. Even the old CRTs wouldn't have played some of them at correct AR.

Thanks again for the info! It sure gives me a new way of looking at PAR.

Last edited by Logan9778; 31st May 2017 at 05:53.
Logan9778 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:50.


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