News:

--

Main Menu

Python scripting

Started by I12learn, September 20, 2012, 06:33:53 PM

Previous topic - Next topic

I12learn

Hello
Where I can find details for the functions available by python calls to the program libraries.

mean

open the python console
There is a help message that gives the commands/classes available

I12learn

Quote from: mean on September 21, 2012, 04:54:52 PM
open the python console
There is a help message that gives the commands/classes available
Thanks for the clue, well appreciated.
I'd ask a question regarding the documents found at /snapshot_8194/avidemux_plugins/ADM_scriptEngines/qtScript/src/html/index.html. How to address these functions in python language?
Avidemux().Editor.closeVideo(), is a correct syntax to call /snapshot_8194/avidemux_plugins/ADM_scriptEngines/qtScript/src/html/class_editor.html#ac4e1e84dcabc9443445905f3acbcf911 ?

I would note the puntuaction and case sensitive matter. Another is the way to pass in parameters. Tuple? List? Dictionary? json data formatted? xml?
Well, my purpose may go for few steps, not so deep. Just in case some other will look for answer.

mean

That doc is the javascript one
The parameters are given through
"key=value" pairs

Jan Gruuthuse

#4
with browser you have also access to these:
Avidemux 2.6 Scripting Reference
file://localhost/usr/share/avidemux6/help/QtScript/index.html
Avidemux 2.6 Scripting Reference:  example script
file://localhost/usr/share/avidemux6/help/QtScript/_transcode_directory_8admjs-example.html
Class List
file://localhost/usr/share/avidemux6/help/QtScript/annotated.html
copy paste into your browser address bar

I12learn

Yeah, if you look carefully I did that  ;D
These are details which would suite for ECMAScript, less detailed to work with python. I'd suggest to add some example in python. So one may try it out and modifying to reach the desired output.

mean

in the folder autononreg/py
there are some python examples

I12learn

I'm planning something like avidemux_jobs, but for CLI only. The main reason would take to launch the PC without any graphic server and its services to perform the prepared tasks. So there would be more power to use for avidemux.
Basically I't the first sight I tought avidemux_jobs was a cli application.
Anyhow, my intent would care for tested version like 2.5.6, which doesn't include python yet.

Lebenita

Quote from: mean on September 21, 2012, 04:54:52 PM
open the python console
There is a help message that gives the commands/classes available
Do you mean in Tools > TinyPy Shell? I did find the question mark symbol in Windows and the help entry in the application menu in Linux, but I didn't find any way to display a help message. Could you please give some directions?

mean


Lebenita

Ah, great, thanks!
Maybe the first part with the main classes could be printed right on opening so novice users (who need it most anyway) know?

rga156

Hi

I've just started with Avidemux and want to do some batch resizing. I started by following the Wiki scripting entry but that's for what I assume is an older version using ECMAscript and no longer much help.

Then I found this thread, but the link showing how to get the console help is giving me a 404 error.

I'm an experienced coder but my Python is weak - I can follow it OK but stumble a bit in writing it from scratch.

Are there any other resources I could access to help me get going, please?

Jan Gruuthuse

#12
on your computer: QTscripting: copy paste in browser: file:///usr/share/avidemux6/help/QtScriptQT4/modules.htmlDon't click on main page

wiki:
- scripting
- command line usage
and perhaps some here: Documentation & Tips

mean

Beware, only tinypy is up to date/fully working

rga156

Thanks for the replies. The Windows distro doesn't include any help on the tinypy scripting API and the detailed and helpful Wiki unfortunately doesn't seem to cover tinypy at all. Is the API currently documented anywhere?

What I'm looking to do is to create a set of much smaller files from my daughter's wedding video raw clips by making 30% resolution MP4s from the 90+ clips we've got, so I can more easily share them with her, to agree what should be in the final wedding DVD. So near, yet so far!