Topic: No Auto-DVD

The help file says to use "Auto->DVD." No such menu item exists in 2.5.0. WTF am I supposed to do? Thanks (?)

Re: No Auto-DVD

The whole "Auto" menu has been revamped in Avidemux 2.5 wink

Instead of a few hardcoded presets, the "Auto" wizards are now scripted. Look in the "scripts\auto" folder.
This allows people to easily make their own wizards and share them with the community.

As you have noticed, a "DVD" wizard is still missing at the moment...

Re: No Auto-DVD

LoRd_MuldeR wrote:

...This allows people to easily make their own wizards and share them with the community...

Easily?

Re: No Auto-DVD

Easily?

Yep. Something like http://avidemux.org/admForum/viewtopic. … 729#p34729

Re: No Auto-DVD

betocchi wrote:
LoRd_MuldeR wrote:

...This allows people to easily make their own wizards and share them with the community...

Easily?

Yes. Now you can simply take one of the existing scripts and adapt it. Very basic JavaScript skills are required, that's it.
And you won't even need to re-compile Avidemux to include/test your script. Instead Avidemux will detect it at runtime.

Before you would have needed sufficient C++ skills. Also you'd have needed an environment to build Avidemux yourself!

Last edited by LoRd_MuldeR (2009-07-07 17:58:48)

Re: No Auto-DVD

So there is no way to create a DVD until someone creates a script for that purpose and shares it. I happen to be a programmer, and I'll tell you that the only people who could create such a script "easily" are those have been involved with Avidemux development. I have read the scripting tutorial and compared Microsoft Zune.js with Sony PlayStation Portable.js. I'm guessing that a script to create a DVD would call app.setContainer("DVD") or something like that. But no help for videoAutoWizard() is given by the tutorial and I don't understand exactly what its parameters mean. Given that each failed attempt at creating a correct script takes an hour to create an MPEG from an AVI and may waste a DVD-R attempting to see if the MPEG can actually be authored into a DVD that works in a DVD player, I would expect to spend several days writing and debugging the script. Does anybody happen to have a script to create a DVD from an AVI?

Re: No Auto-DVD

I have the same problem: No success yet in making a DVD,
which I assume would be the most used application.
I have read the other information pages and several settings but I have had no sucess yet.

I plan to post a big thread/comment about the user interface in general (See you there).

Re: No Auto-DVD

Hello ,

I also came acrosss the missing auto->DVD  script. Its hard to believe that in 2.5 there is no script that allows you to find the correct DVD settings whereas in 2.4 there was already help available.

Is there such a script available somewhere in between? 

I think if its as easy as described above there should be one by now?  Or is the only solution to go back to 2.4 or use another encoding software like devede or similar?

Thanks
Rainer

Re: No Auto-DVD

Here's a custom settings script I've just made with "theoretically" valid settings (to be put in %APPDATA%/avidemux/custom) : http://dl.free.fr/oMvUA7plY

Otherwise, just read this : http://avidemux.org/admWiki/index.php?t … ing_to_DVD

Re: No Auto-DVD

Hmm, it seems your script won't even resize the video, if the resolution is neither 720x576 nor 720x480.

So this won't give Video-DVD compliant output, if the source isn't already in PAL or NTSC resolution!

Re: No Auto-DVD

LoRd_MuldeR wrote:

Hmm, it seems your script won't even resize the video, if the resolution is neither 720x576 nor 720x480.

So this won't give Video-DVD compliant output, if the source isn't already in PAL or NTSC resolution!

Hmm, it turns out I never had problems when reading home-made DVD's with a non-standard resolution, but I suppose it's safer to be as compliant as possible wink Here's an updated script (v1.1) : http://dl.free.fr/o545hYwxf

Changes since v1.0 :
- Clears all previously applied filters (so they don't add N times when loading the script N times).
- Deinterlaces (libavcodec deinterlacer = linear blend; this is the most fool proof, even it it's slightly blurry)
- Resizes to 720x576 (bicubic)
- Changed target video size to 3900MB to allow for encoding 2h movie with the container overhead. The previous calculation was based on a 30 minute clip smile
Edit : - Removed XviD rate control since it seems to crash, will retry this later.

Last edited by DarkZell666 (2009-08-03 10:33:09)

Re: No Auto-DVD

Hello DarkZell666,

I used your script to transcode a DVB-S recording to DVD format. It worked with no problems. Thank you very much for your script!

Have a nice day
Rainer

Re: No Auto-DVD

rainer042 wrote:

Hello DarkZell666,

I used your script to transcode a DVB-S recording to DVD format. It worked with no problems. Thank you very much for your script!

Have a nice day
Rainer

I'm glad it worked, considering I only took 15 quick minutes to put something together, I'm actually surprised lol

Re: No Auto-DVD

DarkZell666 wrote:

- Deinterlaces (libavcodec deinterlacer = linear blend; this is the most fool proof, even it it's slightly blurry)

You really shouldn't blindly insert a deinterlace filter!

Applying a deinterlacer on progressive content destroys quality for no benefit.

Also if I wanted to burn interlaced content on a Video-DVD, I'd prefer creating an interlaced DVD for fluid motion wink

But if you really want to deinterlace, YADIF will give much better quality than libavcodec deinterlacer.

DarkZell666 wrote:

- Resizes to 720x576 (bicubic)

Why not use Lanczos method? It preserves much more detail.

DarkZell666 wrote:

Removed XviD rate control since it seems to crash, will retry this later.

Hmm. too bad.

I think Xvid rate control was added to the MPEG-2 encoder, because the original RC often failed to hit the target size.

Last edited by LoRd_MuldeR (2009-08-10 22:52:11)

Re: No Auto-DVD

LoRd_MuldeR wrote:
DarkZell666 wrote:

- Deinterlaces (libavcodec deinterlacer = linear blend; this is the most fool proof, even it it's slightly blurry)

You really shouldn't blindly insert a deinterlace filter!

Applying a deinterlacer on progressive content destroys quality for no benefit.

Also if I wanted to burn interlaced content on a Video-DVD, I'd prefer creating an interlaced DVD for fluid motion wink

But if you really want to deinterlace, YADIF will give much better quality than libavcodec deinterlacer.

DarkZell666 wrote:

- Resizes to 720x576 (bicubic)

Why not use Lanczos method? It preserves much more detail.

DarkZell666 wrote:

Removed XviD rate control since it seems to crash, will retry this later.

Hmm. too bad.

I think Xvid rate control was added to the MPEG-2 encoder, because the original RC often failed to hit the target size.

Hmm ... I chose to de-interlace since avidemux doesn't detect wether fields are TFF or BFF. What happens if the source is interlaced BFF and lavc re-encodes to TFF (per custom script settings) ? I was afraid it might be even worse than blindly de-interlacing (I haven't tested). Also, there would be more people complaining because interlacing artifacts were visible than because the picture is slightly blurry. As for using linear blend rather than yadif, yadif needs configuring per-source whereas linear blend doesn't. I suppose lanczos3 is a good idea, but when upsizing it creates (weak) ringing. I would only use it for downsizing IMHO.

Other cases aren't covered anyway :
- NTSC-land; the fps and resolution needs to be changed.
- Padding for 2.35 sources (16:9 ratio + black borders)

I suppose I could release other variants for usual use-cases, it shouldn't be too long. We'll see ...

The bottom line is that I went the most fool-proof way. Any savvy user would go and modify the script for their needs anyway right ? wink

Last edited by DarkZell666 (2009-08-11 09:20:48)

Re: No Auto-DVD

DarkZell666 wrote:

Hmm ... I chose to de-interlace since avidemux doesn't detect wether fields are TFF or BFF. What happens if the source is interlaced BFF and lavc re-encodes to TFF (per custom script settings) ? I was afraid it might be even worse than blindly de-interlacing (I haven't tested). Also, there would be more people complaining because interlacing artifacts were visible than because the picture is slightly blurry.

Slightly blurry? IMO you loose a whole lot of quality when "deinterlacing" a progressive source, especially with a "dumb" deinterlacer, such as libavcodec's "linear blend".

Also interlaced DVD's aren't unusual, even some "original" discs are interlaced...

DarkZell666 wrote:

As for using linear blend rather than yadif, yadif needs configuring per-source whereas linear blend doesn't.

Does it? If at all, you need to set the field order. But I think this has no significant effect as long as we aren't using Yadif in "Bob" mode. And we certainly won't use "Bob" mode here, since Video-DVD can't handle 50 fps progressive frames.

DarkZell666 wrote:

I suppose lanczos3 is a good idea, but when upsizing it creates (weak) ringing. I would only use it for downsizing IMHO.

Well, some rining is the price for detail retention, and I think it's worth the trade-off in case of Lanczos3.

Spline36 may perform even better than Lanczos, but isn't exposed in Avidemux...

DarkZell666 wrote:

Other cases aren't covered anyway :
- NTSC-land; the fps and resolution needs to be changed.

Yes. We could simply use the "Convert FPS" filter to convert the fps while keeping the duration (audio in sync). Unfortunately it produces jerky motion. So I prefer to simply speed-up/slow-down the FPS and then resample the audio to fix the sync. As long as the difference in FPS isn't too huge, this works perfectly fine (TV stations do the same).

DarkZell666 wrote:

- Padding for 2.35 sources (16:9 ratio + black borders)

Yes. I think the old "built-in" Auto DVD wizard did do that.

DarkZell666 wrote:

The bottom line is that I went the most fool-proof way. Any savvy user would go and modify the script for their needs anyway right ? wink

Sure. But you also sacrifice a lot of quality. People may complain that Avidemux produces less quality DVD's than other tools.

So these are just suggestions to make script even better...

Last edited by LoRd_MuldeR (2009-08-11 11:21:36)

Re: No Auto-DVD

Wizard != custom script, you know that already, and with a single script there are necessarily cases that can't be covered considering how the custom scripts work (1 script = 1 group of settings).
I'm aware of all the info you've mentionned. This script was intended to be a quick hack to help users wait for a potential Auto-DVD wizard, and that's what it actually is. I'll switch to lanczos3 though, thx.

Several solutions to the "No Auto-DVD" problem are available :
- Write the actual Auto-DVD wizard (I'm not capable of doing it ATM, I need to learn some stuff first).
- Provide a custom script for each use case (there are about a dozen, not something I had the time to do when I first had the idea) ==> This is what I might do in a couple of days.
- Provide a base custom script with the most important settings OK, and let the user adapt the other settings ==> This is what I chose to do first.
- Do nothing, and let users drown in the A/V encoding maze ... (no way lol ).

Re: No Auto-DVD

Well, after a couple headaches, here's my first attempt at an actual Auto DVD wizard.


This is only half-tested, and I needed to duplicate the code from filters.js just for the sake of using lanczos3 lol
It somewhat works. The thing that isn't dealt with AT ALL is de-interlacing, since there's no way to detect if a source is interlaced or not via scripting. I hesitate to add yet another drop-down box in there. If I did, I suppose it would have to have three options :
- Deinterlace + Encode progressive
- Encode progressive (no de-interlacing)
- Encode interlaced

Copy/paste in a file named DVD.js, and place it in <avidemux_install_directory>/scripts/auto to use it.

//AD
include("video/autoWizard.js");
include("video/functions.js");

//
// Auto DVD Wizard v1.0 contributed by DarkZell666
// http://avidemux.org/admForum/viewtopic.php?id=6278
//
var app = new Avidemux();

if (app.video == null)
    displayError("A video file must be open to use this Auto Wizard.");
else
{
    var result = videoAutoWizard("DVD Auto Wizard", [[720, 480], [720, 576]]);

    if (result)
    {
        var targetX = result[0][0];
        var targetY = result[0][1];
        var sourceRatio = result[1][0] + ":" + result[1][1];
        var destinationRatio = result[2][0] + ":" + result[2][1];

        _resizeAndFillVideo(targetX, targetY, sourceRatio, destinationRatio);

        var ratio169="00"; // 4:3 by default for DVD (lavc) encoder, 16:9 if specified.
        if (destinationRatio == "16:9")
            ratio169="01";
        
        var lastFilter = app.video.appliedFilters[app.video.appliedFilters.length - 1];
        
        if (targetY == 480 || getColourEncodingSystem(lastFilter.fps1000) != "NTSC")
            app.video.addFilter("resamplefps","newfps=30000","use_linear=0");
        else if (targetY == 576) {
            if (getColourEncodingSystem(lastFilter.fps1000) == "FILM") {
                app.audio.film2pal=true;
            } else if (getColourEncodingSystem(lastFilter.fps1000) != "PAL") {
                app.video.addFilter("resamplefps","newfps=25000","use_linear=0");
            }
        }
        
        app.video.codec("XDVD", "2PASS=4000", "160 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 1f 00 00 00 03 00 00 00 02 00 00 00 01 00 00 00 01 00 00 00 fe ff ff ff 01 00 00 00 fb ff ff ff cd cc 4c 3d 01 00 00 00 0a d7 23 3c 01 00 00 00 00 00 00 3f 00 00 00 3f 00 00 00 00 40 1f 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "+ratio169+" 00 00 00 02 00 00 00 40 1f 00 00 00 00 00 00 00 00 00 3f 00 00 00 00 00 00 00 3f 00 00 00 00 00 00 00 00 e0 00 00 00 00 00 00 00 00 00 00 00 ");
        
        if (app.audio.targetTrackInfo.length > 0)
        {
            if (app.audio.targetTrackInfo[0].codec != "AC3" || app.audio.targetTrackInfo[0].channelCount != 2 || app.audio.targetTrackInfo[0].frequency != 48000)
            {
                app.audio.codec("Aften",160,8,"a0 00 00 00 00 00 00 00 ");
                app.audio.resample = 48000;
                if (app.audio.targetTrackInfo[0].channelCount == 2)
                    app.audio.mixer = "NONE";
                else
                    app.audio.mixer = "STEREO";
            }
        }

        app.setContainer("PS");
    }
}




// Modded version with lanczos3 resize instead of bilinear
function _resizeAndFillVideo(targetX, targetY, sourceRatio, destinationRatio)
{
    var app = new Avidemux();
    var filters = app.video.appliedFilters;
    var width, height, fps1000;

    if (filters.length > 0)
    {
        var lastFilter = app.video.appliedFilters[filters.length - 1];

        width = lastFilter.width;
        height = lastFilter.height;
        fps1000 = lastFilter.fps1000;
    }
    else
    {
        width = app.video.width;
        height = app.video.height;
        fps1000 = app.video.fps1000;
    }

    // Resizing
    var scaledWidth = rescaleVideoDimension(width, sourceRatio, destinationRatio, getColourEncodingSystem(fps1000));
    var rX = scaledWidth / targetX;
    var rY = height / targetY;
    var newX;
    var newY;

    if (rX > rY)
    {
        // resize by X
        newX = targetX;
        newY = Math.round(height / rX);
    }
    else
    {
        // resize by Y
        newY = targetY;
        newX = Math.round(scaledWidth / rY);
    }

    // resize to multiple of 4
    newX -= newX % 4;
    newY -= newY % 4;

    if (newX != width || newY != height)
        app.video.addFilter("mpresize", "w=" + newX, "h=" + newY, "algo=2");

    // Black bars
    var barX = targetX - newX;
    var barY = targetY - newY;

    if (barX || barY)
        app.video.addFilter("addblack", "left=" + (barX >> 1), "right=" + (barX >> 1), "top=" + (barY >> 1), "bottom=" + (barY >> 1));
}

Comments/suggestions welcome wink

Re: No Auto-DVD

Beware, the resize filter must be adapated depending on the format (i.e. PAL vs NTSC)
The pixel aspect ratio is not the same

Re: No Auto-DVD

The wizard relies on rescaleVideoDimension (via getPixelAspectRatio) method in video/functions.js, which seemed to already take care of that. Could you detail a bit further ?

Re: No Auto-DVD

yes, you are prolly right

Re: No Auto-DVD

LoRd_MuldeR wrote:

Spline36 may perform even better than Lanczos, but isn't exposed in Avidemux...

Yet ? It would be nice to port it to Avidemux wink