alass application:
https://github.com/kaegi/alass
related Videohelp post:
https://forum.videohelp.com/threads/409007-Reporting-on-subtitle-quality#post2684596
I'm using alass to sync subtitles and trying to create a bat file that scans a folder of video files that also contain a list of the out-of-sync subtitles (same names as the videos).
The bat file should analyse the .srt files in sequence and output a synced subtitle with the same name as the unsynced.srt file folder.
The command prompt for a single video/sub works fine.
Code:alass.bat "xmas special.mkv" "xmas special.srt" new.srt.
Assume the folder has 9 videos/srt files, sync the first file then move to second file, etc
The following line supposed to step through the list
My effort to test multiple files ends in the app crashing - probably caused by my lack of understanding bat files syntax.Code:for %%x in (1, 1, 9) do sync.bat "%%x.mkv" "%%x.srt" "%%x.fixed.srt"
+ Reply to Thread
Results 1 to 7 of 7
-
-
I haven't followed this through so there may be errors, but the following may help.
From Microsoft commandline help: (for/?)
Picking upper case variable names like %I makes it more readable and
avoids confusion with the modifiers, which are not case sensitive.
Try this.
sync.bat
Code:@echo off for %%I in (*.mkv) do call alass.bat "%%I" "%%~nI.srt" "%%~nI.fixed.srt" pause
Code:@echo off if not exist New\ md New for %%I in (*.mkv) do call alass.bat "%%I" "%%~nI.srt" "New\%%~nI.srt" pause
-
@pcspeak
Many thanks for your help to get the app working the way I wanted..
Using your bat file,the folder of input files is processed quickly.
All subs are processed to the new folder and can be tested using VLC player to verify sync.
Again, thank you for pointing out how to add clarity to dos files. -
For me the next step would be to replace the old srt stream with the one in the New\ folder, creating a second mkv in the New\ folder.
After the batch file checks if a new srt file exists.
Edited to make the subs forced so VLC won't get confused with having an embedded subs stream in the mkv AND a separate srt file, both in the \New folder..
Code:@echo off if not exist New\ md New for %%I in (*.mkv) do call alass.bat "%%I" "%%~nI.srt" "New\%%~nI.srt" for %%I in (*.mkv) do if exist "New\%%~nI.srt" ffmpeg.exe -i "%%I" -sub_charenc UTF-8 -i "New\%%~nI.srt" -map 0:0 -map 0:1 -map 1:s -disposition:s:0 forced -c copy "New\%%~nI.mkv" pause
Last edited by pcspeak; 10th Nov 2024 at 18:38. Reason: Clarity
-
That's a good feature for my situation, inasmuch as the person who needs the subs also has a problem turning the subs on.
If I might pick your skills again:assume that I have a mix of mp4 and mkv, is it possible to have the batch file accept either of the 2 types (both in the same source folder with the subtitles? -
Yes, for my batch file. I don't know about the alass program or batch file.
You can add mp4 file types to the for in ( ) do command.
e.g.Code:for %%I in (*.mkv, *.mp4) do call alass.bat "%%I" "%%~nI.srt" "New\%%~nI.srt" for %%I in (*.mkv, *.mp4) do if exist "New\%%~nI.srt" ffmpeg.exe -i "%%I" -sub_charenc UTF-8 -i "New\%%~nI.srt" -map 0:0 -map 0:1 -map 1:s -disposition:s:0 forced -c copy "New\%%~nI.mkv"
MP4 files were not originally designed to contain a subtitles stream. It can be done, but the mp4 won't play on a lot of freestanding devices.
Disk players, even those reading an mp4 through a usb port often won't play the mp4 video.
Stay with mkv type files if you can. To me it's the best format, by far.
Cheers. -
Tested with a mix of mp4 and mkv ok.
MP4-->MKV is my usual procedure so that worked out ok.
Many thanks for your assistance and patience!
Similar Threads
-
"code":400,"error":true,"message" on http://getwvkeys.cc
By johnsonkiss in forum Video Streaming DownloadingReplies: 14Last Post: 25th Jul 2024, 21:45 -
YT-DLP "-o" and "--parse-metadata" for custom "File.name"
By pssh in forum Video Streaming DownloadingReplies: 2Last Post: 30th May 2024, 09:03 -
getwvkeys.cc code":400,"error":true,"message":"Failed to get license: 405
By Koldunas in forum Newbie / General discussionsReplies: 0Last Post: 27th Sep 2023, 02:44 -
Stripping "Writing Library" & "Encoding Settings" Metadata Off a File While
By simon744 in forum Video ConversionReplies: 0Last Post: 14th Aug 2023, 10:53 -
{"code": 2048, "message": "Authentication failed"} when getting license
By warmachine in forum Video Streaming DownloadingReplies: 2Last Post: 26th May 2023, 16:34