View Full Version : Invoke AviDemux via command line and script
LongkerDandy
18th May 2011, 15:16
Hi
I'm writing a UPnP/DLNA server in java,
And I need AviDemux to do some ON THE FLY Transcoding.
Now I can export the script from AviDemux GUI, and invoked via avidemux2_cli.
But I don't know how to pass arguments to the script.
For example:
I need to change the input file name, segment rang, scale, etc
I think I may not need the script, only pure command line will do the job.
Still, I don't know how.
Thanks
LoRd_MuldeR
18th May 2011, 20:41
You can even combine the script and the command-line :)
For example make a script that only sets up the encoders and filters and everything, bout does NOT load the source.
Them from the CLI load the specific source file, apply the script for all the rest and save the result...
See also:
http://www.avidemux.org/admWiki/doku.php?id=using:command_line_usage
LongkerDandy
19th May 2011, 08:47
Thanks for the reply
From what I can see, the command line arguments is very limited.
Say I have a script, and I want change the max video bitrate based on files.
I don't know how to pass/set this value from command line, can I?
Regards
LoRd_MuldeR
19th May 2011, 08:58
Set the encoder and the encoder params (like target bitrate) via script. Invoke that script via CLI, after loading the video and before saving the video.
(You can setup the encoder in the GUI as desired, save the project as JS file and copy out the required script lines from the JS file)
LongkerDandy
19th May 2011, 10:16
I'm trying to invoke avidemux in Java, not manually
So I need kind of avidemux script template,
each time I call something like "avidemux2_cli --force-alt-h264 --load input.mkv --run MY_SCRIPT --save output.mp4 --quit",
I need specific different videobitrate, scale, ratio etc with the same script.
I‘also wondered where can I find the full api reference of avidemux script.
It seems the wiki doesn't list all of them.
For eg, the field of app.audio.targetTrackInfo
Thanks
LoRd_MuldeR
19th May 2011, 10:49
each time I call something like "avidemux2_cli --force-alt-h264 --load input.mkv --run MY_SCRIPT --save output.mp4 --quit",
I need specific different videobitrate, scale, ratio etc with the same script.
If the parameters/script needs adjustment each time, you could create the script "on the fly" before calling Avidemux.
Like:
echo REQUIRED_PARAMETERS > temp.js
avidemux2_cli --force-alt-h264 --load input.mkv --run temp.js --save output.mp4 --quit
(Depending what OpSys and Shell you use, the syntax might be a bit different)
I‘also wondered where can I find the full api reference of avidemux script.
It seems the wiki doesn't list all of them.
For eg, the field of app.audio.targetTrackInfo
For parameters missing in the Wiki, you'll have to scan the source code, I guess :rolleyes:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.