Avidemux Forum

Avidemux => Windows => Topic started by: gaarr on March 31, 2012, 04:19:37 AM

Title: encoding multiple avi files with subtitles to mp4 container
Post by: gaarr on March 31, 2012, 04:19:37 AM
I have spent many, many hours searching for an answer and am now just confused

I have multiple avi files and i need to burn ass subtitles on it and encode that in mp4 container

i dont know how to make scripts

can someone show me how to do a script that does that

thanx in advance.
Title: Re: encoding multiple avi files with subtitles to mp4 container
Post by: Agent_007 on April 01, 2012, 08:32:10 AM
1. Do the settings for one file via GUI, then save the script via File -> Save project as...
2. Edit the saved file with text editor, remove all video loading related functions and possible save function.
3. Change subtitle filename to something generic, so you can copy the file over it.

e.g. you have files like
movie1.avi
movie1.ass
movie2.avi
movie2.ass
.
.

then you use name like subtitle.ass in the JS script, and in .bat you copy the current subtitle file to be it.

set avidemux="C:\Program Files\Avidemux 2.5\avidemux2.exe"
for %%f in (*.avi) do (
set subtitletempname="%%f:~0,-3"
set subtitlefinalname=%subtitletempname%.ass
copy %subtitlefinalname% subtitle.ass
%avidemux% --force-alt-h264 --load "%%f" --run something.js --save "%%f.mp4" --quit
delete subtitle.ass
)
Title: Re: encoding multiple avi files with subtitles to mp4 container
Post by: gaarr on April 01, 2012, 11:48:32 PM
am confused here

i know avidemux load the video files seperatly from the subtitles

subtitles are loaded under filter line

where do i put in the script the directory adress which the .avi files are in?

where do i put in the script the directory adress which the .ass files are in?

or the .ass files load automatically if with same name as the video files

thanx for the reply
Title: Re: encoding multiple avi files with subtitles to mp4 container
Post by: Jan Gruuthuse on April 02, 2012, 05:54:47 AM
Before you start the script go in to the directory where .avi are.
My guess would be to have the .ass in the same directory with the .avi video clip
Agent_007 made the script, when the avi loads the script loads the .ass for that video clip.
Condition: Both must have the same filename! like:
ThePirate.avi
ThePirate.ass
%avidemux% --force-alt-h264 --load "%%f" --run something.js --save "%%f.mp4" --quit

paths to directory in script can be added in this way:
Quote--run C:\script\something.js
If you made a special directory for your scripts.
Not sure the following is how it should work:
Quote--load "D:\avi\%%f"
Quote--save "E:\mp4\%%f.mp4"
Need to use of course your hard disk drive letters and directories. Short test should show if this works.