VicBond007's Guide to Working with DVD Footage [Written in 2004]

Moderator: Niotex

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Working with Footage

Post by Guides » Thu Mar 21, 2024 8:04 pm

Encoding a 16:9 DVD to DivX with AviSynth and Virtualdub

In the event that you are dealing with widescreen footage, you’ll notice that when seeking around in virtualdub, the image looks horizontally squashed. DVD players understand how to adjust this image for a standard tv set, we need to compensate by hand.

There are plugins that allow you to resize foot- age with avisynth, however they can not be used with the decomb plugin since it needs the ORIGINAL video size to make it’s calculations. We will use virtualdub to resize instead.

Perform all the steps necessary for encoding a 4:3 DVD to DivX as mentioned on the previous page, but do not save the avi yet. Instead, go to the video menu again and select ‘filters’ (CTRL+F). Click the ‘add’ button and scroll down the list until you see ‘resize’. Hit ‘OK’ and a new window should pop up. What we want to do is add letterboxed borders to our video, while at the same time scaling it properly, AND keeping it so that it will look right when displayed on a tv. To do this, we’ll have to first convert the image size to look right on a pc monitor, and then scale it back down to tv proportions. Rather than go into a lot of unnec- essary details, just trust me on the numbers here. It may seem like an indirect approach, but it’s the best way to be sure you’re doing everything you can to make your video look it’s best when presented.

For starters, set the new width to 720 (standard television width) and the new height to 405. Widescreen anime is presented in a format called 16:9, meaning for every 16 square pixels wide, there are 9 square pixels high. (720/ 16)*9=405. For the ‘filter mode’ drop down, select ‘bicubic’ for the best quality resize.


Image Image Image



Next, we’re going to need to add our letterboxed borders. However, we’ve sized the video to proportions that are good only for square pixels, so instead of adding borders, taking the size up to 720x480, we need to add 720x540 borders instead. We do this by clicking the check box next to “expand frame and letterbox image”. The fields below it will light up. Leave the frame width as it is and set the frame height to 540.

If you don’t trust me, or just want to see how it looks, you can click on the “show preview” button now and scrub around on the timeline in the new window that pops up. The video should look letterboxed, and perfect on your computer monitor. Close the preview window, and hit ‘OK’.

We should be back at the filters window now, and our resize filter should be listed along with the settings so that we can see what it’s doing at a glance. What we need to do now is resize this video AGAIN, so that it displays itself properly on a television (vertically squished on a pc monitor). Click the ‘add’ button again, scroll to resize, and click ok. This should be familiar to us by now. Enter 720 for the width, 480 for the height, and then bicubic for the filter mode. No need to touch anything else, so hit ‘OK’. Our resize filter should now be listed twice, each occurrence with different settings. Click ‘OK’, and we’re done setting up our encode. If you haven’t configured divx yet, do so now, and then go to file/save as AVI, and go find something to keep yourself occupied. This is going to take a while...

Image Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Working with Footage

Post by Guides » Thu Mar 21, 2024 8:05 pm

Pulling Clips for Use in Your Favorite Video Editing Program

Now that we’ve constructed our DivX, and have watched it to make sure it looks good, we can delete our ripped .vobs if we’re tight on space. We won’t need them anymore unless we ruin our new .avi file. Open your divx4 .avi file in virtualdub and hold down the right arrow key to seek ahead. You’ll notice you can scan much faster. Don’t hit the left arrow (seek backwards) as DivX is only meant to be read one way. Instead, hold the shift key and use the arrow keys to navigate, snapping to keyframes. You can scan fowards and backwards this way at incredible speed. You can scrub the timeline with your mouse while holding shift as well.

To pull a clip to edit with, seek to the point where you want your clip to start, and click the second button from the right at the bottom of the virtualdub window (if you hold your mouse over it for a few seconds, a tooltip will let you know this is for “mark-in”). Now navigate to the end of your clip, and push the button furthest to the right to mark out. You should now have 2 (though your clip may be too small to see both) little black arrows underneath your timeline.

From here, go to video/compression, select huffyuv, and click OK. There is no need to change any of the settings. If you’ve added a filter to a previous clip and haven’t closed virtualdub in the meantime, go to video/filters and remove the filters since they stay, even when you load different video files. Also, make sure ‘no audio’ is ticked in the audio menu.

Go to file/save as AVI, name your clip, and watch it go. This is usually a rather fast process and is greatly affected by the speed of your hard drive. These clips are going to be big, but they’re going to be the most friendly to edit with, so make sure you have lots of space.


Image Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Working with Footage

Post by Guides » Mon Mar 25, 2024 12:49 pm

Cleaning Bad Footage: Heavy Pixellation

Just because it’s a DVD, doesn’t mean the quality is going to be perfect. This is evident in a lot of DVDs released on this side of the Pacific Ocean, and even more so in bootleg Hong Kong DVDs. A surprising number of “professional” studios either have no clue how to make a decent disc, or know that they have your money anyways, so it doesn’t matter to them how high the bitrate is or how precise they encode their streams. There are going to be quite a few times when you need to clean up a clip, and there are two plugins for Virtualdub that we’re going to use. It’s best to use them when pulling clips, rather than when encoding the whole DVD, because using them will make the process go about 20x-30x slower.

We can clean up badly pixellated scenes using Smart Smoother by Donald Graft, available from http://neuron2.net/smooth.html Download the plugin, and unzip it into your plugins directory inside your virtualdub folder. Virtualdub will automatically add it to the filter list the next time it loads.

To use it, load up your footage, mark off your clip, then go to video/filters and click add. Smart Smoother 1.1 should be in your filter list. Select it, and hit OK to bring up the dialogue box. Now would be a good time to hit “show preview” and scroll to a frame that is in your clip. Adjust the diameter setting to the max (11) so that Smart Smoother is set to remove large artifacts. Now use the + and - buttons for Threshold until most of the artifacts go away. Too high a threshold can begin to blur the image and make it look funny, so only use as much as you need. Generally, 75-80 works just fine. Hit OK when you’re done, and save your clip as normal. Be sure to be using Full Processing Mode, otherwise virtualdub will ignore filters.


Image Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Working with Footage

Post by Guides » Mon Mar 25, 2024 12:53 pm

Cleaning Bad Footage: Rainbow Artifacts

You shouldn’t see this problem very much any more, but early DVDs, or current ones mastered from old shows, may be susceptible to an analog artifact known as rainbowing. This occurs either because of poor analog source, poor capturing equipment, or poor cables connecting the two. Rainbows occur on areas of high contrast, such as the black edges of anime characters, and their considerably lighter skintones. A big problem with animation, but one that can be remedied easily thanks to a virtualdub plugin called Smart Smoother IQ by Tim Park.

Download Smart Smoother IQ version 0.6 from http://www.doki.ca/filters/ and unzip it to your virtualdub plugins directory. Load up your DVD rip in virtualdub, mark off your clip with mark-in/mark-out, and then go to video/filters, then click ‘add’ to select Smart Smoother IQ.

Maxing out the values won’t hurt your image any, aside from dulling the color an imperceptible amount. Most of the time you will need to turn both the diameter and threshold values up all the way to get a visible result. In fact, with some extreme cases, you might want to add the Smart Smoother IQ filter TWICE, with the maximum values both times. No need to check “interlaced source” because you’ve deinterlaced ahead of time. You should see a very noticeable decrease in rainbow artifacts, at the expense of processing time. Don’t be surprised if your clip encodes at 1 frame per second or slower if you’ve applied 2 Smart Smoother IQ filters on top of each other.


Image Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Working with Footage

Post by Guides » Mon Mar 25, 2024 12:56 pm

Setting Up Adobe Premiere 6.01 to Work with Our Ripped Footage

Adobe Premiere 6.0x is dated, but it’s way more stable than 6.5. Later builds of Premiere dubbed “Premiere Pro” require WindowsXP to run, and anybody who works with computers on a regular basis can tell you that “WindowsXP Professional” is an oxymoron. Most of this information can be applied to Premiere Pro, the layout and such just might be different.

Open up Premiere 6, and you’ll be presented with the Load Project Settings dialogue. If not, go to file/new project. Click the “custom” button on the right.

The first section is the “general” section. Here, we specify “Video for Windows” as the editing mode using the drop down menu. Set the timebase to 24, and the time display to “24 fps Timecode”. This won’t affect our video any, it simply modifies the timeline so that 1 frame on the timeline equals 1 frame of video. You can use 24fps source and work on a 29.97 fps timeline, but you’ll run into synchronization problems.

Click the “next” button on the lower right to bring up the video properties. For the compressor, Choose Huffyuv v2.1.1. Huffyuv only has 1 real quality setting, and that’s perfect, so quality and depth grey out. Under frame size, type in 720 h and 480 v. Uncheck the box next to 4:3 aspect if you can’t type these numbers in. Don’t settle for 710x480. Set the framrate to 23.98 (23.976 rounded up). For pixel aspect ratio, choose D1/DV NTSC(0.9). What this does is resize the video on the fly in the preview window to be sized like it would be on the tv. The edges may look jagged in the preview window, this is fine as it doesn’t affect our final output. Uncheck the “recompress” checkbox near the bottom.


Image Image Image



Click the “next” button again to bring you to the audio properties. Here we want to set the audio properties to match the audio that you’ve pre- pared for your AMV. Music on CDs is recorded at 44100 Hz, so set that as your rate. A higher setting will make your audio sound hollow and mechanical. Set the format for 16-bit stereo, unless your audio is monoaural. CDs have to be in stereo, so for the most part, you’ll never have to change this again as well. For the compressor, select uncompressed, as we don’t want to compress our audio.

Even if your source audio is an mp3, it’s HIGHLY recommended to convert that mp3 to an uncompressed .wav file first. There are a lot of tools to do this, including the disk writer plugin that comes bundled with the free, and popular, Winamp by Nullsoft. Premiere can become unstable when working directly with mp3s, and you will run into sync issues.

Set the interleave to 1 second (this is usually the default) and set the enhanced rate conversion to off. We’re not converting the sampling rate, so there’s no need for Premiere to waste time trying to do so.

Click the ‘next’ button one last time to bring us to the keyframe & rendering settings. Make sure all of these checkboxes are unchecked. Contrary to popular belief, “optimize stills” just messes up your images. Change the preview to “from RAM” meaning once you play a segment of your video, it stores it in RAM. If you play it again, it should play full speed. Huffyuv is way too large to preview “from disk”. In the fields drop down, select “no fields” as we’ve already deinterlaced our footage.

Go ahead and click OK. We’re all set up and Premiere is ready to accept our extracted clips.


Image Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Working with Footage

Post by Guides » Mon Mar 25, 2024 1:00 pm

A Note About Changing the Speed of Our Footage in Premiere

If you slow down your footage in Premiere 6.x, Premiere will automatically try to deinterlace the clip using the absolute worst method possible. If we were working with interlaced footage, maybe we’d want this, but our footage is progressive because we’ve already deinterlaced this. The only way to stop Premiere from having its way with slow clips is to change a certain setting on every clip that we slow down.

Premiere Pro 1.5 does not have this problem if told that we are working with “no fields”.

To fix this, on the timeline, right click on a clip that has been slowed down. Roll over “video options” and a new menu will expand next to it. Select the bottom option labeled “field options”. A new window should pop up. The checkbox at the bottom reads “Deinterlace when speed is below 100%” and is checked. Uncheck it, and hit OK. You will have to do this for every clip you slow down with Premiere 6.x.


Image Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Working with Footage

Post by Guides » Mon Mar 25, 2024 1:04 pm

Exporting Your AMV from Premiere

Exporting is really easy if you’ve been following along. Just set all your export settings to match your project settings. The whole trick is to not let Premiere change anything, especially your video size. Premiere resizes with a nearest neighbor filter which works fast, but looks bad, so it’s essential for the export to match the project which matches the source.

When you’re ready to build your final .avi, go to the file menu, select ‘export timeline’, and then select ‘movie’. Likewise, you can hit CTRL+M. Give your video a name, and click the settings button below it. A new window will pop up with your export settings. The first page is the general options, and is a little different than our project’s general options. For file type, select Microsoft AVI. For range, use ‘entire project’ if you have nothing extra before or after your video, otherwise mark off the area you want on the timeline and use ‘work area only’ to export only a segment. Check ‘export video’ and ‘export audio’, and you can check ‘open when finished’ as well, if you want the video to open inside of Premiere when you’re done.

Click the “next” button and you’re presented with the video options. Set this exactly the same as your project’s video options. Do the same for the audio settings, and the keyframe and rendering settings. Don’t touch anything in the final page named “special processing”. There are no enhancements there that we want to use.

When you’re done, click OK, and then click save. A progress meter will pop up while your render is in progress. Depending on the complexity of your video and the speed of your machine, it can take minutes, or hours, to export a whole AMV. The final huffyuv .avi file will also be quite large, so check your space ahead of time.


Image Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Distribution

Post by Guides » Mon Mar 25, 2024 1:28 pm

Distribution
Making an Mpeg2 That’s Suitable for an AMV Contest Screening
[Archivist note: Most conventions at present want the same mp4 you use for internet distribution (most easily created by using AMVTool).]


After exporting our final huffyuv avi, you probably notice two things. For starters, the video is huge. Like, 2GB+ huge. Secondly, it plays choppy. What we’re now going to do is use a program called TmpegEnc to compress an mpeg2, suitable for submission to any contest that accepts digital entries (such as those run by Otaku Video).

For starters, download tmpegenc from here: http://www.tmpgenc.net/e_main.html

Install it, and load it up. Since this is a demo version, we only have 14 days in which we can make mpeg2s. After that, we’re limited to mpeg1 until we buy it. No functionality is crippled however. Because there are a lot of settings, I can’t really go into the reasoning behind all of them in this guide, so I’ll let the screenshots do the talking, and explain some of the more questionable decisions.

For starters, load up your footage by clicking the browse button near the bottom, next to “video source”. Find your footage and press OK. The path to your video should appear in the video source box, and the audio source box. If you don’t like the output location, browse for a new one. When you’re ready, click the settings button to the right of these fields.

For starters, set the stream type to MPEG-2 Video. Then go down to “encode mode” and set it to “3:2 pulldown when playback”. This tells the mpeg2 to telecine itself on the fly, when played back. This way it meets NTSC spec and can be displayed properly on televisions and LCD projectors without appearing jerky.

Image Image



Your size should be already set to 720x480, and your aspect ratio should be 4:3 Display. The aspect flag is very important because it tells mpeg2 decoder cards, DVD players, and even windows media player (when in fullscreen mode) how to stretch your video to be displayed properly. Even if your video is 16:9, if you followed the letterboxing tutorial and added borders yourself, you should still flag your video as 4:3.

For frame rate, change it to 23.976. Because we selected 3:2 Pulldown with Playback, it will also tell us that equates to 29.97fps internal, meaning after telecine, the framerate will be 29.97.

For rate control, select manual VBR, and then hit the setting button. for maximum bitrate, enter 9350 kbits/sec. DVD, and some decoder cards, max out at 9800 kbits/sec, and that in- cludes audio, as well as a little extra overhead for the system stream. 9350 is as close as you can get while still keeping it safe. For minimum bitrate, put 0, meaning if tmpeg can draw the image perfectly without using as much as 9350kbits/sec, it will use as little bitrate as possible, but still take as much as it needs (up to 9350). For P picture spoilage and B picture spoilage, enter 0 for both of the values. Spoil- age is how much you’ll allow tmpeg to degrade the image in the interest of file size. We don’t care about file size, so we tell it not to spoil.

Hit OK, and set the VBV buffer rate to 224. This is the number required if you ever wanted to dump your video to DVD. Setting it to auto could produce a slightly better picture, but it would not be DVD ready.

The other two fields you have to change are DC Component precision (set to 10 for the most accuracy) and Motion Search Precision (set to highest quality: very slow).


Image Image



The next tab at the top is the advanced tab. The first change we must make, is changing the video source to progressive using the drop down box. Below, we’re asked for the field order, but since our source is progressive, this setting is irrelevant. Leave it at bottom field first. Change the source aspect ratio to simply “4:3 Display”. Technically, since we’re not resizing the video, the video arrange method shouldn’t matter, but I prefer to change it to simply “full screen” just to keep peace of mind.

The last change we make, is to check the box next to the noise reduction filter. Even if our source is clear, some minute compression artifacts may be present. Recompressing these artifacts will yield bigger ones that tend to dance around the screen and look really obvious. Noise reduction at the default settings (double click the filter to change the settings if you’re so inclined) will greatly help combat this. It will double the time it takes for you to make an mpeg, but it is worth it. Render while you sleep if you’re pressed for time.

In the next tab (GOP Structure) we have to make 3 changes for our stream to be DVD compliant. The output interval of sequence header has to be 1, and the max number of frames in a GOP has to be 18. Finally, check off “output bitstream for edit (closed GOP)”. Changing these settings will have no real effect on image quality, but they may bring up the file size just a little bit.

In the next tab (Quantize matrix) there’s very little we need to change. Take note though, in the drop down directly under the matrices, it reads “default”. Leave it as is, do NOT set this to CG/Animation. This will relax the analyzing precision which is fine for encoding whole episodes, but HORRIBLE for AMVs. At the bottom, click the checkbox for “soften block noise” and enter a value of 25 for each field.


Image Image Image



The next tab is the audio tab. Here we want to set our stream type to Mpeg-1 Audio Layer II. This stream will not be DVD compliant because audio on an NTSC DVD can only be uncompressed (no room given our large video bitrate) or ac3 (Dolby Digital requires a much heftier licensing fee than our $30 registration for tmpeg). This should not be a problem though because any convention that is mastering a DVD, should have enough sense to know how to extract and re-encode your audio.

Set the sampling frequency to 44100 to match our current sampling frequency. Set the channel mode to “stereo” to ensure maximum stereo separation. Joint stereo tends to blur the left and right channels together in the interest of saving file size. Set the bitrate to 384, which will produce an almost lossless encoding of our audio track. Finally, tick off the “error protection” checkbox to ensure a steady, in-sync stream.

In the system tab there is nothing that we have to change. The program type should have automatically set itself to “MPEG-2 Program (VBR)”. You can check “insert comment” and type in something to hide in the stream if you so desire. Certain media players will be able to display this.

Click OK, and then hit the start button located in the top left corner of the original window. Quality mpeg encoding is VERY slow but in the end, you’ll get a very clear video that takes up very little space compared to the huffyuv avi that we rendered out from Premiere.


Image Image

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

Distribution

Post by Guides » Mon Mar 25, 2024 1:31 pm

Creating a Progressive Scan MPEG2 for Conventions without MPEG2 Hardware, or for Personal Use.

While our 29.97FPS mpeg2 works great on computers with mpeg2 tv decoders (Such as Sigma Designs’ Netstream2000) and set-top DVD players, it has one problem. We had to telecine our video so it displayed properly on these mediums, and so we added interlacing. Some conventions (check before you submit) run their AMV screenings by loading up all the digital entries into a playlist, and playing them in media player via their computer’s desktop tv-out adapter or laptop’s VGA-output. For these situations, and for your own personal archive, you may want a copy of your video that maintains the original 23.976fps and deinterlaced nature.

Set everything up as mentioned on the previous pages, however in the “video” tab, set the encode mode to “non-interlace”. The frame rate should now simply read “23.976”. There is nothing else that is different from our original configuration. Click start, encode-away, and show off your work! Remember, if you’re playing this video in Windows Media Player, be sure to run it in fullscreen mode so that it scales to the proper aspect ratio!


Image



CONGRATULATIONS! YOU’RE DONE!

User avatar
Guides
Joined: Fri Oct 13, 2023 7:03 pm
Org Profile

End of Guide

Post by Guides » Mon Mar 25, 2024 1:31 pm

--- End of Guide ---

Locked

Return to “Guides & Tutorials”