Author Topic: encoding multiple avi files with subtitles to mp4 container  (Read 3299 times)

gaarr

  • Newbie
  • *
  • Posts: 2
encoding multiple avi files with subtitles to mp4 container
« 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.
« Last Edit: March 31, 2012, 04:23:41 AM by gaarr »

Agent_007

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3163
Re: encoding multiple avi files with subtitles to mp4 container
« Reply #1 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.
Code: [Select]
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
)
« Last Edit: April 01, 2012, 08:34:30 AM by Agent_007 »
I am away between 15th of May - 15th of June. (yes, I am playing D3)

gaarr

  • Newbie
  • *
  • Posts: 2
Re: encoding multiple avi files with subtitles to mp4 container
« Reply #2 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

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: encoding multiple avi files with subtitles to mp4 container
« Reply #3 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
Code: [Select]
%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.
« Last Edit: April 02, 2012, 06:07:19 AM by Jan Gruuthuse »