VideoHelp Forum




+ Reply to Thread
Results 1 to 21 of 21
  1. Member
    Join Date
    Mar 2002
    Location
    Kirkland, WA
    Search Comp PM
    I've posted this question on Doom9 also, so I apologize if you've already seen this over there.

    I have some video that was recorded with a ReplayTV from the s-video 480i output of my Hughes HIRD-E86. The source was digital TV in 4:3 format but the E86 was setup for my 16:9 screen, so the video has black bars on each side as shown below.



    Can anybody give me a step-by-step (or point me to the right resource) describing how to crop out the black bars before using on a DVD?

    BTW, the video is MPEG-2 with the following characteristics:

    Resolution: 720 x 480
    Framerate: 29.97
    Bitrate: approx. 4000 Kbps VBR
    Audio: 48KHz @ 192kbps, MPEG-1 layer II

    Thanks,

    Tim
    Quote Quote  
  2. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    The only way to that what you want is to re-encode the file.

    No other way around it.

    Easy to do with TMPGEnc but if you use CCE then it has to be done with AviSynth or better yet try VirtualDub resize/crop filter then frameserve to CCE

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  3. Member
    Join Date
    Mar 2002
    Location
    Kirkland, WA
    Search Comp PM
    When I get done cutting it, it'll be a pretty short file so I don't mind re-encoding it in CCE. I've used avisynth and CCE before, but I've never tried the crop/resize filter. Is there any way you could give me an approximate script for me to fine tune?

    Thanks,

    Tim
    Quote Quote  
  4. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Originally Posted by tluxon
    When I get done cutting it, it'll be a pretty short file so I don't mind re-encoding it in CCE. I've used avisynth and CCE before, but I've never tried the crop/resize filter. Is there any way you could give me an approximate script for me to fine tune?

    Thanks,

    Tim
    Load the file into VirtualDubMod and use the RESIZE/CROP filter. Basically you want to see exactly how many lines or pixels you need to cut off of each side to remove the black. It should be equal but might be slightly different. Like the LEFT side but have a couple pixels more than the RIGHT etc.

    Report back here with those values and I'll give you the AviSynth commands you should use.

    Also I am assuming this is a 16x9 file and that the image only has black on the sides but not the top and bottom?

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  5. Member
    Join Date
    Mar 2002
    Location
    Kirkland, WA
    Search Comp PM
    Right - this is a 16x9 file and I only want to crop the right and left sides - not the top and bottom.

    Using the cropping option in the null transform filter, I get an X1 offset of 89 and an X2 offset of 98.

    Thanks for your help!
    Quote Quote  
  6. And you need to resize frame size after cropping...
    Quote Quote  
  7. Member
    Join Date
    Mar 2002
    Location
    Kirkland, WA
    Search Comp PM
    I only have about 15 minutes of video I was wanting to convert, but it's been a while since I ran a couple AviSynth scripts and I remember it taking a bit of experimenting. I see that there's a program called AviScript that can write AviSynth scripts for you and it sure looks like it would make this task much easier than manually creating the AviSynth script. Unfortunately, it appears that the free version has a 10 minute limit. Are there any other alternatives?

    Thanks,

    Tim
    Quote Quote  
  8. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    @ tluxon,

    by the way.. your source (PIC) is 643 x 361. And, that's very interesting.
    It has an Aspect Ratio of 1.78 (1.777777778) and funny how your device is
    rigging output as a 640x480 ratio. hmm.... makes me wonder why they
    are not outputing as 720 for DVD specs and things. Anyway..

    FWIW.. I have an app that shows Aspect Ratios (slider bars) and it gives you an
    aspect ratio reading in three flavors: (1.78; 1.85 and 2.35) but I lack one
    thing that's ben killing me. And that is, the reverse of that. Or, the conversion
    of the given AR. ie, if your source is indicated as 1.78, my app would convert
    to 4:3 (giving the Width and Height to use for conversion. I don't know what
    the formula is at this time. Anyways..

    -vhelp
    Quote Quote  
  9. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Hello

    Sorry for taking SO long in getting back to you but it took me a while to try and figure this out and unfortunately ...

    I think we have a SLIGHT problem!

    In trying to figure this out I decided to try and duplicate the type of file that you have.

    In other words a 4:3 image in a 720x480 MPEG-2 DVD spec 16x9 file.

    To do this I captured a 40 second clip from a LaserDisc so as to get a nice clean picture without all that garbage you get from the bottom of a VHS capture. I captured at 720x480 NTSC and the LaserDisc was a full frame 4:3 image.

    I then used the following AviSynth AVS script:

    Code:
    LoadPlugin("mpeg2dec3.dll")
    avisource("D:\test.avi")
    AddBorders(66,0,66,0)
    LanczosResize(720,480)
    Now what does this do?

    First I'm reading in the 4:3 clip that was captured at 720x480 then I am adding 66 of black to the left and 66 of black to the right to make the image size 852x480 then I am resizing to 720x480

    Why am I doing this?

    A 16x9 image is stored as 720x480 on a NTSC DVD but it gets "stretched" out to 852x480 on a 16x9 NTSC TV.

    So I am taking my 4:3 image and adding black to make it 852x480 so that it perfectly fits a 16x9 image (4:3 ratio intact with "dead" black space on the sides and the image perfectly centered).

    Now I'm making it 16x9 enhanced by resizing it to 720x480

    I then encoded this to MPEG-2 DVD using TMPGEnc (although I could have easily have done it also with CCE) and selected 16x9 for the input and 16x9 for the output.

    The result is it looks normal on a 16x9 TV as well as a 4:3 TV but on a 4:3 TV you get a reduced image with black on all 4 sides whereas on the 16x9 TV you only get black on the sides. Either way the actual image is still 4x3 (the part captured from the LaserDisc).

    But here is the hitch. To convert it BACK to 4:3 you need to chop off 56 pixels from each side and then resize to 720x480

    How did I get 56 pixels?

    Well I took my MPEG-2 that is 720x480 16x9 enhanced and ran it through DVD2AVI so as to get a D2V project file.

    Loaded that into VirtualDub and used the NULL TRANSFORM and then CROP function to see how much black there was and BINGO it came to about 56 on each side.

    So to get it back to normal 4:3 you would use this AviSynth AVS script:

    Code:
    LoadPlugin("mpeg2dec3.dll")
    mpeg2source("D:\test.d2v")
    crop(56,0,-56,0)
    LanczosResize(720,480)
    However we have a problem ...

    You said that your 720x480 16x9 enhanced MPEG-2 had 89 black on one side and 98 on the other and that sure is more than 56

    It should be 56 on each side

    So ... ummm ... I don't know what the heck all those "devices" did while resizing your image.

    It just doesn't add up to me!

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  10. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    hay Fulci,

    on the subject of AR..

    I don't know how this user got to those two numbers, but what I got is also
    different

    What I did, was a little sneaky, but I"m assuming that this user did not taint
    the source file (or pic) he uploaded here on this page, and I just dumped it
    into vdub.

    Next, I just croped (I left at least 1 pixel on each side - nobody's perfect, and
    I always leave room, just in case I need a little leaway)

    My numbers, based on pic, was as I stated above:

    * before: 643 x 361 - (which is a 1.78 AR)
    * after: 477 x 361 - (or, 79x87) - - which gave an almost perfect square.

    If the pic was closer to 480 on both corners, I would have smart-resized it
    to 480x480, but the 361 is just too small to trick this ratio

    -vhelp
    Quote Quote  
  11. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Originally Posted by vhelp
    hay Fulci,

    on the subject of AR..

    I don't know how this user got to those two numbers, but what I got is also
    different

    What I did, was a little sneaky, but I"m assuming that this user did not taint
    the source file (or pic) he uploaded here on this page, and I just dumped it
    into vdub.

    Next, I just croped (I left at least 1 pixel on each side - nobody's perfect, and
    I always leave room, just in case I need a little leaway)

    My numbers, based on pic, was as I stated above:

    * before: 643 x 361 - (which is a 1.78 AR)
    * after: 477 x 361 - (or, 79x87) - - which gave an almost perfect square.

    If the pic was closer to 480 on both corners, I would have smart-resized it
    to 480x480, but the 361 is just too small to trick this ratio

    -vhelp
    Well 477x361 is close to 1.33:1 (more like 1.32:1)

    The question is this ...

    Why is the picture posted only 643x361 and why does it have so much black on the sides?

    It just doesn't add up!

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  12. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    The question is this ...

    Why is the picture posted only 643x361 and why does it have so much black on the sides?

    It just doesn't add up!
    Ahh.., wait.., but maybe this is "after-crop" sort of what my DC10+ card
    offers in it's settings - called "TV Crop" I think. In this cards setup, the user
    has the choice to for 640 x 480, or TV Cropped, 604x480. I've often wondered
    why my DC10+ would offer such a dramatic Cropped area (604 vs. 640)
    but could never come to a resolution (nor screen resolution hehe)
    .
    .
    Thus.. perhaps, the users TV set is outputing an "after crop" effect to the
    video source ??
    .
    .
    Or else, the user tampered w/ the source somehow. ..course not hehe..

    -vhelp
    Quote Quote  
  13. Member
    Join Date
    Mar 2002
    Location
    Kirkland, WA
    Search Comp PM
    I hope I can clear things up a bit. I did not show an actual size image in the first post - it was reduced for illustration purposes.

    My video is indeed 720 lines wide including the black bars x 480 lines high.

    I went ahead and edited it in TMPGEnc, telling it my source was 16:9 525 lines (NTSC) and using the "clip frame" option. I ended up clipping 89 lines from the left, 96 lines from the right, and 6 lines from the top. I asked to keep aspect ratio and output for 4:3 display. Here's an actual size image of the result. Well - it's not really actual size in pixels because it's just a capture from PowerDVD. For some reason it comes out at 540 pixels (I guess that's NTSC), but it really is 480 lines of video resolution.



    What I hoped to learn was how to re-encode this cropping and resizing in CCE because I usually get faster encoding and better quality using multipass VBR in CCE than using 2-pass VBR in TMPGEnc. Worst case, I can live with the results I got from TMPGEnc.

    With these clarifications, maybe it will be easier for you to show me the AviSynth script to use?

    Thanks,

    Tim
    Quote Quote  
  14. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Well I think your best bet here is to just use TMPGEnc since it can do the resizing for you.

    People have said that CCE is better in terms of picture quality but I've worked pretty extensively in both and in my opinion the quality of both is about equal.

    Since this is going to be a short clip I would do a CBR of 8000kbps and use 10-bit DC COMPONENT PRECISION and either HIGHEST QUALITY (VERY SLOW) or HIGH QUALITY (SLOW) for the MOTION SEARCH PRECISION.

    You can't beat that quality wise. If you want to do a 2-pass VBR with TMPGEnc then try this "trick" that I've learned. Make sure the AVG bitrate is exactly halfway between the MAX (which should always be 8000kbps) and the MIN.

    For instance if your AVG is 6000kbps and your MAX is 8000kbps then your MIN should be 4000kbps

    If your AVG is 5500kbps and your MAX is 8000kbps then your MIN should be 3000kbps

    I would be very interested however if you could load your original MPEG-2 file (the capture) into VirtualDubMod (or the MPEG-2/AC-3 version of VirtualDub) and post a full sized screen cap of it.

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  15. SImplicity. You will have some overscan when this is done but that's OK. Crop as much as you can, must be a multiple of 4. However much blak bar is left on one side(the difference) crop that much less ont he other side. What I mean is, if you pull, say 64 from one side makes it have no bars, but 64 on the other side has say, 8 black pixels left, then crop 56 instead of 64. This way both sides will have the same amount of black borders and it will be centered on screen. Then, after all that, resize to 720x480 with 4:3 aspect in cce. If ana nalog capture too, it's most likely top field first, which is CCE default. Just modify the opther script homeboy posted to get the values. Little black and rigt wont be noticiable or distracting.
    Quote Quote  
  16. Member
    Join Date
    Mar 2002
    Location
    Kirkland, WA
    Search Comp PM
    Okay, here's a snapshot of the original video in VirtualDubMod:

    Quote Quote  
  17. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Very odd indeed tluxon !!!

    As I said my calculations seem to indicate that a 4:3 image in a 16x9 enchanced 720x480 frame should have approximately 56 pixels of black on either side (if it is of course perfectly centered).

    I see now where you get your cropping values.

    However I can't imagine that the resulting image is really 4:3 aspect ratio.

    I mean if you crop using the values you are using and then resize to 720x480 in an AviSynth AVS script you are doing basically what TMPGEnc is doing ... more or less.

    But either way I still can't imagine that the end 4:3 aspect ratio is ERROR FREE.

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  18. The 4:3 TV subpicture includes in a 16:9 NTSC anamorphic TV picture is 540x480.

    So you need to crop your video to 540x480 (84 left 96 right based on your example) then resize it to 720x480.

    The avisynth 2.5 script for this is for example :

    Code:
    LoadPlugin("mpeg2dec3.dll") 
    mpeg2source("C:\yourvideo.d2v") 
    Crop (84,0,540,480)
    LanczosResize(720,480)
    Quote Quote  
  19. FulciLives : actually a 4:3 image in a 16:9 anamorphic image has 90 black pixels on each side, if perfectly centered.

    Your calculations would be right if TV showed square pixels, but this is not the case.
    A 16:9 NTSC video (720x480) is expanded to 960x480 on a 16:9 NTSC TV : 720 x 16:9 x 3:4 = 960
    Quote Quote  
  20. Member FulciLives's Avatar
    Join Date
    May 2003
    Location
    Pittsburgh, PA in the USA
    Search Comp PM
    Originally Posted by Milo
    FulciLives : actually a 4:3 image in a 16:9 anamorphic image has 90 black pixels on each side, if perfectly centered.

    Your calculations would be right if TV showed square pixels, but this is not the case.
    A 16:9 NTSC video (720x480) is expanded to 960x480 on a 16:9 NTSC TV : 720 x 16:9 x 3:4 = 960
    That's odd I thought it was 852x480 but you are saying that 852x480 is only correct if we are talking square pixels, correct?

    I know EDTV PLASMA screens that are 16x9 have a resolution of 852x480 and that I have read that this is the "perfect" resolution since a 16x9 DVD is 852x480 when "stretched" out from the 720x480 image stored on a DVD.

    So now I am confused !!!

    - John "FulciLives" Coleman
    "The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
    EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
    Quote Quote  
  21. Member
    Join Date
    Mar 2002
    Location
    Kirkland, WA
    Search Comp PM
    I can see where you can get the 852, since:

    16 x
    --- = ---
    9 480

    giving, x = (16x480)/9 = 853.3

    But our objective is to end up with the 4:3 video width having 720 lines, so it works more like this:

    16 12
    ---- = ---
    720 x

    using 12 because 4:3 (picture inside original 16:9 frame) is equal to 12:9 (common denominator being 9). This gives x = 540, which corresponds with 4/16 of the frame being the black space on either side. 4/16 of 720 lines is 180 and dividing it equally on both sides is 90 lines each side.

    I've got the math part figured out, but I didn't know how to use the crop filter in AviSynth because I didn't have documentation for it. I also wasn't familiar with the LanczosResize filter since I had only used the BiCubicResize filter before.

    [edit] - I can't seem to get spaces in the right places to get those ratios to appear correctly.
    Quote Quote  



Similar Threads

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