Recently, I needed to merge some mp4 files and srt files. If you only need to merge, it is very easy way you have. That is to use MP4Box. But I needed a hardcord subtitle version this time. I think MP4Box cannot give this type. Am I right? Anyway I couldn’t create a mp4 file with a hardcord subtitle by MP4Box, so I was searching for information and found this out on YouTube. It’s very nice. But, this time I had mp4 files more than twenty and have to set this about each mp4 file if I use VLC GUI. It’s very inconvenient. So I wrote a batch file as below.
For VLC batch file transcode information, see Transcode – VideoLAN Wiki.
setlocal enabledelayedexpansion
set VLCEXE="C:\Program Files\VideoLAN\VLC\vlc.exe"
set InputFileExtension=mp4
set OutFolder=
pushd %~dp0
if "!OutFolder!" NEQ "" (
if not exist "!OutFolder!" (
mkdir !OutFolder!
)
)
set Dist=!OutFolder!
for %%a in (%*) do (
if %%~xa==.!InputFileExtension! (
if "!OutFolder!"=="" set Dist=%%~dpa
cmd /c
!VLCEXE! -I dummy -vvv %%a --sout #transcode{vcodec=h264,scale=auto,acodec=mpga,ab=128,channels=2,samplerate=44100,soverlay}:file{dst=!Dist!\sub_%%~na.mp4,no-overwrite} :no-sout-all :sout-keep vlc://quit
)
)
popd
exit
After I did my job, I add some improvement to the batch.
[How to use]
About the batch file options.
The recipe for sweet potato yōkan that I often made this fall. Ingredients Sweet potato…
After a long time, when I checked broken links and fixed them, I got an…
I made a box, so I prepare the contents. Theme and Plugins. The theme is…
Hehe, it's been almost a year since my last post. I received a notification email…
About a week ago, I finally started to renew my sites, which I had been…
This website uses cookies.