News:

--

Main Menu

avidemuxcli3, how to resize videos?

Started by I12learn, April 19, 2014, 04:40:21 PM

Previous topic - Next topic

I12learn

Hello,
I'd like to apply resizing to a bunch of video, via batch it's preferred.
I saw in the package some ready functions, like */share/ADM_scripts/video/filter.js.
Here's the question, I'm not aware of ECMA scripts, how to make a script which will be loaded at the CLI and proceed to do me the right processing.
Basically I'd like to have to try out some options

  • First size about 800x480 (the bigger will be reduced and then keep the aspect ratio(AR)
  • Second size maximum width of 1280 the other dimension to reduced with AR
  • If original dimensions are below requested ones, nothing to apply
I think some beginning should be like//AD

include("video/filter.js");

var app = new Avidemux();

But the rest is uncertain. I'd like rather to think as tinypy script, but where'll be the difference?
Meanwhile I'll try something

mean

Look at the DVD etc... auto script
They are tinypy and do resizing (they even compute the size they want to resize to)


I12learn

Sorry, I bit late. I'm busy to get around this matter, with different approach.  :-\  :-[
Here's the snippet (taken from DVD.js):    var result = videoAutoWizard(QT_TR_NOOP("DVD Auto Wizard"));

    if (result)
    {
        var props = getVideoProperties(app.video);
        var fps1000 = props[2];
        var targetX = 720;

        if (getColourEncodingSystem(fps1000) == "NTSC")
            targetY = 480;
        else
            targetY = 576;

        var sourceRatio = result[1][0] + ":" + result[1][1];
        var destinationRatio = result[2][0] + ":" + result[2][1];

        resizeAndFillVideo(targetX, targetY, sourceRatio, destinationRatio);


Well, I'd rather like to avoid the use of videoAutoWizard(QT_TR_NOOP("DVD Auto Wizard")) and assume a fixed aspect ratio to 1:1.

if I just want to keep one of the 2 dimension into the given limits, my question would be about what are the sourceRatio and destinationRatio, values?
Basically, I'd like to skip all the interactions and go straight to define (for example)
var targetX = 1280
var targetY = 768
var sourceRatio = '1:1'
var destinationRatio) = '1:1'
resizeAndFillVideo(targetX, targetY, sourceRatio, destinationRatio);


Avidemux v (r9024), I didn't find tinypy scripts. Maybe I should try a more recent setup.

Jan Gruuthuse


I12learn

I would like to have a preset to load and use a batch conversion, without gui, as per option to run on my home server.
That thread and its script were taken for good, but some video needs to be downsized.

Jan Gruuthuse

#5
the load settings is the easy part:
- make the required settings for certain type of video (container, codec(s), resolution, ...) in avidemux GUI
- save this from menu: File: Tinypy Project: Save as Project. Give these a recognizable name so you know what the job does.
- edit the saved job with gedit or notepad++ (don't use word processing program)
-- remove the line (in bold) pointing to the video file used in it:
Quote#PY  <- Needed to identify #
#--automatically built--

adm = Avidemux()
adm.loadVideo("/media/Recording/720p4audioTracks3sat.ts")
-- save job
- the saved job can now be called from command line with switch --run SavedJob.py
some more info: http://www.avidemux.org/admWiki/doku.php?id=tutorial:batch_processing#tips

the hard part: I don't know how to get/recognize the criteria to detect resolutions to use in script to call what job you want.

update: some wild guessing:
in batch/scripte you would need to call avidemux or another program, perhaps mediainfo if you can't do it with avidemux.
get the info you require (perhaps filtering output) and based upon that info select the wanted job to call on the command line.
as I'm not that great in scripts, can't offer you much help on this process. sorry


I12learn

Dear Jan,
the auto resizing is a different story.
I have a good setting since last time, but the input files are of different size. The old setting it just take the input file and convert it in a different muxer.
There's a good script in */lib/ADM_plugins6/autoScripts/dvd.js, but it is with a dialog option. I can't assume options for batch process. I would assume a fixed maximum dimensions and the AD would recalculate the new size.
The only unknown variables are sourceRatio, destinationRatio

Jan Gruuthuse

#7
I'm doing this manually: creating sub folder(s) for different resolutions or sources and have the script in there running with the correct settings from a job.py. Not as nice solution. But a solution is beyond my scripting capability.
I figure you could get there with some kind of conditional testing before loading video in avidemux. And execute a job on that condition. Perhaps someone finds a solution for you.

I12learn

Quote from: Jan Gruuthuse on April 30, 2014, 06:22:24 AM
update: some wild guessing:
in batch/script you would need to call avidemux

Avidemux has the power and the capabilities, no external call are needed. It can rearrange the new frame size and additional padding if any.
My difficulties are about understand what means those 2 parameters and then ... les joeux son fait :)