Author Topic: Python scripting  (Read 11428 times)

I12learn

  • Jr. Member
  • **
  • Posts: 75
Python scripting
« 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.

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10969
Re: Python scripting
« Reply #1 on: September 21, 2012, 04:54:52 PM »
open the python console
There is a help message that gives the commands/classes available

I12learn

  • Jr. Member
  • **
  • Posts: 75
Re: Python scripting
« Reply #2 on: September 22, 2012, 12:36:36 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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10969
Re: Python scripting
« Reply #3 on: September 22, 2012, 12:56:58 PM »
That doc is the javascript one
The parameters are given through
"key=value" pairs

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Python scripting
« Reply #4 on: September 22, 2012, 01:03:32 PM »
with browser you have also access to these:
Avidemux 2.6 Scripting Reference
Code: [Select]
file://localhost/usr/share/avidemux6/help/QtScript/index.htmlAvidemux 2.6 Scripting Reference:  example script
Code: [Select]
file://localhost/usr/share/avidemux6/help/QtScript/_transcode_directory_8admjs-example.htmlClass List
Code: [Select]
file://localhost/usr/share/avidemux6/help/QtScript/annotated.htmlcopy paste into your browser address bar
« Last Edit: September 22, 2012, 01:07:57 PM by Jan Gruuthuse »

I12learn

  • Jr. Member
  • **
  • Posts: 75
Re: Python scripting
« Reply #5 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.

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10969
Re: Python scripting
« Reply #6 on: September 22, 2012, 03:20:05 PM »
in the folder autononreg/py
there are some python examples

I12learn

  • Jr. Member
  • **
  • Posts: 75
Re: Python scripting
« Reply #7 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.

Lebenita

  • Newbie
  • *
  • Posts: 16
Re: Python scripting
« Reply #8 on: December 19, 2012, 08:02:33 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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10969
Re: Python scripting
« Reply #9 on: December 19, 2012, 08:16:04 PM »
see screenshot

Lebenita

  • Newbie
  • *
  • Posts: 16
Re: Python scripting
« Reply #10 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?

rga156

  • Newbie
  • *
  • Posts: 3
Re: Python scripting
« Reply #11 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?

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Python scripting
« Reply #12 on: March 11, 2016, 03:20:52 PM »
on your computer: QTscripting: copy paste in browser:
Code: [Select]
file:///usr/share/avidemux6/help/QtScriptQT4/modules.htmlDon't click on main page

wiki:
- scripting
- command line usage
and perhaps some here: Documentation & Tips
« Last Edit: March 11, 2016, 05:19:50 PM by Jan Gruuthuse »

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10969
Re: Python scripting
« Reply #13 on: March 12, 2016, 08:38:48 AM »
Beware, only tinypy is up to date/fully working

rga156

  • Newbie
  • *
  • Posts: 3
Re: Python scripting
« Reply #14 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!