VideoHelp Forum
+ Reply to Thread
Results 1 to 27 of 27
Thread
  1. I've rendered some animation to 1920x1080 targa sequence which will be edited in with HDTV shot source video. I'm trying to encode a sample mpeg2 letterbox DVD of my source animation to show my client what the end letterbox result should look like when played from a DVD player. I encoded my source animaiton using tmpgenc, Source Aspect Ratio: 16:9 display (not 16:9 525 NTSC) and Video arrange Method: Full screen (keep aspect ratio). The end result is very close to the proper aspect scale down from the HDTV size, but it is not quite exact and is causing jagged/flickering edges when played on a DVD player and 4:3 TV. The letterbox is there, but the edges need to be clean on movement and not look aliased.

    My guess is tmpgenc is not scaling down the source properly, because if I take a source targa and scale down in PShop while maintaining propotions and compare to the scaled version in tmpgenc using its preview window, the tmpgenc version is squashed just a bit more vertically than the Pshop version...the width looks correct, but the hieght of teh tmpgenc version is less high then the Pshop version...the Pshop version scales in at 720x405 which is true 16:9 aspect.

    Canyone tell me if there is a way to get the true aspect from tmpgenc, or would another encoder be better to use?

    p.s. I've also test the other Source aspects ratios and Video arrange Methods in tmpgenc and they do a worse job then the settings I specified above.

    p.s.s. I am using tmpgenc plus 2.520.54.163

    thanks for any advice.
    Quote Quote  
  2. TMPGEnc does not have a good resizer. Use AVISynth's LanczosResize() or Lanczos4Resize(), or VirtualDub's Lanczos3 resizing filter.

    To get the proper aspect ratio you should set TMPGEnc's Source Aspect Ratio to 1:1 VGA (since that appears to be what you've rendered) or 16:9 Display. (both should work in your case). Video Arrange Method should be Full Screen. Set the output Aspect Ratio to 16:9 Display.

    Be aware that the MPEG file will be anamorphically encoded at 720x480. It will not appear at the correct aspect ratio on the computer unless you are using a player that adjusts the AR. It will look fine on TV via a DVD player.
    Quote Quote  
  3. So I should resize using the tools you mentioned and output to AVI, then put this avi into tmpgenc and encode as you mentioned?
    Quote Quote  
  4. Originally Posted by jfharper
    So I should resize using the tools you mentioned and output to AVI, then put this avi into tmpgenc and encode as you mentioned?
    AVISynth is a frameserver. VirtualDub can be used either as a frameserver or to create an intermediate AVI file. Frameserving is the passing of frames from one program directly to another without saving to an intermediate file.

    Oh, if you resize to 720x480 with either of those tools tell TMPGEnc your source is 16:9, not 1:1 VGA (because it's no longer square pixel).
    Quote Quote  
  5. OK...thanks. I've never done a frameserving method before, but I am sure I can figure out the rest...thank you again.
    Quote Quote  
  6. Frameserving is not as confusing as it sounds. For instance, if you make a script in AviSynth, you just load the .avs file into Tmpgenc. That's it. The scripting is the hard part really.

    One consideration is at what framerate did you render your animation? If you did 23.976 fps (or 24) then you are in luck. Otherwise, I'd recommend making it interlaced (29.97i) which complicates your script slightly.


    Darryl
    Quote Quote  
  7. Since your TGA files are already RGB VirtualDub will give you the same results as AVISynth. In VirtualDub do the following:

    File -> Open Video File, select the first TGA (assuming a numbered sequence) and make sure "Automatically load linked segments" is checked at the bottom of the dialog.

    Video -> Filters -> Add, select the resize filter. Set the dimensions to 720x480, filter mode to Lanczos3.

    Video -> Frame Rate. In the top part of the dialog select the frame rate you want to use, probably 23.976.

    File -> Start Frameserver, select a frameserver name and file name.

    Then in TMPGEnc open that "file". It will work just as if you had opened a normal AVI file.
    Quote Quote  
  8. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Remembering a couple of things:

    HD 1920x1080 (always 16:9) is SQUARE PIXELS.

    SD DVD 720x480 (4:3 or 16:9) is NON-SQUARE PIXELS. Especially when anamorphic (which you REALLY want to use to retain the best quality from your HD source).

    You can do it from within TMPGE (your settings aren't right) or you can use AVISynth or Virtualdub and frameserve (will be higher quality).

    What needs to happen is this:

    Resize (Precise Bilinear or Precise Bicubic or Lanczos) from 1920x1080 to 704x480.
    Fill the screen, IGNORE the change in aspect ratio.
    Pad from 704x480 -->720x480 (adding 8 pixels L, and 8 pixels R)
    Consider this now a 16:9 NTSC anamorphic composition.

    Unless you rendered at 59.94 (aka 60) frames per second, where you could use alternating lines to create an interlaced output, you likely have it at 29.97 (aka 30)fps and will need to set you source as "progressive" and your output as progressive also--this is kind of non-standard for 29.97fps footage, or you might have rendered 23.976 (aka 24)fps and will also need to set your source as "progressive" and you output as progressive with pulldown flags added.

    These 2 things, when done wrongly, could have both conspired to give you the less than stellar output that you got.

    Scott
    Quote Quote  
  9. Originally Posted by Cornucopia
    Remembering a couple of things:

    HD 1920x1080 (always 16:9) is SQUARE PIXELS.

    SD DVD 720x480 (4:3 or 16:9) is NON-SQUARE PIXELS. Especially when anamorphic (which you REALLY want to use to retain the best quality from your HD source).

    You can do it from within TMPGE (your settings aren't right) or you can use AVISynth or Virtualdub and frameserve (will be higher quality).

    What needs to happen is this:

    Resize (Precise Bilinear or Precise Bicubic or Lanczos) from 1920x1080 to 704x480.
    Fill the screen, IGNORE the change in aspect ratio.
    Pad from 704x480 -->720x480 (adding 8 pixels L, and 8 pixels R)
    Consider this now a 16:9 NTSC anamorphic composition.

    Unless you rendered at 59.94 (aka 60) frames per second, where you could use alternating lines to create an interlaced output, you likely have it at 29.97 (aka 30)fps and will need to set you source as "progressive" and your output as progressive also--this is kind of non-standard for 29.97fps footage, or you might have rendered 23.976 (aka 24)fps and will also need to set your source as "progressive" and you output as progressive with pulldown flags added.

    These 2 things, when done wrongly, could have both conspired to give you the less than stellar output that you got.

    Scott
    Scott and everyone,
    Thanks for the further support.

    The rendering was done in 3dsmax NTSC 30fps, and I was able to figure out how to get the frameserver working properly using VirtualDubMod...it was pretty easy.

    But, Scott, your post was something I wanted to try...so I got all the way to the resize filter and was confused as to which settings to set 704x480...is that the New Width and New Height? Also could you tell me what the other settings should be in that window...the Lanczos 3 filter I got. When you say pad by 8 px L and R, how is that done?

    Then I guess I set the source to progressive within Tmpgenc, and do I set the Encode mode to Non-interlaced, 3:2 when playback?
    Do I set the Video stream setting Aspect Ratio to 4:3 Display or 16:9?
    or Do I set the pulldown flags you were referring to in the filters in Tmpgenc, to 3:2 pulldown?

    Sorry, I guess I am a bit confused...also wont the anamorphic result in clipping on the left and right?

    Lastly, I just found two resize filters in VirtualDubMod one is resize and the other is VDMod_Resize...which one do I use...thanks for any further guidence, and sorry for all the questions...no worries if you don't want to answer them all.
    Quote Quote  
  10. 704x480 will get you closer the exact aspect ratio. But is the 2% difference really worth worring about? Your TV probably has a larger AR error than that. In VirtualDub set the new width/height to 704x480. In the lower part of the resize dialog enable "expand frame and letterbox image" and set the size to 720x480. Actually, 704x480 is a perfectly legal frame size for MPEG so you could just leave it at that.

    Frameserve that to TMPGEnc. Set the frame size to 704x480 or 720x480, whichever you used in VirtualDub. Set the Source Aspect Ratio to 16:9, the Video Arrange Method to Full Screen, and the output Aspect Ratio to 16:9. That will give you an anamorphic 16:9 MPEG.

    Since you created your animation at 30 fps I recommend you set the frame rate to 29.97 in VirtualDub. That will play back 1/10 % slower but that's probably preferable to dropping one frame out of every 1001 (which will cause a noticable jerk every ~30 seconds). Unless you have audio that's sync'd with the video.

    Specify the source as progressive, and the output as interlaced. That will get exactly what you want for DVD. If you specify the output as progressive you will get a slightly better picture but it will not be fully DVD compatible -- some DVD players will choke on it.
    Quote Quote  
  11. Thank you...that is a bit different then what I was doing. I'll give that a try.

    Being an animator, I don't normally get into this much complex encoding, I usually render to 720x480, render to mpeg 720x480 and playback at 720x480...nice and simple.
    Quote Quote  
  12. OK, so I tried this method stated in jagabo's post, and the result was not a letterbox version like I was going for. In addition, the edges around the 3D objects were more jagged than when I tested under an alternate method of resizing in vdub using 720x405, and tmpgenc settings of full screen (keep aspect)...I'm curious as to why the 704 size was used instead of 720?
    Quote Quote  
  13. Originally Posted by jfharper
    OK, so I tried this method stated in jagabo's post, and the result was not a letterbox version like I was going for.
    It should have been an anamorphic image, a 16:9 picture squashed into a 720x480 frame. The DVD player will letterbox when played on a 4:3 TV, or give a full 16:9 image on a 16:9 TV. This is the way most commercial movie DVDs are made.

    Originally Posted by jfharper
    In addition, the edges around the 3D objects were more jagged than when I tested under an alternate method of resizing in vdub using 720x405, and tmpgenc settings of full screen (keep aspect)...
    I suspect you forgot to select Lanczos3 as the resizing method.

    Originally Posted by jfharper
    I'm curious as to why the 704 size was used instead of 720?
    Because that is supposed to be closer to the correct aspect ratio, whether 4:3 or 16:9.

    Here's an example of what you should be seeing. Starting with a 1:1 pixel aspect ratio, 1920x1080, TGA image that looks something like this (this image is half size, videohelp.com may display it even smaller):



    Notice how the image has a 16:9 aspect ratio and the circles are round (some computer monitors do not have square pixels so the circles may not be exactly round on your screen).

    Then you resize to 720x480 for an anamorphic DVD:



    This image is displayed with square pixels, as VirtualDub would display it. Notice how the circles are no longer round, they are tall and skinny. (In a non-anamorphic encoding the circles would be slightly wider than they are tall.)

    When the DVD is played on a 4:3 TV it will look like this:



    When played on an HD TV it will look like this:



    If you don't want an anamorphic DVD, then resize to 720x360 and add a letterbox to bring the frame up to 720x480. Burn that as a 4:3 DVD.
    Quote Quote  
  14. OK, I am going to try this again...because what I want is your third image there...meaning I want the DVD player to make the letterbox, not me duing encode. (BTW, thanks for taking more time with me...)

    So let me go over my steps:
    1. VDubMod, import tga image sequence, video->filters->add->resize...new width 704, new height 480, filter mode Lanczo3, leave "Interlaced (not recommended for enlarging)" un-checked, enable "expand frame and letterbox image" and set Frame width to 704, and Frame Height to 480, press OK, then OK again, then start frame server.
    2. Start Tmpgenc Plus v2.5 and load currently running frame server file as video source, and I set parameters as illustrated below:



    Then encode, then multiplex into mpg. Then author in Ulead WS making sure not to rencode, then burn.

    I'll give that a try and let you know what I find out. Question: is the setting on the DVD player important? Should it be 4:3PS, 4:3LB or 16:9, when played on a 4:3 TV? Thanks again.


    OK, I tried all that out, and my end DVD did not play with the letterbox, like your #3 image above...it played like your #2 image above on a TV 4:3...I tried setting the DVD player to 4:3PS, 4:3LB, and 16:9, and they all played like this "Enhance" version, like your #2 image above. I tried two different DVD players, one is a Daewoo cheapy, and the other a new Pioneer 640 HS DVR 160GB unit. I must be doing something wrong...do you think the DAR flag is not being set right, or did I mess up somewhere? Thanks for any advice.
    Quote Quote  
  15. Originally Posted by jfharper
    OK, I tried all that out, and my end DVD did not play with the letterbox, like your #3 image above...it played like your #2 image above on a TV 4:3...I tried setting the DVD player to 4:3PS, 4:3LB, and 16:9, and they all played like this "Enhance" version, like your #2 image above. I tried two different DVD players, one is a Daewoo cheapy, and the other a new Pioneer 640 HS DVR 160GB unit. I must be doing something wrong...do you think the DAR flag is not being set right, or did I mess up somewhere? Thanks for any advice.
    Be sure your DVD mastering software is set to 16:9. Otherwise it will burn the MPEG file as 4:3 -- which would give the symptom you're describing. For example, older versions of Ulead DVD Moviefactory didn't support 16:9.

    One note in case it isn't clear: the letterbox option in VirtualDub has nothing to do with the letterboxing your DVD player will do later (in this particular case). Resize to 704x480 in VirtualDub and use the Letterbox option if you want to add small black bars to the left and right edges of the frame to bring it up to 720x480. There's not point in enabling the option if you set the frame size and letterbox size the same.
    Quote Quote  
  16. OK, I'll check the tools list to see if there is a free DVD mastering software I can test out the 16:9 thing...thanks.

    Let me see if I understand your other comment: If I set 704x480 in VDub and use letterbox option, then set the letterbox to 720x480 not 704x480...right? And in Tmpgenc set video stream size to 704x480 or 720x480? Also, why would l want small black bars on the right and left of my screen...I just want the black bars on the top and bottom like for a regular letterbox...sorry I'm so dumb with this...hopefully soon I will be able to wrap my mind around the concept....I think I am close.
    Quote Quote  
  17. OK, I'll check the tools list to see if there is a free DVD mastering software I can test out the 16:9 thing...thanks.

    Ordinarily 16:9 is set in 2 places, the encoded video and in the IFO. If the IFO says 4:3, then even though you encoded the video correctly, you'll be out of luck as far as playback with proper AR. You can check the IFO DAR by opening the DVD in PGCEdit. Double-click the movie in the left screen and then hit Current Domain Streams Attributes in the lower left of the new screen that opens up. If the Video is ticked for 4:3, then you'll know the authoring software did it wrong. It's an easy matter to change it. If you do see 4:3, then OK your way out of there back to the main screen, find the green reel of film among the row of icons across the top, click on it, change to 16:9, OK back to the main screen, Save and Test.

    For some authoring programs, 4:3 is default, and you'll have to manually change it to 16:9 somewhere before authoring.
    Quote Quote  
  18. Originally Posted by jfharper
    et me see if I understand your other comment: If I set 704x480 in VDub and use letterbox option, then set the letterbox to 720x480 not 704x480...right? And in Tmpgenc set video stream size to 704x480 or 720x480?
    You want to set TMPGEnc to to same size as the output from VirtualDub -- so it doesn't get resized again.

    Originally Posted by jfharper
    Also, why would l want small black bars on the right and left of my screen...I just want the black bars on the top and bottom like for a regular letterbox...
    The addition of the small black bars at the edges of the frame in VirtualDub is simply to bring the full frame size up to 720x480. You only need to do this if you need a 720x480 frame rather than 704x480. Both are legal frame sizes for NTSC DVD (along with 352x480 and 352x240) so you could use either one. Maybe some mastering software doesn't like 704?

    The 8 pixel wide bars at the edges of the frame won't be seen on TV; they're well in the overscan area.
    Quote Quote  
  19. Yep, Manono, you were right...Pgcedit said 4:3...I used Ulead WS to author and it did to it wrong. I followed your steps and set it to 16:9...but I think I resized the video wrong in the first place...I'll try it again.

    Manono, when I set the setting to 16:9, do I need to check "Automatic Letterbox" (this is in PgcEdit)?

    jagabo, your patience with me is astounding...so if in Vdub I set 704x480 and use letterbox and set letterbox to 720x480 I should also set Tempgenc to 720x480.

    If I set 704x480 in Vdub and use letterbox and set letterbox to 704x480, I should also set tempgenc to 704x480...

    ...this has to be right...right? I'll understand if you guys yell at me in your next reply.
    Quote Quote  
  20. Originally Posted by jagabo
    You only need to do this if you need a 720x480 frame rather than 704x480. Both are legal frame sizes for NTSC DVD (along with 352x480 and 352x240) so you could use either one. Maybe some mastering software doesn't like 704?
    Is that the only reason why someone would use 720 instead of 704? I'm curious to know if there is another reason why someone would use 740 if master software wasn't an issue...is this more preferred or better looking, or more compatible...just curious? Thanks.
    Quote Quote  
  21. Originally Posted by jfharper
    Originally Posted by jagabo
    You only need to do this if you need a 720x480 frame rather than 704x480. Both are legal frame sizes for NTSC DVD (along with 352x480 and 352x240) so you could use either one. Maybe some mastering software doesn't like 704?
    Is that the only reason why someone would use 720 instead of 704? I'm curious to know if there is another reason why someone would use 740 if master software wasn't an issue...is this more preferred or better looking, or more compatible...just curious? Thanks.
    I don't know wny one might prefer one over the other. I was just speculating about software compatability. All the commercial DVDs I've seen have been 720.
    Quote Quote  
  22. do I need to check "Automatic Letterbox" (this is in PgcEdit)?

    Sorry, I guess the instructions were incomplete. Yes, in almost all cases you'll want 16:9 Automatic Letterbox. This will add black bars to keep the AR and have the entire video when played on 4:3 televisions. In my opinion, there's never a good reason to use 16:9 Automatic Pan And Scan (except sometimes for menus) because it will fill the entire screen of a 4:3 television, and does it with good AR, but at the expense of cutting off the sides. It turns what was originally a 1.85:1 video (for example) into a 1.33:1 video, losing something like 40% of the picture in the process. And, of course, it's not a true Pan And Scan, as it's fixed on the middle of the picture, with no panning or scanning going on.
    Quote Quote  
  23. OK...well there is one more thing I don't understand.

    If you divide 16/9 you get 1.78
    If you divide 1920/1080 you get 1.78

    If you divide 704/480 you get 1.47
    If you divide 720x480 you get 1.5

    So we are basically taking a 1.78 ratio, resizing it to 1.47, so that when played in a DVD player, it will size back to 1.78...is that what this whole process is doing?

    So the ideal situation would be Blu ray, where we keep the 1920:1080 1.78 ratio, which is played on a HDTV at 1920:1080...is that all correct?

    It seems to me, why would I want to resize my HDTV renderings like that...why don't I just render to 720x480 and skip the whole 16:9 thing? It seems like a quality dump, just by trying to get letterbox...
    Quote Quote  
  24. OK, so I got all this to finally work, but the end result didn't look as good as my other method of resizing the video to 720x405 (1.78)...and adding letterbox at 720x480...I also added a blur to help with some aliasing...but I guess this will only look good when played at 4:3, when played on a 16:9 TV, it will look stretched horizontally, and the letterboxes will never go away...know I don't know what to do.

    There was more aliasing with the NTSC 16:9 anamorphic method.

    Is this normal for this process; to see a degradation in quality...I'm talking about edges that are jagged and look aliased?
    Quote Quote  
  25. Originally Posted by jfharper
    OK...well there is one more thing I don't understand.

    If you divide 16/9 you get 1.78
    If you divide 1920/1080 you get 1.78

    If you divide 704/480 you get 1.47
    If you divide 720x480 you get 1.5

    So we are basically taking a 1.78 ratio, resizing it to 1.47, so that when played in a DVD player, it will size back to 1.78...is that what this whole process is doing?
    Yes. In a DVD player the frame size does not determine the display aspect ratio. 352x480 can be used for 4:3 and 16:9 although the frame dimensions are nowhere near those aspect ratios.

    The NTSC DVD spec only supports four frame sizes: 720x480, 704x480, 352x480, and 352x240. And it only supports two aspect ratios: 4:3 and 16:9.

    Originally Posted by jfharper
    So the ideal situation would be Blu ray, where we keep the 1920:1080 1.78 ratio, which is played on a HDTV at 1920:1080...is that all correct?
    Yes. Although few displays actually have that resolution so you'll generally get some resizing inside the HDTV.

    Originally Posted by jfharper
    It seems to me, why would I want to resize my HDTV renderings like that...why don't I just render to 720x480 and skip the whole 16:9 thing? It seems like a quality dump, just by trying to get letterbox...
    Because an anamorphic encoding will retain more vertical resolution. On a 4:3 TV the DVD player will resize the frame to 720x360 (the equivalent of 640x360 with square pixels) and add 60 lines of black to the top and bottom for a full frame size of 720x480 (4:3). When viewed on a wide screen TV the player will stretch the image to the equivalent of 860x480 (equivalent to 853x480 with square pixels). If you letterbox before encoding then it will about the same on a 4:3 TV but an HDTV (depending on how it's set up) will pillarbox the letterboxed image. You'll get a small picture with black bars all around. Or the HDTV might be set up to stretch the 4:3 image out to 16:9 so you'll get a very distorted aspect ratio with black bars top and bottom. Or you can zoom in on the image but then you'll be enlarging a 360 line portion of the 480 line tall image, resulting in further degradation.

    Or are you talking about cutting off the edges of the frame and encoding only a 4:3 section in the middle (pan and scan)?

    Originally Posted by jfharper
    OK, so I got all this to finally work, but the end result didn't look as good as my other method of resizing the video to 720x405 (1.78)...and adding letterbox at 720x480...I also added a blur to help with some aliasing...but I guess this will only look good when played at 4:3, when played on a 16:9 TV, it will look stretched horizontally, and the letterboxes will never go away...know I don't know what to do.
    How did the picture look within VirtualDub, after setting up the resizing filter? (If you couldn't see the output window you can use Options->swap input/output panes.) It should have looked very clean there. How does the MPEG file look after encoding? It should look good there too. Maybe you are using too low a bitrate for the MPEG encoding? That wouldn't lead to aliasing but would introduce macroblocks. MPEG's 4:2:0 color space and interlaced encoding will lead to some blurring of colors.

    Originally Posted by jfharper
    There was more aliasing with the NTSC 16:9 anamorphic method.
    On your TV? Maybe the DVD player doesn't scale the anamorphic image well?

    Originally Posted by jfharper
    Is this normal for this process; to see a degradation in quality...I'm talking about edges that are jagged and look aliased?
    There will always be a loss of quality when resizing down from 1920x1080 to 720x480. Resizing always leads to a little jagginess and moire artifacts. But it sounds to me like you are seeing more than you should. Open your MPEG file in VirtualDubMod (because it won't perform any resizing for display), save a frame, and post it. Do the same with your original source so we can compare before and after.
    Quote Quote  
  26. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Originally Posted by jfharper
    OK...well there is one more thing I don't understand.

    If you divide 16/9 you get 1.78
    If you divide 1920/1080 you get 1.78

    If you divide 704/480 you get 1.47
    If you divide 720x480 you get 1.5
    ...
    Use this math:
    HRez / VRez / PAR = DAR

    So you have:

    1920 / 1080 / 1 (1:1=SquarePixels) = 1.78 (aka 16/9)

    and

    704 / 480 / 1.1 (std. NTSC PAR) = 1.33 (aka 4:3)

    720 / 480 isn't truly 1.33, because 8 pixels of black have been padded to the L and R sides, but this has more to do with commonality of sampling rate in A-D conversion, irrespective of TV system (SD NTSC and PAL have same sampling frequency). Consider those 16pixels (=1 macroblock width) "buffer" for overscan.

    Scott
    Quote Quote  
  27. OK...thanks, Jagabo, I'll try to answer those questions as I get the time, my client has me on a few other tasks at the moment.
    Quote Quote  



Similar Threads

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