I often need to extract some video sequences from a dvd, fade them in and out, join them back together and sometimes add subtitles. So far I've been converting the dvd to avi and done all the editing with VirtualDub and Avisynth. However, it would be nice if I could create a new dvd with the edited clips (for playback in a standalone dvd player), but as you know, avi to dvd tends to be lossy. Is there a better way to do this editing with not too expensive software? Should I/can I avoid avi? I would be thankful for comments and suggestions!
+ Reply to Thread
Results 1 to 16 of 16
That sounds good, I'll try. Thanks!
TMPGenc Plus to get a DVD? Feeding it the frameserved video out of VirtualDub works, but what then? Do you create an mpg file, or m2v and wav? What are the steps? Thanks!
Edit: Ugh, I saved the file as .mpg and it's massively pixelated ...
Last edited by Sebastian2011; 5th Feb 2012 at 15:16.
VDub involved (except to test out the script before encoding)? Those things can all be done in the script which can then be opened in the MPEG-2 encoder of your choice.
Or, encode to a lossless AVI (Lagarith or UT, for example) which can then be frameserved by an AviSynth script (and AVISource) into your encoder.
...but as you know, avi to dvd tends to be lossy.
TMPGenc Plus via frameserving and those are (or seem) fine, but when I author a dvd out of them with DVDFlick, in one of the clips the audio is out of sync. That has always been my main problem with avi to dvd conversion. Since you say it's painless for you, maybe you have an idea what causes this, please??
I've found a way that works well for me. So I thought it would be useful to write all the steps down in order to remember them, and that I might as well do it here where it might help somebody else. Also, since I'm pretty much a noob who got lucky finally figuring something out that works, you might have suggestions for improvement which I'd be happy to read.
So, the task is to cut video sequences from different sources, add subtitles, and author a new DVD, obviously retaining as much quality as possible. All tools I use except for TMPGenc Plus are free.
1st step: Preparing files for editing in Avisynth/Virtualdub
If the source is a DVD, I use DVD Shrink to extract the sequences I want according to this guide. This way I don't have to rip or copy the whole DVD which saves time. This gives me some .vob files containing the sequences I need.
Then I use DGIndex (part of the DGMPGDec package) to generate a .d2v file containing the video and an .ac3 or .wav file containing the audio. It doesn't matter if the needed sequence is split up into several .vob files by DVD Shrink since the content will be joined back together in the files DGIndex produces. Just put all the .vobs into the file list via File -> Open in the right order. Select Demux all tracks as audio output option and save via File -> Save Project.
2nd step: Editing files with Avisynth/Virtualdub
If the source was a DVD, load the .d2v file generated by DGIndex into Avisynth using the filter DGDecode out of the DGMPGDec package:
I load the .ac3 audio file that DGIndex created using the NicAudio plugin:
[Edit: in an earlier version, I said I'd converted the .ac3 to .mp2 to load that one with NicMPG123Source. This was because I sometimes had trouble getting the .ac3 to work in Virtualdub, probably for this reason.]
To join video and audio together, I use a script like
Since this still contains everything from the raw cut made with DVD Shrink, further cutting might be needed. This can simply be done using variables for the sequences I need, eg.:
I get the frame numbers used for the trim function simply by loading the raw clip via AviSynth into VirtualDub, finding the scenes where I want the cuts and writing the frame numbers down. To create nice transitions, I use AviSynth's FadeIn() and FadeOut() filters, or, if all fades should have the same duration, the Dissolve() function as in this example which tends to run more smoothly. If needed, I add some black frames at the beginning and end or in between joined clips using the BlankClip() function.
If the source is an .mkv or .mp4 file, I load it with FFMpegSource2(), and .avis with AviSource().
3rd step: Subtitles
I open the .avs script in VirtualDub to check if everything is as desired. Fine-tuning is easily done by editing the .avs file, saving and using File -> Reopen in VirtualDub. If everything is right, I save the clip with Xvid compression in low quality. The resulting .avi is only an intermediate dummy file used to make the subtitles.
I open the dummy .avi in Subtitle Workshop, start a new subtitle file and save the subtitles as .srt. I use DivXLand Media Subtitler to convert the .srt to .ssa, picking fonts, colors, size etc. under Settings -> Format Settings. The .ssa file can then be opened and previewed in VirtualDub using the Subtitler filter.
4th Step: Frameserving to TMPGenc Plus
In VirtualDub, I save a couple of seconds of the clip as an uncompressed .avi to open this .avi in GSpot or MediaInfo to check its properties; aspect ratio, framerate etc. Then I start the VirtualDub frameserver and open the .vdr file in TMPGenc Plus. The software has a lot of settings; brief explanations of them are found here. Some trial and error might be in order to get good results if you're not an expert. To make trial and error easier, you can select a tiny portion of the clip in VirtualDub before frameserving, so that TMPGenc Plus only needs a few seconds to encode and you can quickly check the result.
I don't know why, but I found that having TMPGenc Plus create .mpg files and authoring them to a DVD with DVDFlick didn't get me anywhere - the quality was not that good and sometimes the audio was out of sync, which were the same problems I had when I fed .avis to DVDFlick and were the reasons I tried frameserving in the first place.
However, having TMPGenc Plus create an .m2v video and a .wav audio file so far solved it for me.
If no subtitles are needed, I use VirtualDub only for previewing and generating a small clip to check its properties in GSpot and feed the .avs file directly to TMPGenc once I'm happy with the preview.
5th step: Authoring new DVDs
If I don't need a DVD menu and only one clip on a DVD that autostarts, I use Muxman, which is quick, easy and produces good results. If I want several clips on a DVD that can be accessed via a menu, I use GUI for DVDauthor. The GUI doesn't accept .wav files, so again, I convert the .wav that TMPGenc Plus produced to .ac3 using BeLight.
This got me DVDs that run fine on several standalone DVD players in what I consider pretty high quality. If there are any questions, I'll answer them if I can. Thanks to everyone who helped me!
Last edited by Sebastian2011; 4th Apr 2012 at 10:50.
VirtualDub seems to have problems with NicAc3Source. It loads the script, but when I hit "play", it only moves forward one frame and does nothing more. However, if I save the clip or a selection as avi, that avi works. Do you have an idea what could cause this?
DGIndex puts out. I converted a random mp3 to ac3 with BeLight, called that ac3 with the otherwise identical AviSynth script in VirtualDub and it worked. Next I re-encoded the original ac3 as ac3, and then it worked too.