VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 35
Thread

Threaded View

  1. This forum has been tremendously helpful in answering nearly all of my questions about setting up converting my families old vhs tapes to digital, however I'm still a little stuck on the aspect ratio part.

    Firstly, I'm using a Diamond VC500 with composite cables connected to my VCR and the video itself was recorded in 1992. I recorded some test footage with VirtualDub2 with the uncompressed format at 720x480 which is the native resolution of the capture card. The quality looks great, however I know that VHS is 4:3 aspect ratio and 720x480 is 3:2, so I went down the rabbit hole of aspect ratios and learning about DAR and PAR and I'm still a little confused about the subject, and while all this stuff doesn't really matter for my purposes, it's been fun learning about it so I'd like to do it properly.

    So I understand that standard definition horizontal pixels were wider than vertical pixels so this is where I'm a bit stuck. I've used ffmpeg to convert the video to 4:3 aspect ratio using the command
    Code:
    ffmpeg -i test.avi -acodec copy -vcodec copy -aspect 4:3 test.mkv
    and when I open up the file in a few media players and pixel count horizontally the image is in fact showing up as 640x480 which is 4:3, but from what I've read from here and here is that for proper scaling of the analog source the resolution should be 654x480, and from what I've read ffmpeg can't adjust the pixel aspect ratio without lossy transcoding, which I'd like to avoid. Also, not all software obeys adjusting the aspect ratio like this, so this might not be the best way, although I have found the mkv container to be more reliable at forcing video players to recognize the correct aspect ratio than sticking with avi.

    I tried using mp4 box because I've read both here and elsewhere that I can properly adjust the PAR and I tried
    Code:
    mp4box test.avi -out test3.mkv -par 1=10:11
    but I just keep getting "Error: Bad Parameter" and I've been unable to get around that.

    Not only that, but a lot of what I'm reading about with how to scale analog standard definition sources to monitors doesn't seem to translate fully to my specific case because most of it is dealing with sources that have more defined resolutions like consumer DVDs, while my source seems to have a few quirks so I'm not sure how to translate the aspect ratio. Let me explain

    Here's a screenshot from my recording: https://i.imgur.com/glDGu5P.png

    As you can see, there's a single 1 pixel border at the top along, a 2 pixel border on the bottom with what I think is supposed to be 16 pixel borders on the edges, but depending on how I count it can be off by a bit. Is this normal? From what I've seen there shouldn't be a border at the top and bottom, but does it even matter? If it does how should I deal with it?

    I am probably overthinking this and the ffmpeg method is probably close enough to the original source when viewed on a modern screen, but if even just for my own curiosity I'd like to make sure I am doing it properly.
    Quote Quote  
  2. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Actually, there are supposed to be 8-pixel borders left and right while the active picture area takes 704 pixels. That is the digital spec. But signals and converters vary so you can get different results. To complicate matters, your snapshot appears to be stretched horizontally (unless that infant has an unusually flat head). As for FFmpeg, you can supply the precise ratio you want, viz. -aspect 654:480.
    Quote Quote  
  3. The image appears stretched because that's a screen capture from the original 720x480 recording, not one of my resizes. I tried your suggestion and the new aspect ratio does change the look a little from my normal resize. However, in the video properties for MPC-BE it shows 720x480 (109:80) and when I screen capped it the image is 654x480, but that ratio doesn't make much sense. It's supposed to be 10:11 isn't it?

    Here's some screenshots

    Original 720x480 record with no corrections: https://i.imgur.com/p82ywWZ.png

    720x480 capture adjusted to 4:3 with ffmpeg: https://i.imgur.com/zjpr7KO.png

    720x480 capture adjusted to 654:480 with ffmpeg: https://i.imgur.com/0PVCEKT.png
    Quote Quote  
  4. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Yeah normally I would crop the 720x480 down to 704x480 (trying to just crop out the black bars), and then resize down to 640x480. Or just keep the cropped 704x480 and flag the display ratio as 1.333 (4/3).

    Cropped down to 704x480 ==>640x480. Normally this would get rid of just about all the black bars but your sample has more than my usual.
    Image
    [Attachment 48445 - Click to enlarge]
    Last edited by KarMa; 18th Mar 2019 at 00:08.
    Quote Quote  
  5. Originally Posted by KarMa View Post
    Yeah normally I would crop the 720x480 down to 704x480 (trying to just crop out the black bars), and then resize down to 640x480. Or just keep the cropped 704x480 and flag the display ratio as 1.333 (4/3).

    Cropped down to 704x480 ==>640x480. Normally this would get rid of just about all the black bars but your sample has more than my usual.
    Image
    [Attachment 48445 - Click to enlarge]
    I tested doing this by taking my original 720x480 image and cropping it so that it was 704x480 and resized it to 640x480 and unchecked maintain aspect ratio (i'm using paint.net) and I got this: https://i.imgur.com/gslUCox.png

    It looks very similar to my 654x480 image which makes sense, but in essence besides the aforementioned issues with some video players is it worth going with this method?
    Last edited by aera; 18th Mar 2019 at 02:22.
    Quote Quote  
  6. Member dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Paris Ca, 92345 Mexico
    Search PM
    I kept the original resolution with no cropping 720x480, I used -aspect 4:3 with no problems but my output was mp4 though, Yours is mkv. I also used setsar=sar=8/9 and worked with software and hardware with perfect 4:3 ratio. Give both a shot and see.
    Quote Quote  
  7. Then there's the crap along the bottom he might want to crop away, along with the remaining black bars. Then he might get an accurate 640x480 resize out of it. Or he can set a proper SAR before encoding. I haven't played with the picture.
    Quote Quote  
  8. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Originally Posted by manono View Post
    Then there's the crap along the bottom he might want to crop away, along with the remaining black bars. Then he might get an accurate 640x480 resize out of it. Or he can set a proper SAR before encoding. I haven't played with the picture.
    Then you are vertically stretching unless you are cropping out the head switching noise and replacing it with just black for 640x480.
    Quote Quote  
  9. Originally Posted by KarMa View Post
    Then you are vertically stretching unless you are cropping out the head switching noise and replacing it with just black for 640x480.
    Maybe, but I was also cropping the remaining black which would stretch it less vertically, if at all. Personally, I'd never leave any black behind after cropping if it could be helped. As I said, I haven't played with the picture.

    As far as 654x480, I not sure why one would go that route unless you plan on cropping down to 640x480. 704x480 is supposed to be the video portion on a capture device, so I feel it's better to crop down to 704x480 first then resize to 4:3.
    He should have written 656x480 which is, indeed, how the 720x480 source should be resized when using ITU resizing. But, again, I'd much prefer removing all the black as well as the head-switching noise.
    Quote Quote  
  10. Footnote: The VHS capture is probably interlaced. If so, be careful with cropping vertically (mod4) and don't resize without bob-deinterlacing first.
    Quote Quote  
  11. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    It's really up to you. If you plan on giving this video out it might be less hassle to just have a more standard 640x480 as the final video. Or you can do 704x480 but set flags to have the player play it like a 640x480, even though the video is still 704x640. Not every player will follow the DAR so it's not 100% friendly to normal people, but you may potentially save a small amount of resolution by keeping 704x480. As far as 654x480, I not sure why one would go that route unless you plan on cropping down to 640x480. 704x480 is supposed to be the video portion on a capture device, so I feel it's better to crop down to 704x480 first then resize to 4:3.
    Quote Quote  
  12. Yeah after reading a bit more and thinking about it I think cropping to 704x480 and then resizing to 4:3 is the best bet especially considering that I do plan on giving this video out and sharing it to family members who are not at all going to be interested about aspect ratios or anything like that. Some will probably ask why the picture doesn't fill the whole screen .

    However, one of the reasons why I was going with my previous method is I was having trouble figuring out how to trim the edges of my video. I tried using MeGUI, but I couldn't quite figure out how to use it. I've been using this thread a lot for info which KarMa posted in, but I was unable to reproduce the steps. I'm probably just missing something simple.

    Also yeah the footage is definitely interlaced when I copied it, as right now it's just a raw uncompressed AVI because I wanted to make sure my work flow was setup properly. I tested de-interlacing in VLC and I could see the interlacing artifacts go away. I was going to get to de-interlacing eventually, but at some point here I read somewhere not to de-interlace because it's a destructive process, but I've read from others like Sharc that I should, and if I'm going to make sure the video looks the best with minimal interaction from the user/video player than I think it makes sense.

    So what's the best way to do those things, and if possible do them all in one go so I can smooth out my workflow?

    In my research I did run intothis guide, however when I followed the steps to change aspect ratio using
    Code:
    ffmpeg -i test.avi -vf scale=640x480,setsar=1:1 sq_output.mp4
    the output is way overcompressed, and ffmpeg didn't seem to like it when I tried to do it losslessly or I was messing something up.
    Quote Quote  
  13. You can deinterlace/crop/resize in ffmpeg:

    Code:
    ffmpeg -y -i input.avi -vf yadif=3:1:0,crop=704:480:8:0,scale=640x480,setsar=1:1 -pix_fmt yuv420p -vcodec libx264 -crf 18 output.mp4
    The second value in yadif is the field order. 1 is bottom field first, 0 is top field first. Use the appropriate setting for your source.
    Quote Quote  
  14. Thank you very much for that. I'm still trying to get the hang of ffmpeg but I'm getting better. I'm wondering what the set sar=1:1 is supposed to do, however. Since the resolution is scaled to 640x480 using that set sar value wouldn't just be multiplying 640x480 by one which wouldn't do anything? I double checked the video outputs with one with setsar=1:1 kept and the other removed and they looked identical. The only difference was a 17 byte increase in file size when setsar was added.
    Quote Quote  
  15. I started with your command line and added the deinterlacing and cropping commands. I wasn't sure if ffmpeg would keep the sar of the source or not, so I left setsar=1:1 there.

    And yes, in the absence of sar information players usually assume sar=1:1.
    Quote Quote  
  16. Banned
    Join Date
    Mar 2019
    Location
    USA
    Search Comp PM
    It is hard to tell without having the product. Could it be the combination of an over-scan/under-scan setting along with the aspect ratio? It seems like some of the cheap USB options might be a pain to set up. I always use Generic DV-25 Fire Fire converters for capturing VHS without any issues.
    Quote Quote  
  17. Member dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Paris Ca, 92345 Mexico
    Search PM
    Why don't you just use mp4, I've converted 720x480 AVI lossless videos without cropping to mp4, just flagging them for 4:3, They played in two LG TV's, one iPhone and one Android phone in perfect 4:3 with black pillars, no stretching.
    Quote Quote  
  18. Originally Posted by dellsam34 View Post
    I've converted 720x480 AVI lossless videos without cropping to mp4, just flagging them for 4:3, They played in two LG TV's, one iPhone and one Android phone in perfect 4:3 with black pillars, no stretching.
    Although the differences are slight and you might not be able to tell and I even do it myself from time to time, doing it that way does not produce a 'perfect 4:3'. Using ITU resizing, to get perfect 1.33:1 playback from VHS tape sources you should start with 704x480 (remove the black bars on left and right). By leaving the black bars on, the video becomes very slightly squeezed (people are slightly too tall and thin).
    Quote Quote  
  19. Member dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Paris Ca, 92345 Mexico
    Search PM
    Originally Posted by manono View Post
    Although the differences are slight and you might not be able to tell and I even do it myself from time to time, doing it that way does not produce a 'perfect 4:3'. Using ITU resizing, to get perfect 1.33:1 playback from VHS tape sources you should start with 704x480 (remove the black bars on left and right). By leaving the black bars on, the video becomes very slightly squeezed (people are slightly too tall and thin).
    I'm 100% sure it was a perfect 4:3 aspect ratio because the video has circles and I literally measured them on the screen horizontally and vertically and they checked out just like when they are played back straight from the VCR.
    Here is an easy trick to know if you have a perfect 4:3 converted file using VLC, Playback the video and toggle between original and 4:3. If you see the slightest deformation then it is not a true 4:3 conversion, If none of the pixel moved then you have a perfect 4:3 aspect ratio. In original mode VLC uses the aspect ratio flag, In 4:3 mode it ignores the flag and resize the frame accordingly. No deformation means the video has been properly flagged.
    Last edited by dellsam34; 22nd Mar 2019 at 21:14.
    Quote Quote  
  20. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Matting is always so much safer.
    Quote Quote  
  21. Originally Posted by lordsmurf View Post
    Matting is always so much safer.
    But you didn't say "so much more correct", so you don't seem to actually disagree. Safer how? Not all players will play 704x480 as 1.33:1? DVD players have to. And players that supposedly honor 4:3 signalling but won't resize 704x480 sources properly are flat-out wrong and shouldn't be used. Or so it seems to me.

    But, as I said, it's hard to tell as the differences are slight. Dellsam34 said "perfect". It's not "perfect", and you don't seem to disagree with me. If dellsam34 had said "close enough", I wouldn't have posted.
    Last edited by manono; 23rd Mar 2019 at 21:08.
    Quote Quote  
  22. You only proved VLC (which I wouldn't use for determining correct aspect ratios to begin with) uses the same method both ways, not that they are correct and accurate. I already said (twice) that the differences are slight. In addition, the player might not do it right and/or the television might not do it right. If you have a 704x480 source with your 4:3 flagging then the circles might not be round when they should be, if the source is a VHS tape which is supposed to use ITU resizing and if played using VLC to your television:

    Digital video processing

    As stated above, ITU-R BT.601 specified that standard-definition television pictures are made of lines of 720 non-square pixels, sampled with a precisely specified sampling rate. A simple mathematical calculation reveals that a 704 pixel width would be enough to contain a 480i or 576i standard 4:3 picture:

    A 4:3 480-line picture, digitized with the Rec. 601-recommended sampling rate, would be 704 non-square pixels wide.
    https://en.wikipedia.org/wiki/Pixel_aspect_ratio#Analog-to-digital_conversion
    Quote Quote  
  23. monono is correct. The 4:3 image in a 720x480 ITU capture is contained in a 704x480 portion of that frame. Extra pixels are captured to the left and right in case the capture is off center. That makes the entire 720x480 frame about 2 percent wider than 4:3, about 1.3636 vs. 1.3333. This is the international standard for NTSC video capture (with PAL it's about a 702x576 portion of the 720x576 frame). Some very old capture devices don't adhere to this standard).
    Quote Quote  
  24. Member dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Paris Ca, 92345 Mexico
    Search PM
    There is also extra pixels captured on top and bottom of the screen that are not part of the actual video frame which makes up for that horizontal 2% stretch.
    Quote Quote  
  25. No, the 704x480 already accounts for that.
    Quote Quote  
  26. Member dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Paris Ca, 92345 Mexico
    Search PM
    Originally Posted by jagabo View Post
    No, the 704x480 already accounts for that.
    480 includes head switch lines, Vertical burst, Caption, Macrovision ...etc, All that junk is included in the 480 lines, otherwise it wouldn't be captured with the capture card. So the active video frame is about 702x460.
    Last edited by dellsam34; 23rd Mar 2019 at 22:36. Reason: miss spell
    Quote Quote  
  27. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    I remember when I started posting and asking questions on this site almost a decade ago. Not much has changed here---people here, instead of using layman's terms to help the layman, they use a bunch of bullshit jargon, wind up talking to each other instead of the one requesting the help, and just basically make people not want to continue with their video projects anymore. You people just take away the desire to continue with ANYTHING video-related, seriously! I think I'm going to go back to lordsmurf's site.
    Quote Quote  
  28. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by unclescoob View Post
    I remember when I started posting and asking questions on this site almost a decade ago. Not much has changed here---people here, instead of using layman's terms to help the layman, they use a bunch of bullshit jargon, wind up talking to each other instead of the one requesting the help, and just basically make people not want to continue with their video projects anymore. You people just take away the desire to continue with ANYTHING video-related, seriously! I think I'm going to go back to lordsmurf's site.
    And what have YOU added, besides useless bile? You are quite welcome to take your attitude elsewhere. And by the way, your assertions are disproved by the very first line of the OP.

    Originally Posted by aera View Post
    This forum has been tremendously helpful in answering nearly all of my questions about setting up converting my families old vhs tapes to digital
    Quote Quote  
  29. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Hmmm, JVRaines, I've never heard of YOU before here. Then again, my last time here was probably 2013 or so. You just might be the one to actually provide some type of revival in this place. You seem to have good character too, standing up to me like that. Unlike my nephews, "Man-Oh, no!" and "Jag-a-Bleh", who generally just babble jargon all over the place. Perhaps you may be able to help me with an old project. In return for your services, I can provide you with a good variety of entertainment in this place my good fellow.
    Quote Quote  
  30. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    JVRaines, I just downloaded virtualdub and can't get the P.O.S. to open ANYTHING. And when I say anything, I mean it won't even open my mpeg-2. But...um....I thought this was the whole point of virtualdub, to open MPEG-2s. Go on, tell me I have to go hunting for another stupid code pack to install in it because um...it couldn't just be included in it???

    Which is as intelligent to me as me going to the car dealership, and being told that I have to purchase the engine separately.
    Quote Quote  



Similar Threads