Posted 1 year ago
·
Author
This is a collection of batch scripts I put together for doing audio/video work. I'll give brief instructions on how to use them but I'm going to assume you already familiar with batch scripts. If you're not, here's a YouTube tutorial: viewtopic.php?p=165068#p165068
Convert MP4 to WebM
This script allows you to convert an MP4 file to WebM by dragging n' dropping.
Instructions
Convert FLV to MP4
This script allows you to convert an FLV file to MP4 by dragging n' dropping.
Instructions
Note: This script requires ffmpeg with H.264 video encoding support via libx264. You can download a pre-compiled copy of ffmpeg with this support here: https://www.gyan.dev/ffmpeg/builds/
Convert M4A to MP3
This script allows you to convert an M4A file to MP3 by dragging n' dropping.
Instructions
If you want the command prompt window to automatically close after the any of these scripts are completed, remove
For those who are are interested in a more detailed explanation on how these scripts work,
Convert MP4 to WebM
This script allows you to convert an MP4 file to WebM by dragging n' dropping.
Spoiler: mp4towebm
Instructions
- Create a new text file.
- Copy and paste the code below into it.
- Replace
with the path to your fmmpeg executable.ffmpeg\ffmpeg
- Save it as batch script (.bat file) in the same folder as the ffmpeg folder.
- Finally drag n' drop an mp4 file onto it.
Convert FLV to MP4
This script allows you to convert an FLV file to MP4 by dragging n' dropping.
Spoiler: flvtomp4
Instructions
- Create a new text file.
- Copy and paste the code below into it.
- Replace
with the path to your fmmpeg executable.ffmpeg-5.1.2-essentials_build\bin\ffmpeg
- Save it as batch script (.bat file) in the same folder as the ffmpeg folder.
- Finally drag n' drop an mp4 file onto it.
Note: This script requires ffmpeg with H.264 video encoding support via libx264. You can download a pre-compiled copy of ffmpeg with this support here: https://www.gyan.dev/ffmpeg/builds/
Convert M4A to MP3
This script allows you to convert an M4A file to MP3 by dragging n' dropping.
Spoiler: m4atomp3
Instructions
- Create a new text file.
- Copy and paste the code below into it.
- Replace
with the path to your fmmpeg executable.ffmpeg\ffmpeg
- Save it as batch script (.bat file) in the same folder as the ffmpeg folder.
- Finally drag n' drop an mp4 file onto it.
If you want the command prompt window to automatically close after the any of these scripts are completed, remove
pause
from the end of the scripts.For those who are are interested in a more detailed explanation on how these scripts work,
%~dp0
is the ffmpeg executable path instead of the dropped file path. So if you have ffmpeg installed in c:\ffmpeg
%~dp0\ffmpeg\ffmpeg
will translate to c:\ffmpeg\ffmpeg.exe
. If you don't use this, it will attempt to look for ffmpeg in the same folder as the file you want to convert, unless you hard code the full path to your ffmpeg executable.%1
is the full path of the dropped file. So if you drag and drop a file from your desktop, %1
will translate to C:\Users\[your username]\Desktop\[your file].[ext]
. This allows you to drag and drop a file from anywhere without having to modify the script for each new file, making the script reusable.%~n1
is the full path to the dropped file without an extension. C:\Users\[your username]\Desktop\[your file].[ext]
becomes C:\Users\[your username]\Desktop\[your file]
. This is necessary so your converted file is named correctly. Otherwise you'd have to manually edit the script for each file you wanted to convert.