View Full Version : aspect ratio question
BabaG
13th November 2015, 23:56
i used the following to up-res and ivtc a quicktime file with great results and one issue:
QTInput("name_of_movie_file.mov")
TFM()
TDecimate()
nnedi3_rpow2(rfactor=4, cshift="Spline36Resize", fwidth=1440, fheight=1080)
the original help i was given, and thanks again to all for that, it looks great, suggested i use 'rfactor=3'. that gave me an error saying that nnedi had to be a multiple of two or something similar so i just changed it to 4 and it ran and came out looking very good.
the issue is the aspect ratio. the file produced by the above script is decidedly more square looking than the original. when i look at the file properties in the quicktime movie inspector it shows me that the file is:
720x486(640x480)
i was under the impression that this is a 4x3 format. i made my up-res to 1440x1080, also 4x3. when it's on the screen, though, it looks much more square, as i say. any thoughts on what i've done wrong, ommitted, or how i can get the up-res to display similarly, aspect-ratio-wise, to the original. like i say, the rest of the process looks great.
edit:
an additional piece of info, final cut shows me the original file's pixel aspect as 'ntsc - ccir 601.'
it shows the up-res file as pixel aspect 'hd(1440x1080)'
the original footage was a 24fps film telecine made to proreshq and interlaced to 29.97fps.
thanks,
BabaG
Reel.Deel
14th November 2015, 00:33
720x486(640x480)
i was under the impression that this is a 4x3 format. i made my up-res to 1440x1080, also 4x3. when it's on the screen, though, it looks much more square, as i say.
Not necessarily, it can also be anamorphic. If that's the case then try 1920x1080 to see if it looks any better. My bad about the rfactor=3 suggestion, I must of had a long day.
BabaG
14th November 2015, 00:37
thanks, Reel.Deel. no problem about the rfactor. like i said, just changed a number and it looks great.
the material in question is definitely not anamorphic, though. stretching it to 1920x1080 would certainly overdo it. i was thinking there may be a par or dar setting i should be using to interpret the incoming footage? any thoughts on that? anyone else?
thanks again,
BabaG
Reel.Deel
14th November 2015, 00:41
Try MediaInfo (http://www.videohelp.com/software/MediaInfo) to see if it gives you a bit more information. If possible load a small unprocessed sample or screenshot.
BabaG
14th November 2015, 01:32
editing post for clarity:
i made my conversions in two steps. first i used the avisynth script to make an uncompressed avi via virtualdub. then i converted that avi back to a new proreshq quicktime file. there are, therefore, three files:
1 - the original proreshq telecine at sd
2 - the uncompressed avi run through avisynth to ivtc and upres
3 - the final proreshq from the avi
both the avi and final quicktime look 'square-ish.'
the mediainfo for the original file:General
Complete name : E:\receiving\movie.mov
Format : QuickTime
Format/Info : Original Apple specifications
File size : 6.85 GiB
Duration : 15mn 3s
Overall bit rate mode : Variable
Overall bit rate : 65.1 Mbps
Encoded date : UTC 2015-04-21 17:29:09
Tagged date : UTC 2015-04-21 17:29:09
Writing library : Apple QuickTime
Video
ID : 1
Format : ProRes
Format version : Version 0
Format profile : 422 HQ
Codec ID : apch
Duration : 15mn 3s
Bit rate mode : Variable
Bit rate : 59.2 Mbps
Width : 720 pixels
Clean aperture width : 704 pixels
Height : 486 pixels
Clean aperture height : 480 pixels
Display aspect ratio : 4:3
Clean aperture display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 29.970 fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:2
Scan type : Interlaced
Scan type, store method : Interleaved fields
Scan order : Bottom Field First
Bits/(Pixel*Frame) : 5.642
Stream size : 6.23 GiB (91%)
Writing library : apd0
Language : English
Encoded date : UTC 2015-04-21 17:29:09
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601
matrix_coefficients_Original : BT.601
Other
ID : 2
Type : Time code
Format : QuickTime TC
Duration : 15mn 3s
Time code of first frame : 01:00:00:00
Time code, striped : Yes
Language : English
Encoded date : UTC 2015-04-21 17:29:09
Bit rate mode : CBR
and for the up-res avi:General
Complete name : E:\receiving\movie.avi
Format : AVI
Format/Info : Audio Video Interleave
Format profile : OpenDML
File size : 94.2 GiB
Duration : 15mn 3s
Overall bit rate : 895 Mbps
Writing library : VirtualDub-MPEG2 build 24600/release
Video
ID : 0
Format : RGB
Codec ID : 0x00000000
Codec ID/Info : Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised. 16, 24 and 32bpp contain raw RGB samples
Duration : 15mn 3s
Bit rate : 895 Mbps
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 4:3
Frame rate : 23.976 fps
Bit depth : 8 bits
Bits/(Pixel*Frame) : 24.000
Stream size : 94.2 GiB (100%)
and, just for good measure, the conversion to proreshq quicktimeGeneral
Complete name : E:\receiving\movie____ProResHQ_1440x1080p_2398fps.mov
Format : QuickTime
Format/Info : Original Apple specifications
File size : 14.1 GiB
Duration : 15mn 3s
Overall bit rate mode : Variable
Overall bit rate : 134 Mbps
Encoded date : UTC 2015-11-13 20:55:04
Tagged date : UTC 2015-11-13 22:14:30
Writing library : Apple QuickTime
Video
ID : 1
Format : ProRes
Format version : Version 0
Format profile : 422 HQ
Codec ID : apch
Duration : 15mn 3s
Bit rate mode : Variable
Bit rate : 134 Mbps
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:2
Scan type : Progressive
Bits/(Pixel*Frame) : 3.581
Stream size : 14.1 GiB (100%)
Writing library : Apple
Language : English
Encoded date : UTC 2015-11-13 20:55:04
Tagged date : UTC 2015-11-13 22:14:30
Matrix coefficients : BT.709
hope there's something useful here.
thanks,
BabaG
MysteryX
14th November 2015, 05:55
AviSynth only supports square pixels, while your video has a different aspect ratio.
The way I handle this is by programmatically using MediaInfo.DLL, and reading "PixelAspectRatio" on the video stream returns something like "1.067".
I'm not seeing that value in your MediaInfo report. See if you can get that specific value.
Then you must resize your video stream to apply the pixel aspect ratio.
BabaG
14th November 2015, 07:52
thanks for the reply, MysteryX.
the reference in post 4 from Reel.Deel is the first i've heard of mediainfo. i just downloaded the gui and opened my files and exported the info to text files which i copied to my post.
i see from the mediainfo site that there are multiple versions available:
http://mediaarea.net/en/MediaInfo/Download/Windows
these include a dll. when you say that you use the mediainfo dll programatically, are you saying that you call it somehow from an avisynth script and feed some of the info back to the script? a bit of sample code would be very helpful.
should i try using the dll directly to get pixel aspect ratio info? not sure how to do that. i can download the dll tomorrow when i'm back in front of that computer. where does the dll get placed? in avisynth folder? in windows system or system32?
sorry for the obtuseness but haven't dealt with this kind of thing before.
thanks again,
BabaG
BabaG
14th November 2015, 08:23
ok. this seems like it should work and i'll try it tomorrow:
dar = (w / h) * par
that would be:
1.333 = (720/486) * .9
since quicktime seems to be assuming a .9 par, that would translate to a conversion to 1600x1080 in order to display at 4x3.
BabaG
MysteryX
14th November 2015, 08:39
I wrote a software that's handling these details for me; unless you program softwares, you won't want to use the DLL. But I would assume that the exact same information should be available from their GUI version.
MysteryX
14th November 2015, 08:56
In your case it's very simple. It says 4:3 display ratio. If you're not doing any cropping, then simply resize it so that it has a 4:3 ratio. Period.
vivan
14th November 2015, 11:08
since quicktime seems to be assuming a .9 par, that would translate to a conversion to 1600x1080 in order to display at 4x3.No, this is the result of assumpting that video is not anamorphic. With 0.9 you get 1440x1080 (since you started with 4:3 - you ended with 4:3).
DVD's are weird. They define aspect ratio after cropping (or actually sample aspect ratio that does not depent on cropping). For NTSC 4:3 sar is 10:11 (which makes 704*10/11=640 x480 from 704x480, and which results in 654x480 for uncropped 720x480).
With this sar you'll get 1472x1080 for 720x480 or 1454x1080 for 720x486.
It might be easier to just crop to 704x480 if it's 704x480 padded to 720x486 with black bars, then it should become 1440x1080.
BabaG
14th November 2015, 22:43
thanks for the info vivan but i don't get it at all.
i did do a short test, exporting at 1600x1080 and it appears to match my original just about perfectly for aspect ratio. problem is the quicktime player shows the properties as 1600x1080 and not 1440x1080. i've found no tools to adjust par or any other ar for quicktime files. it seems that without being able to pre-define par i always get something that displays as square-ish in the quicktime player, even when the dimensions are 4x3.
it looks like i need to be able to define this BEFORE i get to the conversion back to proreshq as the uncompressed avi also displays as square-ish. i need to be able to tell the conversion to avi that the resultant file has a par of .9.
BabaG
MysteryX
14th November 2015, 23:36
Ok I see what you're trying to do. You want to output your AviSynth video and then keep the same aspect ratio as the original file. Perhaps it can be done if there is an encoder parameter to override the aspect ratio... not sure how, or even if it can be done.
But since you're already processing and upscaling the video, why would you want to continue using non-square pixels? Transform all those non-square pixels into square pixels by stretching the image, and then the Quicktime encoder will have square pixels to work with. Simple and easy.
BabaG
15th November 2015, 00:19
thanks, MysteryX.
actually, i don't care either way about using non-square pixels or not. i just want the image to look the same only larger. that didn't happen with the script i used so i'm grasping at straws to try to get the new material recognized in the same way as the original: as 4x3, not square.
in looking for a solution, i came upon info about .9 being a par for similar material and my calculations, as well as a test export, showed that 1600x1080 looks like my original. 1600 is a number that corresponds to the .9 number.
i really don't care how i get there, i just would like to have a file in the same format, 4x3 proreshq, that looks like the original only with the benefits of ivtc and nnedi3 up-res. i just can't figure out why square pixels would be displaying as a square image in a 1440x1080 frame size. the more so when all of the file info seems to say 4x3 at every stage.
Transform all those non-square pixels into square pixels by stretching the image, and then the Quicktime encoder will have square pixels to work with. Simple and easy.
are you saying just make the up-res to 1600x1080 and forget about it? how do i transform the pixels to square anyway? a bit more detail would help here. you're dealing with a child when it comes to this stuff.
thanks again,
BabaG
MysteryX
15th November 2015, 01:14
AviSynth only deals with square pixels. If you're using NNEDI3 to upscale your video, then you downscale it back to a size that gives you the right proportions. If you're just using SplineResize or LanczosResize, then resize it to the desired dimensions. You determine the proportions of your video while you're resizing it.
BabaG
15th November 2015, 01:24
so, avisynth is looking at the .9 pixels as if they were 1.0 or square?
...then resize it to the desired dimensions. You determine the proportions of your video while you're resizing it. this is what confuses me. i thought that giving it a dimension of 1440x1080, which should translate to 4x3, the more so if the pixels are square, would give me a 4x3 image on screen. but it doesn't.
hello_hello
15th November 2015, 01:57
I'm not sure I understand where it's going wrong and I don't use proreshq, but either the video is wider than 4:3 and therefore when you resize to 4:3 worth of square pixels (ie 1440x1080) it looks a bit squished, or the resizing and the Avisynth 1440x1080 output is correct, and therefore the problem is the player you're using isn't displaying the source correctly.
720/486 = 1.481
1600/1080 = 1.481
1440/1080 = 1.333
There's no doubt several places in the process where there's a potential for the aspect ratio to go astray, but from what I've read here it seems to me there's a fair chance it's the source that's not displaying correctly, rather than the encoded video.
The MediaInfo GUI does a lot of aspect ratio rounding. In this case 4:3 is probably correct, but you could try opening the source with MPC-HC and using the File/Properties menu to see what it has to say, and/or how it displays the video.
As vivan previously mentioned, the 4:3 aspect ratio probably assumes a width of 704 and a height of 480, so if you're resizing the whole 720x486 it'll end up a bit wider than 4:3 (you'd probably use the appropriate MPEG4 PAR from the table here (https://www.doom9.org/showthread.php?p=1058927#post1058927)), but I suspect even though the quicktime movie inspector indicates it's 4:3, you're not seeing the source being displayed that way.
this is what confuses me. i thought that giving it a dimension of 1440x1080, which should translate to 4x3, the more so if the pixels are square, would give me a 4x3 image on screen. but it doesn't.
That's just it.... if the Avisynth output is 1440x1080 it has to be displaying with a 4:3 aspect ratio unless there's something odd going on, because 1440x1080 is 4:3. It's possible the player is for some reason resizing the encoded video incorrectly on playback, and I assume it's possible the encoder is setting a pixel aspect ratio other than 1:1 for unknown reasons, but an anamorphic source displaying incorrectly seems more likely.
MysteryX
15th November 2015, 02:08
or do some research about pixel aspect ratio to get the exact pixel ratio value according to the standards
https://en.wikipedia.org/wiki/Pixel_aspect_ratio
vivan
15th November 2015, 02:08
in looking for a solution, i came upon info about .9 being a par for similar material and my calculations, as well as a test export, showed that 1600x1080 looks like my original. 1600 is a number that corresponds to the .9 number.No, you doing your math backwards.
720 * (1080/486) = 1600.
Then you apply your .9 sar (sample aspect ratio aka pixel aspect ratio, all those sar/par acronyms are unfortunately have several meanings) and end up with 1600 * 0.9 = 1440. Which, of course, makes it 4:3, because this was the whole point of choosing this sar.
i really don't care how i get there, i just would like to have a file in the same format, 4x3If 1440x1080 doesn't look like your original, then your original is not 4:3. Because 1440/1080 = 1.3333 = 4/3.
If you believe that 1600x1080 (which is 40:27) looks like your 720x486 original (which is exactly 40:27, but it's supposed to be anamorphic 4:3), then this is what resolution you need.
However 720x486 being non-anamorphic (means having square pixels) is highly unlikely (even MI says that it supposed to be 4:3). I believe that software you're using to view it (quicktime?) just ignores aspect ratio information and displays video as it is, which leads you to a wrong conclusions.
When you're not sure what aspect ratio your video has, you should find some round object in the video and figure out what aspect ratio it needs to stay round (change horizontal resolution in your script or just take screenshot and stretch it).
how do i transform the pixels to square anyway?Pixels are square if not stated otherwise. It's up to encoder to write this information into the stream (for example x264 has sar option (http://www.chaneru.com/Roku/HLS/X264_Settings.htm#sar), other encoders may have same kind of an option). If you don't need non-square (anamorphic) pixels, then just don't touch anything.
BabaG
15th November 2015, 02:40
i think you guys are on to something with the display of the original being off idea. i just went old-skool and put a tape measure to my monitor and am getting odd measurements from, not the avisynth media, but the original. it's coming up as 3:2. i'm out of time for this for today but will revisit, probably monday.
thanks for all the input on this. it's very frustrating. apple. gotta love 'em.
what i think i'll need to figure out is whether i should try to go with the 3:2 ratio or 4:3. not sure as this comes as something of a surprise.
thanks again,
BabaG
hello_hello
15th November 2015, 05:07
I'd be astounded if it's not supposed to be 4:3, but try the source with another player such as VLC or MPC-HC. They both have portable versions you can just download, unzip and run, no installation required.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.