Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: I12learn on September 20, 2012, 06:33:53 PM

Title: Python scripting
Post by: I12learn on September 20, 2012, 06:33:53 PM
Hello
Where I can find details for the functions available by python calls to the program libraries.
Title: Re: Python scripting
Post by: mean on September 21, 2012, 04:54:52 PM
open the python console
There is a help message that gives the commands/classes available
Title: Re: Python scripting
Post by: I12learn on September 22, 2012, 12:36:36 PM
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.
Title: Re: Python scripting
Post by: mean on September 22, 2012, 12:56:58 PM
That doc is the javascript one
The parameters are given through
"key=value" pairs
Title: Re: Python scripting
Post by: Jan Gruuthuse on September 22, 2012, 01:03:32 PM
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
Title: Re: Python scripting
Post by: I12learn on September 22, 2012, 01:39:43 PM
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.
Title: Re: Python scripting
Post by: mean on September 22, 2012, 03:20:05 PM
in the folder autononreg/py
there are some python examples
Title: Re: Python scripting
Post by: I12learn on September 24, 2012, 02:09:00 PM
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.
Title: Re: Python scripting
Post by: Lebenita on December 19, 2012, 08:02:33 PM
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?
Title: Re: Python scripting
Post by: mean on December 19, 2012, 08:16:04 PM
see screenshot
Title: Re: Python scripting
Post by: Lebenita on December 19, 2012, 08:51:56 PM
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?
Title: Re: Python scripting
Post by: rga156 on March 11, 2016, 02:56:24 PM
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?
Title: Re: Python scripting
Post by: Jan Gruuthuse on March 11, 2016, 03:20:52 PM
on your computer: QTscripting: copy paste in browser: file:///usr/share/avidemux6/help/QtScriptQT4/modules.htmlDon't click on main page

wiki:
- scripting (http://www.avidemux.org/admWiki/doku.php?id=using:scripting)
- command line usage (http://www.avidemux.org/admWiki/doku.php?id=using:command_line_usage)
and perhaps some here: Documentation & Tips (http://avidemux.org/smif/index.php/board,10.0.html)
Title: Re: Python scripting
Post by: mean on March 12, 2016, 08:38:48 AM
Beware, only tinypy is up to date/fully working
Title: Re: Python scripting
Post by: rga156 on March 12, 2016, 10:51:42 AM
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!
Title: Re: Python scripting
Post by: Jan Gruuthuse on March 13, 2016, 07:33:19 AM
load one video, make your required changes/settings in avidemux.
Then menu -> File -> Tinypy Project -> Save As Project

then edit the project and remove references to the loaded video and set markers. See 2nd posting below in the linked post


some more info here: Batch converting - Help please (http://avidemux.org/smif/index.php/topic,16640.0.html)
Title: Re: Python scripting
Post by: rga156 on March 14, 2016, 09:40:04 AM
Thank you! It all makes sense now  :)