PDA

View Full Version : AVIsynth DVD scripting challenge


Delphin
15th August 2005, 18:36
AVIsynth Scripting Challenge . . .

There are several DVD authoring applications which are freely available which allow users to create their own DVD’s from compatible MPEG2 streams, but many folks are running into problems getting them to work due to problems with their source video.

DVD authoring applications are quite fussy about the MPEG2 input video they will accept, either rejecting or re-encoding incorrectly formatted MPEG2 streams. This is required to insure compatibility with the narrow requirements of the DVD spec and insure compatibility with standalone players.

The preferred solution to formatting the video to DVD specifications prior to encoding is to do any required resizing and frame rate conversions using AVIsyth.

This is true even for encoders like CCE, BBMpeg, and TMPGenc, which can bypass AVIsynth and accept direct input options like AVI or MPEG files.

AVIsynth still remains the preferred front end processor in most cases because of the flexibility that it provides.

In other cases, bypassing AVIsynth is not even an option (for example with HC and QuEnc MPEG2 encoders).

As useful as AVIsynth is in the hands of an experienced user, it does qualify as ‘geek-ware’ from the perspective of many users who don’t feel like they should need to posses a masters degree in computer programming just to burn a DVD of little Johnny’s birthday party (or some old television shows they have captured on video).

So here is my challenge to the Doom9 regulars . . .

Can we come up with a one or two pre-configured scripts which are suitable for the creation of STANDARD NTSC and PAL DVD’s using HC, QuEnc or CCE?

The idea here is to create the ‘Mother of all AVIsynth scripts’ which has the artificial intelligence built in to do any required resizing, frame rate conversions, audio corrections, etc to GUARANTEE a proper DVD COMPLIANT MPEG2 stream will be encoded.

To do this we need as much intelligence and flexibility built into the script as possible, so the user can just tweak a few options like NTSC/PAL, and whether the output will be for QuEnc/HC or CCE, and have the script GUARENTEE a perfectly DVD compatible MPEG2 file will be created.

Gordian Knot is ok for automating the scripting when going the other direction from DVD to AVI but what we are talking about here is going from ANY AVI or Mpeg source to a DVD compliant MPEG2.

I think most of this could be done with just a well written AVI synth script by having AVIsynth detect the characteristics of the input video and react accordingly, but perhaps a separate ‘helper application’ like Gordian Knot (but tailored for going the other direction) is needed.

There are a few applications spicifically taylored for ‘ripping’ video FROM DVD SOURCES, and recoding it onto ANOTHER DVD, but what I am talking about here is an application flexible enough to deal with ANY AVI or MPEG1/2 source and still guarantee a DVD complainant MPEG2 will be created.

The idea of this challenge is not for everyone to post their favorite script that they created for a particular project like . . .

“I came up with this really killer AVIsynth script for converting ‘Insect Boy’ from the ‘narfVid’ codec to my custom less-than-lossless color hyperspace up-sampled format . . . “

But rather, to come up with a single flexible template script that we can point people to so they can adapt it to their particular application (but which has the intelligence built in to help guarantee a COMPLIANT DVD will be created EVERY TIME).

I don’t want to ‘reinvent the wheel’ here, so if anyone has seen a really good contender for a truly universal ‘mother of all AVIsynth scripts’ for DVD encoding please point me in the right direction.

Any ideas ??? :script:

bucketbuster
15th August 2005, 18:52
Maybe a little off-topic, but aren't there programs that can assist in making such scripts for you?
Like MovieStacker, swiftavs, avsedit.....

Pookie
15th August 2005, 19:20
The biggest problem (IMHO) would be trying to automatically determine IVTC, Interlace, Progressive, et al characteristics. That part is difficult even for "Geeks". Hong Kong movies come to mind.

Other than that, it would be pretty simple to create a batch file to do it all.

Mug Funky
16th August 2005, 13:48
a few thoughts occur:

how good must the quality be? a pretty foolproof method would consist of:
- an interlace/field order detector (possibly using MVtools motion-mask to get useful information on the direction things are heading... shouldn't be too difficult)
- a blend-converter to just whack in any frame rate and spit out an interlaced, field-blended video in the chosen standard (NTSC or PAL)

it helps things a great deal to have a source that's already a good size and rate (720 width, NTSC or PAL is always nice)

to get the mother of all scripts, there'd have to also be a telecine detection method. this might have to be done in 2 passes (though 1 pass with field-blending as a fallback is perfectly alright IMHO).

remember we're dealing with DVD output, with all that entails (like a high bitrate and a standard-definition output), so interlaced and blended is perfectly fine here.

it does qualify as ‘geek-ware’ from the perspective of many users

you got that right. i work in a room full of geeks and i'm the only person who knows their way around avs. but i've made enough automation that anybody here can convert a piece of video to PAL in equal or better quality than ye olde standards-converter by simply right-clicking the source file and selecting "make PAL avs", then right-clicking the avs and going "encode to MPEG-2" (with a prompt for bitrate, max BR, passes and aspect ratio, of course.

scharfis_brain
16th August 2005, 14:26
so interlaced and blended is perfectly fine here.

Hmmm. I think this is a personal preference.
I dislike fieldblending even on TV. Because it takes the 3:2 judder over to PAL and other downsides....

But fieldblending has one advantage: do not even try to think about the kind of input....

Delphin
16th August 2005, 22:33
Maybe a little off-topic, but aren't there programs that can assist in making such scripts for you?
Like MovieStacker, swiftavs, avsedit.....

A good General purpose AVS editor can help, but this assumes a certain degree of knowledge on the part of the user about how to make sure the video is DVD compliant.

Most of the DVD/VCD ‘helper’ applications I have seen in the past were only concerned with quick-n-dirty re-coding of video ripped from DVD sources.

From the links I was able to find describing MovieStacker, it looks like this program is closer to what I am looking for. The resizing feature of MovieStacker in particular looks like it would be very useful in taking care of properly cropping or ‘letter boxing’ a non 4:3 AVI input source, which can be really confusing for the uninitiated.

So, thanks for suggesting MovieStacker, I had not run across this program before.

Unfortunately, I still haven’t . . .

After finding a few enticing links showing some of the features of the program, I found a link indicating that the program had been withdrawn for re-writing due to licensing issues.

Is that true? It doesn’t seem to show up on Doom9, or CNET’s main downloads.com site.

Do you have a current valid ‘home page’ link for Movie Stacker?

Prodater64
16th August 2005, 22:47
After finding a few enticing links showing some of the features of the program, I found a link indicating that the program had been withdrawn for re-writing due to licensing issues.

Is that true?

Do you have a current valid ‘home page’ link for Movie Stacker?

1 - Yes, it is.
2 - We have not.

Delphin
16th August 2005, 23:45
a few thoughts occur:

how good must the quality be? a pretty foolproof method would consist of . . .



Thanks to everyone for the thoughts on IVTC and deinterlacing.

I don't think there is a single element in the process of video conversion and DVD authoring that stirs up as many different ideas as this subject.

So I think it's clear that if we want to do this a AVIsynth script, then there should still be a FEW options ;)

The source may be DV video which is REALLY interlaced, in which case it should certainly be left up to the user whether they want to deinterlace the video and encode progressive, or leave it alone and encode MPEG2 interlaced.

As far as IVTC goes . . .

Fortunately, in about 99% of the cases the video is either simple progressive, real interlaced, or telecined 'combed' video, so we only have to deal with a few simple choices.

Also, for those really crazy situations, we have a fallback 'plan b' option which is simply to DO NOTHING, and encode the MPEG2 as 'interlaced'.

This of course is not optimal encoding bandwidth wise if the original source video is 'combed' Telecined film, so if we can provide a few options to IVTC the source then that is preferable, but, because the target is DVD we always have the fallback option of leaving the source alone and just encoding it interlaced.

This 'fallback plan' is possible even when resizing is needed because we can do 'interlace safe' resizing (i.e. split the fields, resize them individually, then re-interlace them, which will preserve their temporal relationship).

So a reasonably smart automatic IVTC option coupled with the ability to override and set a 'manual' deinterlace or IVTC (or do nothing and encode interlaced) should be all that's needed.

trolltuning
17th August 2005, 16:32
You might take a look at how AviScript does this. It is inexpensive payware but there is a free trial version that will process video up to 10 minutes long. It will only accept AVI and D2V input without hand tweaking the scripts though.