VicBond007's Guide to Working with DVD Footage [Written in 2004]
Moderator: Niotex
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Loading Footage with AviSynth
The next step is to tell avisynth what footage to look at, and subsequently pass to virtualdub.
The Mpeg2dec3 plugin does just that. The base syntax for Mpeg2dec3 is:
MPEG2Source("full path/whatever.d2v")
See figure 20 for an example of this line of code being added to our existing script.
Mpeg2dec3 supports other variables, and we will use one or two. One variable that’s important to us is the variable “idct”. It stands for Inverse Discrete Cosine Transformation and affects how accurately the mpeg2 file inside the .vob is read. More accurate methods may be slower, buggier, or both. Higher settings do not equal higher quality. We only need to adjust this parameter if the computer you’re on supports SSE2 processor instructions, such as a Pentium 4. If so, place a comma outside of the end quote for the file path, and add the line idct=5 before the end parentheses. See figure 21 for an example of the final line of code. Omitting this variable will not hurt the process any.
Mpeg2dec3 also supports deblocking and deringing through the “CPU” variable.
Deblocking will remove some artifacts from poorly compressed DVDs, whereas deringing tries to remove rainbow artifacts caused by poor
analog source (your digital DVD had to be mastered from something!). You can specify horizontal or vertical, as well as chromatic or luminance deblocking and deringing. If you have to use it, you might as well go all the way.
For maximum deblocking precision, use the value of 4. For deblocking and deringing, use 6.
Deringing will slow down your processing speed a LOT, so use it only if you notice rainbows in areas of high contrast. If your source is interlaced, you’ll also have to set the variable iPP to “true” to enable field based postprocessing.
The next step is to tell avisynth what footage to look at, and subsequently pass to virtualdub.
The Mpeg2dec3 plugin does just that. The base syntax for Mpeg2dec3 is:
MPEG2Source("full path/whatever.d2v")
See figure 20 for an example of this line of code being added to our existing script.
Mpeg2dec3 supports other variables, and we will use one or two. One variable that’s important to us is the variable “idct”. It stands for Inverse Discrete Cosine Transformation and affects how accurately the mpeg2 file inside the .vob is read. More accurate methods may be slower, buggier, or both. Higher settings do not equal higher quality. We only need to adjust this parameter if the computer you’re on supports SSE2 processor instructions, such as a Pentium 4. If so, place a comma outside of the end quote for the file path, and add the line idct=5 before the end parentheses. See figure 21 for an example of the final line of code. Omitting this variable will not hurt the process any.
Mpeg2dec3 also supports deblocking and deringing through the “CPU” variable.
Deblocking will remove some artifacts from poorly compressed DVDs, whereas deringing tries to remove rainbow artifacts caused by poor
analog source (your digital DVD had to be mastered from something!). You can specify horizontal or vertical, as well as chromatic or luminance deblocking and deringing. If you have to use it, you might as well go all the way.
For maximum deblocking precision, use the value of 4. For deblocking and deringing, use 6.
Deringing will slow down your processing speed a LOT, so use it only if you notice rainbows in areas of high contrast. If your source is interlaced, you’ll also have to set the variable iPP to “true” to enable field based postprocessing.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Telecined Interlaced Video
Aside from a progressive scan DVD right out of the box, the next best scenario is that the content of your DVD was originally 24 frames per second (23.97 to be exact) and then converted to NTSC spec (29.97 frames per second) through a process called telecine.
Film, and a surprising amount of animation, run at 24 frames per second. The television system that we use in America, Canada, and a lot of
other places in the world (NTSC) runs at 29.97 frames per second. The telecine process is where after 4 frames in a 24fps sequence, another frame is added where the even lines are the content of the previous frame, and the odd lines are the contents of the next frame. This makes 1 out of every 5 frames interlaced. There is also a method called 3:2 pulldown which replaces the 4th frame with an interlaced frame as well, though it is less common in animation (even if it is the “right” way to telecine video).
Confused? Go visit aluminum studios at:
http://www.aluminumstudios.com/digitalvideo/advanced/interlaced/interlaced.html
He has a lot more space to explain this than I do.
The important thing is to know that you should be looking to see if only 1 out of every 5 frames are interlaced or not. It should be a perfect sequence (p,p,p,p,i,p,p,p,p,i...etc.) If not, check for evidence of 3:2 pulldown (3 progressive frames followed by 2 interlaced frames). Either way, the video is telecined.
Even though a lot of animes (with the exception of movies) are not drawn at 24 fps, they are very often drawn at 12fps and each frame is doubled
up to the rate of 24fps. The scene is then telecined to get up to 30(29.97)fps.
Aside from a progressive scan DVD right out of the box, the next best scenario is that the content of your DVD was originally 24 frames per second (23.97 to be exact) and then converted to NTSC spec (29.97 frames per second) through a process called telecine.
Film, and a surprising amount of animation, run at 24 frames per second. The television system that we use in America, Canada, and a lot of
other places in the world (NTSC) runs at 29.97 frames per second. The telecine process is where after 4 frames in a 24fps sequence, another frame is added where the even lines are the content of the previous frame, and the odd lines are the contents of the next frame. This makes 1 out of every 5 frames interlaced. There is also a method called 3:2 pulldown which replaces the 4th frame with an interlaced frame as well, though it is less common in animation (even if it is the “right” way to telecine video).
Confused? Go visit aluminum studios at:
http://www.aluminumstudios.com/digitalvideo/advanced/interlaced/interlaced.html
He has a lot more space to explain this than I do.
The important thing is to know that you should be looking to see if only 1 out of every 5 frames are interlaced or not. It should be a perfect sequence (p,p,p,p,i,p,p,p,p,i...etc.) If not, check for evidence of 3:2 pulldown (3 progressive frames followed by 2 interlaced frames). Either way, the video is telecined.
Even though a lot of animes (with the exception of movies) are not drawn at 24 fps, they are very often drawn at 12fps and each frame is doubled
up to the rate of 24fps. The scene is then telecined to get up to 30(29.97)fps.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Pure Interlaced Video
When working with officially licensed DVDs, this type of interlacing is usually not present.
Pure interlaced video occurs when every frame that contains motion is interlaced. This is evident in DVDs that were mastered by capturing footage off VHS tapes or other analog sources, and is very common in bootleg (HK) DVDs. This has to do with how NTSC signals are transmitted and what creative liberties you can take when preparing footage to be displayed on a television.
Even if your broadcast is progressive scan, when captured to an analog source, it will be interlaced during any frames that have motion. Many times, DVD authoring studios have access to the original cells, and can construct properly telecined video for their DVD.
Deinterlacing this type of footage is not going to produce as good a result as deinterlacing telecined footage. We’ll go over 2 methods a little later on. One will blur the two interlaced fields together creating a ghosting effect, the other involves cutting the resolution of the video in half. Neither looks very good, so it’s highly advisable to stay away from bootleg/poorly mastered DVDs.
Checking Your Footage
Open up Virtualdub and using file/open, load up the .avs script we’ve been writing. Our video should load fine. Scroll to a scene with lots of action, and use the right arrow on your keyboard to advance frame by frame, and check for evidence of telecined footage (a sequence of progressive and interlaced frames) or pure interlaced footage (every, or almost every frame is interlaced).
When working with officially licensed DVDs, this type of interlacing is usually not present.
Pure interlaced video occurs when every frame that contains motion is interlaced. This is evident in DVDs that were mastered by capturing footage off VHS tapes or other analog sources, and is very common in bootleg (HK) DVDs. This has to do with how NTSC signals are transmitted and what creative liberties you can take when preparing footage to be displayed on a television.
Even if your broadcast is progressive scan, when captured to an analog source, it will be interlaced during any frames that have motion. Many times, DVD authoring studios have access to the original cells, and can construct properly telecined video for their DVD.
Deinterlacing this type of footage is not going to produce as good a result as deinterlacing telecined footage. We’ll go over 2 methods a little later on. One will blur the two interlaced fields together creating a ghosting effect, the other involves cutting the resolution of the video in half. Neither looks very good, so it’s highly advisable to stay away from bootleg/poorly mastered DVDs.
Checking Your Footage
Open up Virtualdub and using file/open, load up the .avs script we’ve been writing. Our video should load fine. Scroll to a scene with lots of action, and use the right arrow on your keyboard to advance frame by frame, and check for evidence of telecined footage (a sequence of progressive and interlaced frames) or pure interlaced footage (every, or almost every frame is interlaced).
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Using Telecide to Isolate Progressive Frames in a Telecined Sequence: Field Order
Telecide is an operation that analyzes our video sequence, looking for interlaced frames. It then uses the progressive frames before the suspect
frame, and after it, to accurately reconstruct a progressive image. Telecide does not alter the frame rate.
If our original footage was telecined up to 30fps, we will use the Telecide operation to remove the interlacing artifacts and reconstruct the progressive images. The basic syntax to load this operation is Telecide(). All the variables (and there are a lot!) will go inside the parentheses.
While omitting variables can/will invoke their default values, there is one variable we have to set before we can save our script.
Telecide needs to know the field order of our footage. Some footage is read even lines first, odd lines second, and some is read the other way around. The variable is named “order” and giving it a value of 0, will load the even fields (bottom) first, while 1 will load the odd fields (top) first. If your DVD is from North America, use order=0. If it is from Japan, user order=1. If you’re not sure, pick one, save your script, and load it in virtualdub. If the edges of things in action scenes look jagged, as if you were scaling up low resolution video, then your field order is backwards. Likewise, if the image looks perfectly smooth, then you guessed correctly.
Save your script, and open it in virtualdub if you want. We’re far from done, but this is a good way to check your scripting progress.
Telecide is an operation that analyzes our video sequence, looking for interlaced frames. It then uses the progressive frames before the suspect
frame, and after it, to accurately reconstruct a progressive image. Telecide does not alter the frame rate.
If our original footage was telecined up to 30fps, we will use the Telecide operation to remove the interlacing artifacts and reconstruct the progressive images. The basic syntax to load this operation is Telecide(). All the variables (and there are a lot!) will go inside the parentheses.
While omitting variables can/will invoke their default values, there is one variable we have to set before we can save our script.
Telecide needs to know the field order of our footage. Some footage is read even lines first, odd lines second, and some is read the other way around. The variable is named “order” and giving it a value of 0, will load the even fields (bottom) first, while 1 will load the odd fields (top) first. If your DVD is from North America, use order=0. If it is from Japan, user order=1. If you’re not sure, pick one, save your script, and load it in virtualdub. If the edges of things in action scenes look jagged, as if you were scaling up low resolution video, then your field order is backwards. Likewise, if the image looks perfectly smooth, then you guessed correctly.
Save your script, and open it in virtualdub if you want. We’re far from done, but this is a good way to check your scripting progress.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Using Telecide: Setting the Guide
Another variable that will help telecide isolate frames that need to be fixed, is the variable ‘guide’. By default, telecide uses no guide, and looks at every frame. If we know that our footage was telecined, we can set guide=1 so it can count frames and determine which ones it should spend more time analyzing. Guide can also be set to 2 or 3, but these modes are unimportant to us at the moment as they are both concerned with video encoded in the PAL format.
Another variable that will help telecide isolate frames that need to be fixed, is the variable ‘guide’. By default, telecide uses no guide, and looks at every frame. If we know that our footage was telecined, we can set guide=1 so it can count frames and determine which ones it should spend more time analyzing. Guide can also be set to 2 or 3, but these modes are unim- portant to us at the moment as they are both concerned with video encoded in the PAL format.
Postprocessing with Telecide
By default, when telecide runs across an interlaced frame, it checks around it, looking for the closest progressive frame, and then replaces the interlaced frame with that. If you have footage that is telecined, though inconsistently (almost every DVD I’ve run across is this way) then you may want to change this method. The variable for this is ‘post’ and it’s default value is 2. Changing it to post=4 will result in telecide using surrounding progressive frames as a guideline to deinterlace the current interlaced frame. This is recommended for anime DVDs that frequently cut in the middle of frame sequences. In a later step, we will be removing these frames anyways, so if you’re feeling really lucky, you can set post=0 for telecide to simply “tag” the frame to be removed. However, there’s always a chance of frames slipping through, so it’s better to be safe than sorry. Even on a grand scale (encoding the whole disc) the time difference between 0 and 4 is minimal. There is usually no visual quality tradeoff when employing post=4 over post=2.
Another variable that will help telecide isolate frames that need to be fixed, is the variable ‘guide’. By default, telecide uses no guide, and looks at every frame. If we know that our footage was telecined, we can set guide=1 so it can count frames and determine which ones it should spend more time analyzing. Guide can also be set to 2 or 3, but these modes are unimportant to us at the moment as they are both concerned with video encoded in the PAL format.
Another variable that will help telecide isolate frames that need to be fixed, is the variable ‘guide’. By default, telecide uses no guide, and looks at every frame. If we know that our footage was telecined, we can set guide=1 so it can count frames and determine which ones it should spend more time analyzing. Guide can also be set to 2 or 3, but these modes are unim- portant to us at the moment as they are both concerned with video encoded in the PAL format.
Postprocessing with Telecide
By default, when telecide runs across an interlaced frame, it checks around it, looking for the closest progressive frame, and then replaces the interlaced frame with that. If you have footage that is telecined, though inconsistently (almost every DVD I’ve run across is this way) then you may want to change this method. The variable for this is ‘post’ and it’s default value is 2. Changing it to post=4 will result in telecide using surrounding progressive frames as a guideline to deinterlace the current interlaced frame. This is recommended for anime DVDs that frequently cut in the middle of frame sequences. In a later step, we will be removing these frames anyways, so if you’re feeling really lucky, you can set post=0 for telecide to simply “tag” the frame to be removed. However, there’s always a chance of frames slipping through, so it’s better to be safe than sorry. Even on a grand scale (encoding the whole disc) the time difference between 0 and 4 is minimal. There is usually no visual quality tradeoff when employing post=4 over post=2.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Decimate: Eliminating Telecined Frames through AviSynth
Now that we’ve isolated the telecined frames, it’s time to save some space and increase the quality of our final output (you’ll see why later) by removing the telecined frames using the Decimate() operation.
Decimate() is added on a new line underneath Telecide() in our script. Decimate supports quite a few variables as well, but there is only one variable that we ever really need to touch, since the default values, for the most part, are optimized for our purposes.
By default, Decimate searches ahead by 5 frames, then removes the frame that is most like its surrounding frames. This is why it was so important for us to use telecide in our script, as it creates a situation with 3 (as oppose to 2) or 3 (as oppose to 4) identical frames in a row. With pure film sources without identical frames, this creates one. Regardless of the source, there’s an extra frame in the sequence and Decimate() will remove it. This process drops the frame rate down to 24fps (actually 23.976) and when coupled with telecide(), ensures that virtually all of the frames are progressive. This process is called Inverse Telecine.
Technically we could be finished at this point, but first it is recommended to use the variable “quality” and set it equal to 3 (quality=3) inside the parentheses for Decimate(). This ensures the highest quality of accuracy while searching the video stream, as it includes chromatic differences in the decision making process as well. The default value (2) does not do this. Changing this setting makes a very big difference with animation.
Now that we’ve isolated the telecined frames, it’s time to save some space and increase the quality of our final output (you’ll see why later) by removing the telecined frames using the Decimate() operation.
Decimate() is added on a new line underneath Telecide() in our script. Decimate supports quite a few variables as well, but there is only one variable that we ever really need to touch, since the default values, for the most part, are optimized for our purposes.
By default, Decimate searches ahead by 5 frames, then removes the frame that is most like its surrounding frames. This is why it was so important for us to use telecide in our script, as it creates a situation with 3 (as oppose to 2) or 3 (as oppose to 4) identical frames in a row. With pure film sources without identical frames, this creates one. Regardless of the source, there’s an extra frame in the sequence and Decimate() will remove it. This process drops the frame rate down to 24fps (actually 23.976) and when coupled with telecide(), ensures that virtually all of the frames are progressive. This process is called Inverse Telecine.
Technically we could be finished at this point, but first it is recommended to use the variable “quality” and set it equal to 3 (quality=3) inside the parentheses for Decimate(). This ensures the highest quality of accuracy while searching the video stream, as it includes chromatic differences in the decision making process as well. The default value (2) does not do this. Changing this setting makes a very big difference with animation.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Problems with the Decomb Plugin
Telecide and Decimate work by actually looking at the contents of the video stream on a frame by frame basis. For it to work properly, the 30fps sequence must have at least 24 progressive frames in it. For pure animation, this is almost always the case.
We run into trouble with modern animation that combines CG (Computer Generated) elements, with traditional cells. Nowadays, it’s not un- common for animated backgrounds, vehicles, and special effects to be done on computer instead. Because the computer is doing the work, these elements are usually done at a full 30fps.
These 30fps elements look nice, but confuse decomb a lot during sequences that combine CG and cells. This is very evident in magical girl transformation sequences where the character is hand drawn, but the backgrounds are rendered in a computer. Since the background is always moving and the character is not, it’s tricky for the plugin to find out which is the interlaced frame.
There are 3 solutions, none are perfect. The first would be to write a different script for every one of these sequences you want to rip. This creates a lot of wasted time, time better spent editing. Another option is, in the parentheses for Telecide, add blend=true to the list of variables. This will blend the interlaced frame with the frame after it, creating a ghosting effect, but smoothing out the image.
By default, Telecide drops the vertical resolution on the interlaced frame by 1/2, then scales it back up, eliminating the interlacing, but adding jagged edges. I recommend this approach, as it’s barely noticeable on a tv monitor anyways.
Telecide and Decimate work by actually looking at the contents of the video stream on a frame by frame basis. For it to work properly, the 30fps sequence must have at least 24 progressive frames in it. For pure animation, this is almost always the case.
We run into trouble with modern animation that combines CG (Computer Generated) elements, with traditional cells. Nowadays, it’s not un- common for animated backgrounds, vehicles, and special effects to be done on computer instead. Because the computer is doing the work, these elements are usually done at a full 30fps.
These 30fps elements look nice, but confuse decomb a lot during sequences that combine CG and cells. This is very evident in magical girl transformation sequences where the character is hand drawn, but the backgrounds are rendered in a computer. Since the background is always moving and the character is not, it’s tricky for the plugin to find out which is the interlaced frame.
There are 3 solutions, none are perfect. The first would be to write a different script for every one of these sequences you want to rip. This creates a lot of wasted time, time better spent editing. Another option is, in the parentheses for Telecide, add blend=true to the list of variables. This will blend the interlaced frame with the frame after it, creating a ghosting effect, but smoothing out the image.
By default, Telecide drops the vertical resolution on the interlaced frame by 1/2, then scales it back up, eliminating the interlacing, but adding jagged edges. I recommend this approach, as it’s barely noticeable on a tv monitor anyways.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Scripting with AviSynth
Deinterlacing Pure Interlaced Video with the FieldDeinterlace() Operation
If you’re unfortunate enough to have to work with pure interlaced material, you can still deinterlace it, but we can not effectively use telecide() or decimate() to clean up the combing artifacts. Instead we will use a third function of Decomb521 called FieldDeinterlace().
The default options for this function are all pretty good for our needs. By default, FieldDeinterlace blends each frame with the frame that occurs after it, regardless of whether or not it detects any interlacing artifacts.
If you would rather interpolate (scale down, then scale up) the video to eliminate the ghosting, you can by adding the variable ‘blend=false’. This will create a lot of rough edges though, and I would suggest against it in most situations.
You can also tell it to analyze the stream and only deinterlace the frames it sees as being interlaced, by adding ‘full=false’. If you do this, you may also need to change the variable ‘threshold’ as well if too many interlaced scenes are skipping through. By default, if full=false, threshold=20, where threshold can be assigned any number between 0 (all frames deinterlaced) and 255 (nothing deinterlaced). Deinterlacing all the frames would give your video a slightly softer look during areas of little-to-no motion, which is not necessarily bad.
I recommend against using full=false and blend=false, but it’s a matter of personal preference at this point. Try it out and see which one looks better for your material. For our purposes, we’re quite done with scripting at this point. So, play around with changing variables and see what works for you.
If you’re unfortunate enough to have to work with pure interlaced material, you can still deinterlace it, but we can not effectively use telecide() or decimate() to clean up the combing artifacts. Instead we will use a third function of Decomb521 called FieldDeinterlace().
The default options for this function are all pretty good for our needs. By default, FieldDeinterlace blends each frame with the frame that occurs after it, regardless of whether or not it detects any interlacing artifacts.
If you would rather interpolate (scale down, then scale up) the video to eliminate the ghosting, you can by adding the variable ‘blend=false’. This will create a lot of rough edges though, and I would suggest against it in most situations.
You can also tell it to analyze the stream and only deinterlace the frames it sees as being interlaced, by adding ‘full=false’. If you do this, you may also need to change the variable ‘threshold’ as well if too many interlaced scenes are skipping through. By default, if full=false, threshold=20, where threshold can be assigned any number between 0 (all frames deinterlaced) and 255 (nothing deinterlaced). Deinterlacing all the frames would give your video a slightly softer look during areas of little-to-no motion, which is not necessarily bad.
I recommend against using full=false and blend=false, but it’s a matter of personal preference at this point. Try it out and see which one looks better for your material. For our purposes, we’re quite done with scripting at this point. So, play around with changing variables and see what works for you.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Working with Footage
Working With Footage
Using Our Script to Generate an AVI that is Easy to Seek Through
[Archivist's note: If you want to use a method similar to this, use a lossless codec such as Huffyuv, Lagarith, Ut Video, or ProRes. If saving space is a priority, try an mp4 file with the h264 or x264 codec instead.]
Now that we’ve created a script and you’ve had some time to play around with your .avs in Virtualdub, you might have noticed something when scanning through your stream...it’s slow. Every time virtualdub displays a frame, it first has to apply all the plugin features that we’re using. There are also no keyframes, so it takes a lot of guess-and-check dragging to find the area we want.
This next step is a step that very few people do. In fact, I believe I’m the only person who does it because it can have a negative effect on quality, but nobody has ever complained about my video quality before, and I did win AWA Masters using this technique. If the Masters judges can’t tell, the general audience probably can’t either.
What we’re going to do is encode the ENTIRE DVD to a divx file. Not the poorly compressed divx fansubs that you might have downloaded (and edited with, FOR SHAME!) but a rather high bitrate encoding with minimal loss in quality.
Depending on the aspect ratio of your source, there may or may not be an extra step here. If your source footage is 16:9 (widescreen) then we’re going to need to add borders to letterbox the video. Your video may look a little horizon- tally stretched when previewing in virtualdub, this is ok. Without getting into ugly details, a tv pixel is taller than a pixel on a computer monitor, so this image will stretch vertically a bit when displayed PROPERLY on a tv. If the footage looks horizontally squished instead of stretched, then we’re working with 16:9 anime.
Using Our Script to Generate an AVI that is Easy to Seek Through
[Archivist's note: If you want to use a method similar to this, use a lossless codec such as Huffyuv, Lagarith, Ut Video, or ProRes. If saving space is a priority, try an mp4 file with the h264 or x264 codec instead.]
Now that we’ve created a script and you’ve had some time to play around with your .avs in Virtualdub, you might have noticed something when scanning through your stream...it’s slow. Every time virtualdub displays a frame, it first has to apply all the plugin features that we’re using. There are also no keyframes, so it takes a lot of guess-and-check dragging to find the area we want.
This next step is a step that very few people do. In fact, I believe I’m the only person who does it because it can have a negative effect on quality, but nobody has ever complained about my video quality before, and I did win AWA Masters using this technique. If the Masters judges can’t tell, the general audience probably can’t either.
What we’re going to do is encode the ENTIRE DVD to a divx file. Not the poorly compressed divx fansubs that you might have downloaded (and edited with, FOR SHAME!) but a rather high bitrate encoding with minimal loss in quality.
Depending on the aspect ratio of your source, there may or may not be an extra step here. If your source footage is 16:9 (widescreen) then we’re going to need to add borders to letterbox the video. Your video may look a little horizon- tally stretched when previewing in virtualdub, this is ok. Without getting into ugly details, a tv pixel is taller than a pixel on a computer monitor, so this image will stretch vertically a bit when displayed PROPERLY on a tv. If the footage looks horizontally squished instead of stretched, then we’re working with 16:9 anime.
- Guides
- Joined: Fri Oct 13, 2023 7:03 pm
Working with Footage
Encoding a 4:3 DVD to DivX with AviSynth and Virtualdub
[Archivist's note: If you want to use a method similar to this, use a lossless codec such as Huffyuv, Lagarith, Ut Video, or ProRes. If saving space is a priority, try an mp4 file with the h264 or x264 codec instead.]
With our .avs file open in virtualdub, go to the audio menu at the top, and select “no audio”. Even though there is no audio in the stream, virtualdub would have added dummy audio, wasting precious hard drive space and confusing windows media player.
Next, we’re going to go to the video menu and select compression (CTRL+P). A lot of people recommend changing the processing mode from “full processing mode” to “fast recompress”, however I’ve tried this on a number of computers, and there is absolutely no speed gain between the two modes.
Once in the compression dialogue, select DivX Codec 4.12 from the list on the left, and then click the ‘configure’ button on the right. A new window should pop up. What we’re going to do is tell DivX to use all the bitrate it possibly can, but only use as much as it needs. To do this, in the top left, change the “variable bitrate mode” from ‘1-pass’ to ‘1 pass-quality based’, using the drop down menu. Beneath that, in the performance/quality drop down, select “slowest” if it hasn’t already been done for you. To the right, near the middle, there’s a slider for “quality based encoding parameters”. By default it is 85%, meaning DivX will compress the video so that it looks 85% as good as the original, thus saving some file size. We want DivX to try to make the video look as good as possible, so drag this up to 100%. While you’re dragging sliders around, you can also change the ‘default postprocessing level’ slider to full by dragging it all the way to the right. Click OK, and OK again on the original codec window.
Go to file/save as .avi, give this disc a name, make sure you have a lot of space, then hit OK. Go to work, or take a nap. This will take a while.
[Archivist's note: If you want to use a method similar to this, use a lossless codec such as Huffyuv, Lagarith, Ut Video, or ProRes. If saving space is a priority, try an mp4 file with the h264 or x264 codec instead.]
With our .avs file open in virtualdub, go to the audio menu at the top, and select “no audio”. Even though there is no audio in the stream, virtualdub would have added dummy audio, wasting precious hard drive space and confusing windows media player.
Next, we’re going to go to the video menu and select compression (CTRL+P). A lot of people recommend changing the processing mode from “full processing mode” to “fast recompress”, however I’ve tried this on a number of computers, and there is absolutely no speed gain between the two modes.
Once in the compression dialogue, select DivX Codec 4.12 from the list on the left, and then click the ‘configure’ button on the right. A new window should pop up. What we’re going to do is tell DivX to use all the bitrate it possibly can, but only use as much as it needs. To do this, in the top left, change the “variable bitrate mode” from ‘1-pass’ to ‘1 pass-quality based’, using the drop down menu. Beneath that, in the performance/quality drop down, select “slowest” if it hasn’t already been done for you. To the right, near the middle, there’s a slider for “quality based encoding parameters”. By default it is 85%, meaning DivX will compress the video so that it looks 85% as good as the original, thus saving some file size. We want DivX to try to make the video look as good as possible, so drag this up to 100%. While you’re dragging sliders around, you can also change the ‘default postprocessing level’ slider to full by dragging it all the way to the right. Click OK, and OK again on the original codec window.
Go to file/save as .avi, give this disc a name, make sure you have a lot of space, then hit OK. Go to work, or take a nap. This will take a while.