News:

--

Main Menu

Batch to Resize an avi file.

Started by lanphuonglien, August 25, 2017, 02:12:31 PM

Previous topic - Next topic

lanphuonglien

Hello people,

I have a batch file with below code:

set avidemux="C:\Program Files\Avidemux 2.5\avidemux2.exe"
set videocodec=x264
set audiocodec=AAC
set outputformat=mp4
for %%f in (*.avi) do %avidemux% --force-alt-Xvid --load "%%f" --output-format MP4 --video-codec %videocodec% --audio-normalize --audio-codec %audiocodec% --save "%%f.mp4" --quit

And I was wondering if there is a way to resize the file in the convert process.

Could anyone have an idea how to do this?

Thanks.

Jan Gruuthuse

#1
Not certain this will work with 2.5 branch? If you don't have special reason to stay on 2.5 branch, move onwards to 2.7 branch.
Load a video type you want to resize with batch.
Set the filter for resizing. (this mostley only works with video of the same resolution).
Save as project file "ResizeXXX.py" (XXX could be (640, 720, ....) to give you future reference what script does.

Edit "ResizeXXX.py" and remove the reference to the video used to set the filter.
when edited addapt your commandline:
for %%f in (*.avi) do %avidemux% --force-alt-Xvid --load "%%f" --output-format MP4 --video-codec %videocodec% --audio-normalize --audio-codec %audiocodec% --save "%%f.mp4" --quit
and now insert "--run "ResizeXXX.py"
for %%f in (*.avi) do %avidemux% --force-alt-Xvid --load "%%f" --output-format MP4 --video-codec %videocodec% --audio-normalize --audio-codec %audiocodec% --run "ResizeXXX.py" --save "%%f.mp4" --quit

More details can be found here:
Simple Command line usage with Tinpy Project