VideoHelp Forum




+ Reply to Thread
Results 1 to 30 of 30
  1. Im trying to crop, letterbox and resize to 1440x1080p in Hybrid. The problem is, Hybrid is adding the black borders after resizing, so my video is coming out as 1452x1100.

    Image
    [Attachment 78143 - Click to enlarge]


    When I try to move the resize filter after letterboxing in the filter order I get this message.

    Image
    [Attachment 78142 - Click to enlarge]



    Can anyone let me know where Im going wrong here?
    Quote Quote  
  2. Your requirement is conflicting (input SAR, output SAR, output frame size, padding)

    Try this or post a sample of your source
    Image
    [Attachment 78145 - Click to enlarge]
    Last edited by Sharc; 4th Apr 2024 at 11:02.
    Quote Quote  
  3. Sorry not with my pc at the moment to post sample but the input is 720x576 (SAR 12:11?), cropped and padded to 704x576 and then resize to 1440x1080.

    I dont get why its adding padding onto the target resolution, shouldn't padding be added after crop before resizing?
    Quote Quote  
  4. Originally Posted by Leanoric View Post
    I dont get why its adding padding onto the target resolution, shouldn't padding be added after crop before resizing?
    To avoid fuzzy transitions it is good practice to add the pads at the end rather than to include them in the resizing. And the final resizing would alter the SAR of the active picture incorrectly.
    Selur may have the correct answer though.
    Last edited by Sharc; 4th Apr 2024 at 11:42.
    Quote Quote  
  5. Sorry, only just seen the example you posted earlier. I did originally think of something similar, that if I resize to 1428x1060 then the final video would be 1440x1080, but surely that cant be the right way of doing it?
    Quote Quote  
  6. If your cropped active picture is like in your case 692x556 with a SAR of 12:11 (which is correct for a PAL VHS capture as cropping does not change the SAR) and you upscale to square pixels, the upscaled active picture becomes

    either: 1440x1061 (which you may want to pad vertically (=letterbox) to 1080 to get a frame size of 1440x1080)
    or: 1466x1080 (nothing to pad, but you may now want to crop the width to 1440 to get 1440x1080, loosing some picture content on the sides).

    In either case the SAR of the upscaled active picture is converted to 1:1 (=square pixels).

    Anything else leaves you with a distorted active picture (some non-standard anamorph SAR).

    Trust in Hybrid

    Note: SAR = Sampling Aspect Ratio which is the same as PAR = Pixel Aspect Ratio.
    Last edited by Sharc; 4th Apr 2024 at 13:33. Reason: Note added
    Quote Quote  
  7. (I always use PAR = pixel aspect ratio; not picture aspect ratio)
    Avisynth and Vapoursynth do not care about aspect ratios, nor do they have any representation for them.

    In Hybrid the filter order is always:
    1st crop
    2nd rotate
    3rd resize
    4th letterbox
    If you want to a different order: Do not use Hybrid.
    Forcing this order makes it easier to be sure PAR-conversions/handling is correctly handled.
    (I thought about this quite a while when I started writing Hybrids predecessor.)

    In theory, you could change their order, by it would complicate the math a lot, especially if you need to take into account stuff like (non-rgb an non-444) color spaces, interlacing, etc., while keeping errors small.
    There is no good reason to deactivate 'Auto adjust' if you understand the meaning of input&output PAR correctly.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  8. Ok gents, thanks for clearing that up.
    Quote Quote  
  9. You may want to practice with the attached 720x576 sample with an active picture (grey area) of 704x576 SAR 12:11.
    After processing take a (pixel) ruler and check whether the circle is a circle and the square is a square.
    Image Attached Files
    Quote Quote  
  10. Cheers Sharc, Ill give that a go.
    Quote Quote  
  11. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    @Sharc, I think there's something wrong with that video of yours. I opened it in VDub and set the display to 4:3. The frame edge comes out as exactly 4:3, but the square and circle are definitely not so. I've attached a screenshot.

    Image
    [Attachment 78153 - Click to enlarge]
    Quote Quote  
  12. You have to crop the green borders off to keep the grey 704x576 ("active picture") and play this as 4:3 (expanded to 768x576 by the player).
    The full 720x576 frame (including the green) simulates a 720x576 Rec601 capture (green instead of black pillars) where the inner 704x576 represent the 4:3 picture.

    Edit: Attached similar as an *.avi. The left and right between ~704 and 720 will normally be small black pillars (~8 pixels wide each side) for an analog tape capture acc. Rec.601.
    The inner 704x576 represent exactly the 4:3 picture (aka 768x576 when expanded by the player) for an undistorted circle/square. The full 720x576 picture (i.e. without cropping the green sidebars) must be displayed as 15:11=1.3636... (aka 786x576) rather than exactly 4:3=1.333... to get the circle/square right. The famous ~2.3% deviation.

    Note: SAR (Sampling Aspect Ratio) and PAR (Pixel Aspect Ratio) have the same meaning. They are (unfortunately) used interchangeably creating additional confusion, but the meaning is exacly the same, so SAR=PAR.
    Image Attached Files
    Last edited by Sharc; 6th Apr 2024 at 08:43. Reason: Note added
    Quote Quote  
  13. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Got it. That is actually a great explanation of this issue (the best I've seen), especially for people like me who are "AR" challenged. Take off the 2x8, then if any more cropping is required, crop in a 4:3 ratio. Thanks.
    Quote Quote  
  14. Originally Posted by Alwyn View Post
    .... then if any more cropping is required, crop in a 4:3 ratio.
    Yes if exact 4:3 really matters to you. Actually you can crop as you like when you encode with the correct SAR (12:11 for PAL) and the container supports SAR signalling (like .mp4 for example). Most players will read the SAR and play the circle and square correctly, even if the cropped picture deviates significantly from 4:3.
    One may also crop and pad back to 4:3 to keep the standard frame size of 704x576 intact. It's called masking. Often useful for masking the head switching crud for example.
    One may want to practice all this with my 2 test files.
    Last edited by Sharc; 5th Apr 2024 at 07:02.
    Quote Quote  
  15. I agree, knowing the correct sample/pixel aspect ratio is the main thing.
    (not to be confused with storage and picture aspect ratios )
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  16. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Prompted by this post by Oln:

    https://forum.videohelp.com/threads/403635-Panasonic-DVD-recorder-passthrough-settings...13#post2731037

    I've done an experiment. I made a 768x576 image, put it into my NLE, made a DVD of it then played the DVD on the ES-15 and recorded the Composite on my VHS/DVD combo.

    I concluded that the black side bars are part of the frame, and when the video is displayed as 4:3, the picture ratio with the black bars is correct. If I were to crop off the black side bars, I could not resize to 768x576 SAR 1:1 because the picture would then be distorted, meaning that if one wants to set up a square-pixel file, one simply crops in the 4:3 ratio ie the 2 x 8 pixels on the sides should be treated a part of the picture.

    I've attached my test video, as well as two others which have a circle shape (I think!). They show that you shouldn't crop off the black side bars in isolation if you want a square-pixel file.

    If one wants to use the various unique SARs, then Sharc's methods are appropriate.
    Image Attached Files
    Quote Quote  
  17. deleted (double post)
    Last edited by Sharc; 14th Apr 2024 at 06:58. Reason: deleted
    Quote Quote  
  18. Originally Posted by Alwyn View Post
    Prompted by this post by Oln:

    https://forum.videohelp.com/threads/403635-Panasonic-DVD-recorder-passthrough-settings...13#post2731037

    I've done an experiment. I made a 768x576 image, put it into my NLE, made a DVD of it then played the DVD on the ES-15 and recorded the Composite on my VHS/DVD combo.

    I concluded that the black side bars are part of the frame, and when the video is displayed as 4:3, the picture ratio with the black bars is correct. If I were to crop off the black side bars, I could not resize to 768x576 SAR 1:1 because the picture would then be distorted, meaning that if one wants to set up a square-pixel file, one simply crops in the 4:3 ratio ie the 2 x 8 pixels on the sides should be treated a part of the picture.

    I've attached my test video, as well as two others which have a circle shape (I think!). They show that you shouldn't crop off the black side bars in isolation if you want a square-pixel file.

    If one wants to use the various unique SARs, then Sharc's methods are appropriate.
    Your first 2 examples have a SAR (Sampling aspect ratio, aka PAR) of 16/15. Playing these at DAR 4:3 (1.3333) including borders returns the circles correctly.
    The first example has a SAR of 16/15 by your design (768/720=1.0666... =16/15). It doesn't represent an analog Rec.601 capture.
    The 3rd example has a SAR of 12/11. Playing it forced as 4:3 gives a DAR error of 2.3% with a slightly squashed circle. Playing it with the SAR of 12/11 returns a perfect circle and the overall (including borders) DAR of 1.3636.... Cropping the borders (remaining frame 702x576) and playing a 4:3 would return the circle correctly.
    The 3rd example is what one would expect when capturing analog VHS tapes acc Rec601.

    In any case, for undistorted playback all you have to apply is the correct SAR, see post#15

    And btw. it has little to do with "Sharc's method". It's about understanding and applying the concept of anamorphic (non-square pixels) video.
    Last edited by Sharc; 14th Apr 2024 at 07:16. Reason: Typos + clarifications
    Quote Quote  
  19. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thanks Sharc, I've got a 7 pixel error on the red Mortein file, which I'll put down to my screen ruler.

    Out of interest, when you say "Playing it with the SAR of 12/11", how do you actually do that? VDub has some presets but none of the ones you use.
    Quote Quote  
  20. Originally Posted by Alwyn View Post
    Thanks Sharc, I've got a 7 pixel error on the red Mortein file, which I'll put down to my screen ruler.

    Out of interest, when you say "Playing it with the SAR of 12/11", how do you actually do that? VDub has some presets but none of the ones you use.
    Good point. Vdub uses 59:54 = 1.0926 instead of 12/11 = 1.0909.... Other sources use 1150/1053=1.09212.
    59:54 is the Rec. 601 approximation (~702 active width for PAL). 12/11 is the "more practical" mpeg4 approximation (=704 active width, mod 16 compliant) of the true exact value (analog signals have no pixels, the exact value ends up in fractions of pixels). Nothing to worry. All are good for practical use, but may occasionally cause additional confusion.
    Quote Quote  
  21. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thank you.
    Quote Quote  
  22. Originally Posted by Alwyn View Post
    I've done an experiment. I made a 768x576 image, put it into my NLE, made a DVD of it then played the DVD on the ES-15 and recorded the Composite on my VHS/DVD combo.

    I concluded that the black side bars are part of the frame, ...
    What happend is:
    - Your 768x576 4:3 picture (by design) was anamorphically squashed to 720x576 by your NLE for DVD compliance. Means the SAR was changed from 1/1 to 16/15 due to the rescaling by the NLE: 768/720=16/15=1.0667
    - Playing your DVD back via ES-15 ignored (masked) any content >702 wide (means cropped the yellow picture left and right to ~702x576, Rec.601 compliant). See my post here:
    https://forum.videohelp.com/threads/413492-Missing-pixels-with-s-video-vs-firewire-cap...e2#post2725356
    - The GV-USB2 captured correctly 720 pixels wide, means the 704x576 got "padded back" to 720 by adding "black". Padding (adding borders) does not change the SAR, so the SAR is still 16/15.
    Note that your experiment did not simulate a real analog tape capture with a SAR of 12/11 (for PAL) according Rec601. Your 3rd sample (Mortein ...) is a real analog capture though.

    (SAR=Sampling Aspect Ratio, same as Pixel Aspect Ratio PAR).
    Last edited by Sharc; 15th Apr 2024 at 09:12.
    Quote Quote  
  23. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    The GV-USB2 captured correctly 720 pixels wide, means the 704x576 got "padded back" to 720 by adding "black".
    That agrees with my "I concluded that the black side bars are part of the frame". Provided I crop the sides and vertical in the 4:3 ratio (without specifically compensating for the 2x8), I will produce a properly "aspected" file at 768x576 (or 1440x080). Which is, of course, counter to what I said in #13!

    Note that your experiment did not simulate a real analog tape capture with a SAR of 12/11 (for PAL) according Rec601.
    Well, at all stages, when I set the display to 4:3, I got a perfect circle. If stuff got chopped off the sides by the DVD player and then added later by the digitiser, does it matter? At every point in the process, the video presented the correct "aspect" ie a perfect circle when displayed at 4:3. That's all I want.
    Quote Quote  
  24. Originally Posted by Alwyn View Post
    If stuff got chopped off the sides by the DVD player and then added later by the digitiser, does it matter?
    It may matter to some because real picture content is chopped off and then replaced by black borders. You just don't immediately see what got chopped off from your yellow background example.
    At every point in the process, the video presented the correct "aspect" ie a perfect circle when displayed at 4:3. That's all I want.
    Yes, but at the cost of removed (masked) active picture material on each side (~8 original picture pixels each side get cropped off and are replaced by black which must be included in your 4:3 playback.
    As I wrote, the example is not representative for an analog VHS capture as your source is a 720x576 DVD. It proves though that the ES-15 crops the 720 picture to ~702. That's just how the ES-15 works.
    Do your exercise with a real 720 wide DVD picture and you will see that the capture out of the ES-15 (S-video or composite) is slightly cropped on the sides.
    Last edited by Sharc; 15th Apr 2024 at 13:58.
    Quote Quote  
  25. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    "Covering" the 8 pixels on the sides by the ES-15 has already been established (see oln's post linked above).

    The inner border is 20 pixels in, the outer border is 10 pixels in:

    Image
    [Attachment 78400 - Click to enlarge]


    The inner 704x576 represent exactly the 4:3 picture (aka 768x576 when expanded by the player) for an undistorted circle/square. The full 720x576 picture (i.e. without cropping the green sidebars) must be displayed as 15:11=1.3636... (aka 786x576) rather than exactly 4:3=1.333... to get the circle/square right.
    But the 2x8 pixels are part of the active picture and cannot simply be cropped away and then the image stretched back to 720 (or "expanded to 768 by the player") without inducing distortion. IOW, the "active picture" is not 704x576, at least not in this case. The active picture is the whole image, 720x576, and it should be displayed at 4:3.
    Quote Quote  
  26. Originally Posted by Alwyn View Post
    But the 2x8 pixels are part of the active picture and cannot simply be cropped away and then the image stretched back to 720 (or "expanded to 768 by the player") without inducing distortion. IOW, the "active picture" is not 704x576, at least not in this case. The active picture is the whole image, 720x576, and it should be displayed at 4:3.
    We don't disagree on this. What I was pointing out is that your example does not represent a VHS tape capture. It is a "capture" of a digital DVD source prepared by your NLE with its inherited SAR of 16/15. Therefore the border issue manifests differently.
    Quote Quote  
  27. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by Alwyn View Post
    I concluded that the black side bars are part of the frame, and when the video is displayed as 4:3, the picture ratio with the black bars is correct. If I were to crop off the black side bars, I could not resize to 768x576 SAR 1:1 because the picture would then be distorted, meaning that if one wants to set up a square-pixel file, one simply crops in the 4:3 ratio ie the 2 x 8 pixels on the sides should be treated a part of the picture.
    1. So you would have to resize to 785(786)/576 to have the correct picture at PAR 1:1?
    2. So your DVD's PAR is 16:15?
    Quote Quote  
  28. Originally Posted by rgr View Post
    1. So you would have to resize to 785(786)/576 to have the correct picture at PAR 1:1?
    768x576 including the borders
    2. So your DVD's PAR is 16:15?
    Yes, IMO.

    As I understand Alwyn's original picture is a 768x576 (=4:3) yellow canvas with an exact circle/square within, SAR=1/1 (all square pixels).
    His DVD recapture "Circle inside 768x576 Frame Sanyo GV snip.avi" is 720x576 including side borders and has a SAR of 16/15 which was introduced by the NLE creating his 720x576 test DVD. The black side borders were eventually introduced by the ES-15 and the GV-USB2 recapture process. The overall frame of the recapture including the black side borders is now 720x576, SAR 16/15. Because the SAR is 16/15 the picture has to be stretched horizontally (or shrunk vertically) according to its SAR to display the circle/square correctly. 16/15x720 = 768 including the borders, circle undistorted. 768/576=4:3 exact. This is the same as playing it forced by the player as 4:3. But now the yellow is 746x576 only rather than the original 768, means the original picture has been cropped/masked and padded back by the ES-15 and subsequent recapture.
    There is nothing wrong with Alwyn's experiment. It's just different from what normally happens with a analog tape capture acc. Rec.601 using the ES-15 in passthrough which would capture at SAR=12/11 (approx.) without cropping into the picture as can readily be concluded from his 3rd sample (Mortein ...avi). Therefore the different origin and impact of the borders.

    Note: SAR (Sampling Aspect Ratio) = PAR (Pixel Aspect Ratio) in other notation.
    Last edited by Sharc; 18th Apr 2024 at 06:20.
    Quote Quote  
  29. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by Sharc View Post
    Originally Posted by rgr View Post
    1. So you would have to resize to 785(786)/576 to have the correct picture at PAR 1:1?
    768x576 including the borders
    If the image is 720x576 (704x576 + borders) and the PAR should be 12:11, then with a PAR of 1:1 it should be 786x576.

    So the conclusion is (also based on another thread) that all(?) recorders (whether DVD or MP4) incorrectly cap video with PAR 16:15, even though they should with PAR 12:11.
    Last edited by rgr; 22nd May 2024 at 06:27.
    Quote Quote  
  30. Originally Posted by rgr View Post
    Originally Posted by Sharc View Post
    Originally Posted by rgr View Post
    1. So you would have to resize to 785(786)/576 to have the correct picture at PAR 1:1?
    768x576 including the borders
    If the image is 720x576 (704x576 + borders) and the PAR should be 12:11, then with a PAR of 1:1 it should be 786x576.
    Yes, for a capture of analog video the PAR is ~12/11 for PAL. Including the side borders makes the frame 12/11x720=786 wide, and the DAR becomes 786/576=1.36 rather than 1.333....
    A commercial or self-made DVD may have a different PAR though following the DVD standard rather than Rec601. DVD doesn't even specify the PAR explicitely, but only the DAR (like 4:3, 16:9), and many 4:3 DVDs play the active picture 2.3% squashed.

    So the conclusion is (also based on another thread) that all(?) recorders (whether DVD or MP4) incorrectly cap video with PAR 16:15, even though they should with PAR 12:11.
    I don't know what ALL devices do, however, if they follow Rec.601 for the capturing of analog video the sampling frequency must be 13.5MHz, which for PAL results in a PAR of 59/54 (aka ~12/11 or 1150/1053) even though some devices may crop into the picture or add any borders. Cropping and padding do not change the PAR. However, if the devices apply some internal resizing or use some odd proprietary sampling frequency the PAR will change accordingly.
    (PAR=Pixel Aspect Ratio).
    Last edited by Sharc; 22nd May 2024 at 07:38.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!