Tips for creating "anamorphic" from "non-anamorphic" video capture?

Discussion in 'Computers' started by Patrick Sun, Mar 2, 2004.

  1. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424
    Porting over letterboxed LDs to DVDs: It's pretty straight forward to capture the LD video to an AVI file and crunch it up so that it can be transferred to a blank DVD. Now, just for fun and giggles, has anyone tried porting to a 16x9-coded DVD?

    I know I won't gain anymore resolution, but if you have a 16x9 TV, watching a letterboxed DVD with a 4:3 aspect ratio does bring up some viewing decisions (either turn on the pillar mode to keep the aspect ratio correct, or stretch it) if you don't have a DVD player that can scale non-anamorphic letterbox DVDs.

    So this exercise is to avoid that if possible by creating a 16x9 DVD out of a non-anamorphic source.

    (Feel free to skip this part below because I had better success skipping the part of using VirtualDub to crop and IVTC the file, and go to this post for a better way to achieve the results.)

    What I've been doing (my latest encoding attempt is still getting crunched up as I type) is take the original AVI files that was captured from the LD. For 125 minutes, its AVI file is around 27GB, at 720x480 resolution. I use VirtualDub's Null Transform filter to crop 60 lines from the top and 60 lines from the bottom to create an AVI file with 720x360 resolution, but for some reason, the new AVI file size blows up to around 45GB (But I digress).

    Once I have the new AVI file, I then use TMPGEnc to encode the AVI file into a M2V file for the video portion for the DVD. I did some tests to see which settings created the "right" looking file with 720x480 resolution (where people look taller and skinner until the anamorphic squeeze or full mode is applied to anamorphically-encode files), which is needed for the DVD spec, at 29.97 fps. I use 2-pass VBR with a bitrate around 4500 for a running time of 125 minutes.

    Once I create the M2V file, multiplex it with the AC3 I made earlier, and used DVD Author to create the menu, create the files for the DVD.

    Then I use IFOEdit to change the video flag from 4:3 to 16x9 and save that *.ifo file and then burn it to a blank DVD.

    I think this should work, but was just wondering if others have already gone through this process, and if I should be doing something else to get the most video quality out of the encoding process.
     
  2. Rob Gillespie

    Rob Gillespie Producer

    Joined:
    Aug 17, 1998
    Messages:
    3,632
    Likes Received:
    5
    I did it for my two-disc versions of the SW LDs and also the LD of The Piano.

    I changed one option in TMPGEnc, under the Video tab the Aspect Ratio setting was altered to 16:9 525 line NTSC. Only other thing I changed was the Clip Frame numbers to reflect the decrease in black border size. You may not be using that though. I use clip frame to replace the original letterboxing borders with pure black. Subtitles aren't a problem for me because I overlayed permanent subs into the video frame using Video Vegas (and they look a damn sight better too).

    16:9 encoded transfers do look a little better to me. The main advantage is that the 'gridline' effect all but disappears. However that same gridline effect can have the side effect of making the video look sharper, but I've not really found that to be reason to not to use 16:9.
     
  3. Ken Chan

    Ken Chan Producer

    Joined:
    Apr 11, 1999
    Messages:
    3,301
    Likes Received:
    0
    Check the video codec used for the output. I believe the menu item is called "Video Compression"

    Is this 24fps film? If so, the best results would be to do an inverse telecine to convert it back to progressive, then resize that, and encode as a progressive DVD. Rob's suggestion to chop off all the borders to get pure black is good. Also, for MPEG compression, if you can get one or both of the edges of the picture to align with the 16-pixel macroblock, you'll get better results.

    Last time I fiddled with this, it seemed like VirtualDub gave you more control over cropping, resizing, and letterboxing, while TMPGEnc had a better inverse telecine (it will prescan all the frames, and you can then tweak them individually through UI). Unfortunately, that may not be the optimal order, which I would say is more: (1) crop the "black bars" (2) IVTC what you've got (3) resize it 4/3 taller (4) letterbox in a 480-line frame, aligned if possible (5) encode to progressive MPEG. Obviously, some of these steps can be combined, e.g. letterbox when encoding.

    If resizing with VirtualDub, the rule of thumb is precise bicubic when enlarging (and precise bilinear when reducing). I forget if TMPGEnc has any options, or which method it uses.

    If it's video instead of film, the only difference is no IVTC, and making sure the resize is "field-aware". If you try to resize interlaced fields as progressive frames, you'll get mush when there is motion.
     
  4. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424
    Thanks for the tips and suggestions.

    I went ahead and did the cropping in VirtualDub, and also the 4/3 expand, and applied a little bit of brightening at the same time in VirtualDub in the "Video - Filters" area.

    I noticed in the VirtualDubbing phase that I was getting some nasty looking scan-lines, so I went into the Video menu, then the "Frame Rate" section and in the "Inverse telecine (3:2 pulldown removal)" area where "None (progressive)" was the default, so I changed it to "Reconstruct from fields - adaptive" and this smoothed out the AVI dub.

    Now, does this mean I don't have to apply the IVTC from the TMPGEnc encoding side? I'll have to wait until I get back home to see which settings I was using in TMPGenc.

    I tried all sorts of combinations in the "Video - Compression" (using the HuffyUV 2.11 codec) and still couldn't get the file size under 45GB (while other choices yielded up to 90GB for the 125 minute AVI file. Is there another codec I should be using? This isn't a huge deal since I just nuke the file once I'm done with it, it's just more of a curiousity thing.
     
  5. Wayne Bundrick

    Wayne Bundrick Cinematographer

    Joined:
    May 17, 1999
    Messages:
    2,358
    Likes Received:
    0
    If you have to process video in multiple steps then it's best to use lossless compression such as HuffyUV between each step, otherwise there will be multiple lossy decode/encode generations that will negate your efforts to get the best quality.

    27 GB for 125 minutes of DV capture sounds right because DV's data rate is about 25 megabits. DV is a mildly lossy codec. HuffyUV is lossless and can't get as much reduction as a lossy codec, so going from 27 GB to 45 GB is to be expected.
     
  6. Ken Chan

    Ken Chan Producer

    Joined:
    Apr 11, 1999
    Messages:
    3,301
    Likes Received:
    0
    And just to be clear, that's for multiple steps between programs. For multiple operations inside the same program, like VirtualDub, the codec only affects the final output. Also, if you frameserve from VirtualDub, I'm not sure the codec matters (it shouldn't), and you could save the step and disk space of having to write the file out. Of course, there's more setup involved.

    A pronounced comb effect is not necessarily a problem. As I said, if it's film, then doing an inverse telecine will give you better results both during the resize and the MPEG encoding. If it's interlaced video, that's not an option, and even with film, you could keep the 2/3 pulldown and MPEG encode as interlaced, and it wouldn't be "wrong". What would be wrong is to distort the comb while resizing. After capturing, the teeth will be on every other line. If after resizing, some of the teeth or gaps are two lines thick, then the fields have been distorted.

    Inverse telecine will obviate worrying about the comb effect, but you should check the entire video to make sure it was done correctly. Sometimes the 2/3 cadence changes when there is a cut. And yes, you can only do it once; if you did it in VirtualDub, don't do it in TMPGEnc.
     
  7. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424
    Thanks for more details. (I am using film LD source for the time being). When I did some sample conversions, I noticed more grittiness to the video quality, so I tried using some noise reduction (lowest level 1) and it appears to have smoothed out the noise, but I'm in the middle of mix the DVD files, so I'll know how things look on the RPTV soon enough.
     
  8. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424
    Okay, after plenty of experimentation, I finally came up with a recipe (I hope) to get rid of comb lines for a film-source LD capture en route to a 16x9 DVD encoding project:

    I do have a question with section 3 dealing with encoding the m2v file: Should I use the encode mode of "Non-Interlace" or "3:2 pulldown when playback"?

    1. Canopus DV File Converter

    I run the original captured AVI files through the Canopus DV file converter and select "Target Format = Premiere compatible Canopus AVI (AVI 2)". I had tried using "Canopus Reference AVI" but I didn't like the comb effects from the resultant converted AVI file.

    2. VirtualDub processing (crop letterbox video from the capture):

    I use VirtualDub 1.5.10 to process the new converted AVI file with these Video settings:

    Full Processing Mode

    Filters -> Null Transform -> Cropping (crop the top and bottom to remove the black areas to get true black later in the encoding process)

    Frame rate -> Inverse telecine -> Reconstruct from fields - adaptive (This gets the file back to a 24fps video)

    Compression -> Huffyuv 2.1.1 - CCESP Patch v0.2.2 (this assumes the Huffyuv codec has been installed) -> Configure -> YUV2 compression method = Predict median (best), RGB compression method = Predict gradient (best), Field Threshold = 480 lines, Click on "Enable full size output-buffer (might fix crashing)"

    (If you pick RGB compression method = "
     
  9. Ken Chan

    Ken Chan Producer

    Joined:
    Apr 11, 1999
    Messages:
    3,301
    Likes Received:
    0

    Tough to tell from the label, but you probably want 3:2, so that the resulting frame rate is 29.97. (Doesn't seem like 24fps would be NTSC DVD-compliant, although a DVD player could probably handle it by doing its own 3:2 pulldown.) This should not generate any more frames, but simply set the repeat_first_field and top_field_first flags appropriately.

    Any reason for the particular GOP structure?
     
  10. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424
    Okay, 3:2 pulldown it is. It does do 23.976fps (29.97 internal) at that encoding setting.

    The other thing about the 2 Canopus formats is that "Target Format = Premiere compatible Canopus AVI (AVI 2)" makes one large converted AVI file, while using "Target Format = Canopus Reference AVI" makes a bunch of files around 1-2GB each. I much prefer the former over the latter in terms of lack of combing.

    As far as GOP structure, I used this Bitrate calculator, so I'm flying by the seat of my pants on GOP structure.
     
  11. Wayne Bundrick

    Wayne Bundrick Cinematographer

    Joined:
    May 17, 1999
    Messages:
    2,358
    Likes Received:
    0
    23.976 (29.97 internal) sounds like the proper setting. The MPEG will be a sequence of 23.976 progressively encoded frames with the flags to break them down into interlaced fields and repeat fields as necessary to achieve the 29.97 rate.

    The Canopus thing doesn't make sense. The point of using the Canopus file converter is to get Windows to use the better Canopus DV decoder instead of Microsoft's. There shouldn't be a visible difference between AVI2 and Canopus Reference since it's the same decoder doing the work, which makes me wonder if somehow VirtualDub is using a different decoder for the AVI2.
     
  12. Rob Gillespie

    Rob Gillespie Producer

    Joined:
    Aug 17, 1998
    Messages:
    3,632
    Likes Received:
    5
    This sounds like an awful lot of effort for what I managed to do by changing one setting in TMPGEnc.
     
  13. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424


    I just noticed that the video segment after the first splice results in combing. If there any way of fixing this to make sure the spliced parts are 'in step' after the fact, or what to do to avoid this problem when splicing segments together in the first place?
     
  14. Scott L

    Scott L Producer

    Joined:
    Feb 29, 2000
    Messages:
    4,457
    Likes Received:
    1
    Can I ask a stupid question.. Why not just view the movie from the LD whenever you have a hankering for it?
     
  15. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424
    LD players don't last forever...
     
  16. James Phillips

    James Phillips Stunt Coordinator

    Joined:
    Oct 22, 2001
    Messages:
    217
    Likes Received:
    0


    Yeah, all I do is change the MPEG setting to 16:9, clip the top and bottom of the frame to 72, and encode the file.
     
  17. GregK

    GregK Screenwriter

    Joined:
    Nov 22, 2000
    Messages:
    1,013
    Likes Received:
    219


    By performing inverse telecine and providing a (roughly) 24p source for the MPEG encoder, encoding efficiency should be improved, which results in fewer artifacts. Some of this can depend on the MPEG-2 encoder itself.
     
  18. James Phillips

    James Phillips Stunt Coordinator

    Joined:
    Oct 22, 2001
    Messages:
    217
    Likes Received:
    0
    Thanks for that, Greg. I've been working with PAL material up to now, so I haven't needed to use the inverse telecine filter yet. But I'm planning to transfer a few NTSC laserdiscs to DVD soon, so I'll bear that in mind. [​IMG]
     
  19. Patrick Sun

    Patrick Sun Moderator
    Moderator

    Joined:
    Jun 30, 1999
    Messages:
    38,674
    Likes Received:
    424
    Thanks for the tips.

    I've sidestepped the VirtualDub file creation (where I cropped and IVTC'd the Canopus Reference AVI file), and just used TMPGEnc to do the cropping, the IVTCing, the resizing, and the 16x9 3:2 encoding in one process, and it appears to have gotten rid of the combing I've been seeing in the latter segments of the larger joined AVI file. This looks promising. Next up, producing a DVD to see how it looks on my TV.
     
  20. Ken Chan

    Ken Chan Producer

    Joined:
    Apr 11, 1999
    Messages:
    3,301
    Likes Received:
    0

    To make it easier on the IVTC processor, ideally you want to maintain the 3:2 cadence: 3 "good" full frames followed by 2 combed frames. (If you look at the telecine process 4 progressive frames become 1 full, 2 combed, 2 full; that becomes 3:2 when you have a bunch of those in sequence.) If there is no motion at the splices, you need to look back and ahead to find motion in the scenes. These are groups of five frames, so all you have to do is look at the last digit. For example, suppose the last two combed frames in the previous segment are number 945 and 946. That means you want to do the splice so that the first two combed frames in the next segment also end with 5 and 6, or five frames earlier/later at 0 and 1.

    After running some test footage, it looks like the IVTC in VirtualDub does attempt to adapt to cadence changes, but you might get combing right after the splice. The help also says it only handles 3:2 (when repeated, that would be 3:2:3:2 etc). There are other patterns like 2:3:3:2. The one in TMPGEnc might do a better job automatically, but I've seen it do strange things too. The best thing is that you can preview what it's going to do, in a pretty decent UI (with maybe a few too many options), and tweak it.
     

Share This Page