News:

--

Main Menu

Problem with a script to reduce files size.

Started by tomer-k, October 09, 2024, 08:56:43 AM

Previous topic - Next topic

tomer-k

Hi.
A few years ago, I used a script file that a friend made to reduce ~0.6GB TS files to ~0.14GB MP4 files. For some reason, the script doesn't work anymore (after I stopped using it for a long time). I was hoping that someone could tell me how to fix this problem. The script:

set avidemux="C:\Program Files\Avidemux 2.8 VC++ 64bits\avidemux.exe"
set videocodec=x264
for %%f in (*.TS) do %avidemux% --video-codec x264 %videocodec% --audio-codec Copy --load "%%f" --output-format MP4 --save "%%~dpnf.MP4" --quit

sark

#1
You do not say what doesn't work, or what errors you are getting.

I tested the script and it works fine for me. However, it is just a batch script that tells Avidemux to encode using the x264 encoder, and copy the audio stream. There are no settings to specify an output size or, quality.

Edit:
         Are you certain the path to Avidemux is correct. And you are still using that version?
Also, x264 is stated twice. Directly and as a set variable. Surprisingly, this didn't cause an issue when I tested.

eumagga0x2a

--load "%%f" must come first.

Quote from: sark on October 09, 2024, 12:20:25 PMAlso, x264 is stated twice. Directly and as a set variable.

Well noticed.

Quote from: sark on October 09, 2024, 12:20:25 PMSurprisingly, this didn't cause an issue when I tested.

Unrecognized command line arguments are ignored.

@tomer-k: Your batch script doesn't implicitly reduce file size, it re-encodes source video to H.264 with x264 using its default configuration. File size reduction is just a coincidental side effect, but if it works for you, then it is fine.