Sorry, double post.
+ Reply to Thread
Results 61 to 81 of 81
-
Progressive YV12 video has chroma planes that are half the size of the luma plane. So a 720x480 YV12 video has a 720x480 luma plane (Y, greyscale) and 360x240 chroma planes (U and V, colors added or subtracted from the greyscale image). If you wanted to crop one pixel off the width, making it 719 pixels wide, you'd have 359.5 pixels in the chroma planes. But you can't have half pixels. So you must crop an even number of pixels. 718x480 would be fine with a 718x480 luma plane and 359x240 chroma planes.
-
Ah, that makes sense, thanks.
Ok, so I attempted to use the resize script because I realized that if I cut off borders, I'd get a different size than the original 720x480. So I added that size into the settings:
And the result seems wider (?) than the original unless I'm seeing things? Am I resizing it wrong after the cropping, how do I make it exact (should I be resizing)?
The file is attached. Btw I used this guy's method of turning the script into MP4 using his preset and WinFF. Would you say this way is okay or not as good as your x264 route? -
You didn't account for the sample aspect ratio or display aspect ratio when you encoded. That's why your picture is too wide. You should set the SAR (x264 setting) to 10:11 or the DAR (container setting) to 4:3.
-
You didn't account for the sample aspect ratio or display aspect ratio when you encoded. That's why your picture is too wide. You should set the SAR to 10:11 or the DAR to 4:3.
Anywhere to do it in here? I don't see any part stating SAR or DAR. -
As I said, it's an encoder or muxer settings. I'm not familiar with WinFF. You'll have to look for a guide that tells you the format to use.
-
you are changing vertical resolution and resizing, so why not resizing to square pixel right away instead , anything that gives 4:3, like 640x480 or 720x540, so no SAR settings in encoder or muxer needed
or
you might try crop(8,0,-8,0) and no resize getting 704x480, setting SAR 10:11,..., that 704x480 is also DVD friendly resolution,.., having 4 pixels of black , that is fine in a picture, if it is not just nice black (VHS capture) , crop those 4 pixels and then pad black 4 pixels in Avisynth right back -
Yes, after that crop 720x480 is the wrong resize. It should really be 706x480. Or, on a variation of _Al_'s suggestion, resize to 704x480 and set the 10:11 SAR in the encoder. Or resize to 640x480 directly after the crop and use a 1:1 SAR.
-
you are changing vertical resolution and resizing, so why not resizing to square pixel right away instead , anything that gives 4:3, like 640x480 or 720x540, so no SAR settings in encoder or muxer needed
you might try crop(8,0,-8,0) and no resize getting 704x480, setting SAR 10:11Yes, after that crop 720x480 is the wrong resize. It should really be 706x480. Or, on a variation of _Al_'s suggestion, resize to 704x480 and set the 10:11 SAR in the encoder. Or resize to 640x480 directly after the crop and use a 1:1 SAR.
Can you tell me what you guys use to encode Avisynth files with x264 and muxing? Jagabo uses a 'batch file' method with x264.2692.x86.exe and a line of code that I don't understand since they never explained it.
Also would you recommend encoding to x264 if you're dealing with lossless huffyuv capture files and you want to downsize for shareable sizes? Is there another similar codec to go to or is x264 the standard? -
Code:
DAR = FAR * SAR
FAR = frame aspect ratio, the frame dimensions
SAR = sampling aspect ratio distance between pixels horizontally and vertically
Think of SAR as the shape of individual pixels (it's sometimes called PAR, pixel aspect ratio).
Most capture devices follow the ITU spec where the 4:3 image is captured in a 704x480 frame with (optionally) 8 extra pixels at the left and right edges in case the picture is a little off center. The SAR for that is 10:11. So if you crop a total of 16 pixels off the left and right edges you're left with a 704x480 frame and:
Code:DAR = FAR * SAR DAR = 704:480 * 10:11 DAR = 704/480 * 10/11 DAR = 704 * 10 / 480 / 11 DAR = 1.333... DAR = 4:3
Code:DAR = FAR * SAR DAR = FAR * 1:1 DAR = FAR * 1 / 1 DAR = FAR
When you encode your video you have two choices: you can resize to square pixels (the player will assume DAR = FAR), or you avoid resizing and flag the SAR (the player should do the appropriate math to get the proper DAR).
Some players (for example those found in some TVs that can play MP4 files on USB flash drives) ignore the SAR flags and display all videos as if DAR = SAR. So it's safest to resize to square pixels. But resizing can lose quality and create artifacts.
In your earlier script you cropped down to 700x476. You could just specify the SAR as 10:11 and let the player handle the resizing. Or you can calculate the correct square pixel frame size and resize yourself:
DAR = FAR * SAR
DAR = 700:476 * 10:11
DAR = 700/476 * 10/11
DAR = 700 * 10 / 476 / 11
DAR = 1.3369
Since your frame height is 476 the proper width is 476 * 1.3369, about 636 pixels. So resizing to the 700x476 frame to 636x476 would give the correct aspect ratio. -
To oversimplify it (not counting your screen resolution or resolution of your player window) --> SAR is a number, flag, that if player finds it in video, it multiplies horizontal resolution by it.
So in your case horizontal resolution is 704, so 704 * 10/11= 640
So you see, those 640x480 (4:3) , square pixel, you get on screen with that SAR flag, correct proportions on screen, circle is really a circle, not ellipse. So even if video footage is not square pixel, which VHS, DV avi, HDV is (it could be called anamorphic video) it is shown on screen proportionally correct even if it is not stored like that.
To understand it even better. Most familiar to you is DVD, it is always stored in 720x480 (NTSC) and only that "flag" in it on DVD decides what you are going to actually see. 4:3 video or 16:9 video. Everything is stored in 720x480 (or 704x480).
Resize is done after crop. If resize is done at all. -
You can resize before cropping. In fact it can make the AR calculations much simpler. Say you have a 704x480 4:3 DAR video and you want to crop visually (to remove black borders or whatever). You already know that the full frame resized to 640x480 gives the right aspect ratio. So if you resize first and crop the black borders you don't need to make any AR calculations. No matter how much you crop, the remaining picture has the right aspect ratio.
-
Yes, op works with a special case where aspect ratio is known. That cropping has to follow some rules as well, you discussed it already, I was afraid op would crop to a weird size.
Trying to write a script that crops and resizes, it forces one to actually do that in that order - resize and then crop. Talking about Blu-Ray, but principle is the same. 1920x1080 is resized to 1280x720 and then Autocrop.dll generates crop line getting 1280x536 or something depending on wMultOf, hMultOf. -
Ok, phew that was a lot to take in and I"m trying to make sense of it all, thanks guys.
Here is what I did last night before going to bed:
Code:avisource("test elgato 4.avi") Spline36Resize(640,480) AssumeTFF() ColorYUV(cont_u=47, cont_v=118) ConvertToYV12(interlaced=true) QTGMC() Sharpen(0.21, 0.0) Crop(6,4,-6,-6)
Okay, so now my exported file (through WinFF, where I changed no aspect settings or anything) is 628x470 (attached file). Is this a bad ratio to stay at since it's uneven due to the 4 at the top vs. the 6 at the bottom like I said? Would it screw up playback on a device, TV, DVD/Blu-ray player?
Or when I'm done with the cropping in that code I posted, should I cap it off with another resize to 640x480 in AvsP? Would that make things worse since I'd be "stretching the pixels or picture" once again but this time from a smaller state of 628x470?
Side-question: This hasn't been answered yet so I just want to make sure. The definitive, absolute correct and only aspect ratio that Hi8, 8mm, VHS-C and VHS tapes should be in is 4:3 aka 640x480, right? Meaning every tape I capture, which will be received in 720x480, should be ultimately converted to 640x480 (or an equal variation of it, 4:3, accounting for cropped pixels). -
You don't have to crop evenly on both/all sides. But I recommend you avoid mod2 frame sizes, and stick with mod4 or larger. Most codecs and devices can handle mod2 these days but a lot of older device don't. You don't want to find that the TV or media player you buy next year chokes on half your video files because you encoded mod2. So what if there's a pixel or two of black border at the edge of the frame. Or you'll never notice a missing few rows or colums if you crop a bit more.
Another issue is what you plan to do with the videos. If you plan to make DVDs for example you are restricted to certain frame sizes. 720x480, 704x480, 352x480 and 352x240 for NTSC video.
I've never seen a VHS tape that was any aspect ratio other than 4:3. Though it's certainly possible that some might have been 16:9 -- especially in PAL regions which had widescreen TVs long before the US. -
But I recommend you avoid mod2 frame sizes, and stick with mod4 or larger. Most codecs and devices can handle mod2 these days but a lot of older device don't. You don't want to find that the TV or media player you buy next year chokes on half your video files because you encoded mod2.
Also I just learned how to encode it out into x264 inside of AvsPmod, and I see these options:
I think this is what you were talking about. Say that I crop it out to a weird size again, 706x480, all I would have to do for it to turn into the correct aspect ratio and turn it into 640x480 is select NTSC 4:3 - 10:11? No matter what it will change it's aspect ratio to 640x480 and nothing else? And what's the difference between that one and NTSC VCD - 10:11, should I ever use the latter?
I've never seen a VHS tape that was any aspect ratio other than 4:3. -
Mod stands for modulus, another term for absolute value. Basically mod2 is a number that is evenly divisible by 2 with no fractions or decimal places left over. A mod4 number can be evenly divided by 4. Note that mod4 automatically means it's also mod2.
Example: 8 can be evenly divided by 2.
8/2 = 4, which is mod4 and a whole number with no remainder. Therefore 8 is mod2 and mod4, and is also mod8 (8/8=1)
Many encoders and decoders work on a mod8 basis, the reason being that encoding/decoding is often based on 8x8 pixel blocks. You'll encounter some Avisynth filters that won't work on a frame that isn't at least mod8 in all dimensions.
Many common video formats use mod16 frame sizes: 480, 576, 704, 720, 1280, and 1980 are all mod16 numbers. Two common HD frame sizes that don't use all-mod16 frames are 1920x1080 and 1440x1080. 1080 is not mod16. But it is mod8.
Some people take a 720x480 video and make it 854x480 to get 16:9. Notice that 854 is not mod16, mod8, or mod4. It's mod2. The safe compromise is 856x480. 856 is mod8.
I don't use AvsPmod.Last edited by LMotlow; 20th Apr 2016 at 08:36.
- My sister Ann's brother -
For video purpose the mod is the largest power of 2 (2, 4, 8, 16, 32...) by which the number is divisible by giving an integer result. 720 is mod16: 720/16=45, but 720/32=22.5, so not mod32. 718 is mod2: 718/2=359, 718/4=179.5 so not mod4.
In the past, some codecs have required mod 8, 16, or even 32. But almost all modern media players, software or hardware, will accept mod4. Most will accept mod2 but the difference between mod4 and mod2 is small so just be safe and shoot for mod4.
That's the idea. No matter how much you crop, setting the PAR to 10:11 will cause the player to display the remaining picture with the right aspect ratio. But that's not necessarily a 4:3 frame. For example if you cropped down to 352x480 the picture will display with 2:3 frame but the aspect ratio of objects within that frame will be drawn with the proper aspect ratio. Eg, a circle will still be a circle, a square still a square. -
Thanks for the explanations, that makes sense.
I don't use AvsPmod.
That's the idea. No matter how much you crop, setting the PAR to 10:11 will cause the player to display the remaining picture with the right aspect ratio. But that's not necessarily a 4:3 frame. For example if you cropped down to 352x480 the picture will display with 2:3 frame but the aspect ratio of objects within that frame will be drawn with the proper aspect ratio. Eg, a circle will still be a circle, a square still a square.
And if I crop off from the top and bottom of my 720x480 capture, would adding Spline36Resize(640,480) at the end stretch it out (the top and bottom) and make things slightly worse quality since I removed some of the frame height and I'd be stretching it up? For the width I'd be stretching things together so there'd be nothing lost there or altered.
Or would a better idea be to keep the file as is, say 628x470, and add the 10:11 in encoding?
Does the former method "stretch out the top and bottom" and quality during Spline36Resize since my height would already be lower than 480 due to the cropping? Or would the latter be a better idea? -
-
I see...so now going off of the question that I ended my last post with, which way would be better for me to do? If it's 628x470 with 10:11 encoding, that's still bad since the 470 would only be a mod2, right? Would a better choice be to re-size it up to 640x480 inside avisynth or would that "stretch things out" and degrade quality, even if slightly?
Simply put:
* 628x470 to 640x480 (which would be re-sizing and stretching up) with 1:1
or
* 628x470 with 10:11
Which is better, more ideal, compatible, no quality lost, etc.
Similar Threads
-
Capturing VHS-C, Hi8 and DV tapes, but which FINAL format for viewing?
By joeman in forum Video ConversionReplies: 11Last Post: 14th Nov 2014, 09:08 -
Suggestions for Capturing from Various Sources - Beta, VHS, 8mm, Hi8
By tdehnke in forum Capturing and VCRReplies: 11Last Post: 2nd Sep 2014, 08:12 -
How do I use VirtualDub to capture 8mm/camcorder VHS tapes?
By Duder_Me in forum Capturing and VCRReplies: 23Last Post: 27th Jun 2014, 08:30 -
Have old VHS & Hi8 tapes; Want to convert to DVDs on Mac or PC.
By MacPCConsultants in forum Capturing and VCRReplies: 35Last Post: 30th Apr 2012, 23:56 -
Beginner's Approach to Digitizing VHS/Hi8 Tapes?
By Obtong in forum Newbie / General discussionsReplies: 8Last Post: 10th Jul 2011, 22:08