Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th May 2011, 15:16   #1  |  Link
LongkerDandy
Registered User
 
Join Date: Oct 2008
Posts: 6
Invoke AviDemux via command line and script

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
LongkerDandy is offline   Reply With Quote
Old 18th May 2011, 20:41   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,230
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...and_line_usage
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 19th May 2011, 08:47   #3  |  Link
LongkerDandy
Registered User
 
Join Date: Oct 2008
Posts: 6
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
LongkerDandy is offline   Reply With Quote
Old 19th May 2011, 08:58   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,230
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)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 19th May 2011, 10:16   #5  |  Link
LongkerDandy
Registered User
 
Join Date: Oct 2008
Posts: 6
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
LongkerDandy is offline   Reply With Quote
Old 19th May 2011, 10:49   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,230
Quote:
Originally Posted by LongkerDandy View Post
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)

Quote:
Originally Posted by LongkerDandy View Post
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
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 19th May 2011 at 10:55.
LoRd_MuldeR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.