batch conversion .srt to .sub (vobsub)
Moderators: george, roger_rabbit
-
- Junior Member
- Posts: 8
- Joined: Fri Jan 25, 2008 11:33 am
batch conversion .srt to .sub (vobsub)
hi all!
first of all, this is to give my deepest thanks to the author(s) for this superb tool :-p, and hi everyone else in this forum, of course
now, my question: I have a folder with 30-40 subtitles, .srt format, that i want to convert to vobsub, and as you can imagine, i don't wanna push 40 times the same buttons... is there any way to automatize this? For example, is there any command line parameters i can give to txt2vobsub?
for me the ideal thing would be some like typing: txt2vobsub -i %f.srt -o %f.sub -font arial -size 24 , to have a for loop, either in bash or in WinXP cmd line (i'd prefer to do it in WinXP, btw)
or can i try to use previous versions of the software to try to do a .bat file that does what i want?
many thanks in advance for your help!!
first of all, this is to give my deepest thanks to the author(s) for this superb tool :-p, and hi everyone else in this forum, of course
now, my question: I have a folder with 30-40 subtitles, .srt format, that i want to convert to vobsub, and as you can imagine, i don't wanna push 40 times the same buttons... is there any way to automatize this? For example, is there any command line parameters i can give to txt2vobsub?
for me the ideal thing would be some like typing: txt2vobsub -i %f.srt -o %f.sub -font arial -size 24 , to have a for loop, either in bash or in WinXP cmd line (i'd prefer to do it in WinXP, btw)
or can i try to use previous versions of the software to try to do a .bat file that does what i want?
many thanks in advance for your help!!
-
- Junior Member
- Posts: 8
- Joined: Fri Jan 25, 2008 11:33 am
ok, thanks
in the wait... do you know if is out there any app able to record a macro, but with all the clicks and so on? it will be a temp solution for the problem i have :-p ?
did i thank you for your superb program? for sure, not enough!! it's great, it's simple, ... very very good, indeed and getting better with everyones's ideas
somedays i luv internet, you know, talking with the author of some program, proposing ideas.... of course, your part is far more important, you put ideas into lines of code
in the wait... do you know if is out there any app able to record a macro, but with all the clicks and so on? it will be a temp solution for the problem i have :-p ?
did i thank you for your superb program? for sure, not enough!! it's great, it's simple, ... very very good, indeed and getting better with everyones's ideas
somedays i luv internet, you know, talking with the author of some program, proposing ideas.... of course, your part is far more important, you put ideas into lines of code
-
- Junior Member
- Posts: 8
- Joined: Fri Jan 25, 2008 11:33 am
various tests
well! 1st of all, i cannot believe it!!
my suggestions were just in time
the implementation you did is great, and it works, but once again, it takes too many clicks for me ... so i tried to do a little more automation
this is what i've done:
I analized the lines of a generated .bat file. I deducted the 3rd number from the end is for the language. 29 for english and 108 for spanish. btw, you should document what this numbers are (the position of subt, and colors, i guess, and font, language and colors)... well it doesn't matter right now.
DON'T try to do something like I did it and then i got 150 windows trying to pop up at the same time. it took me a reboot to regain control... besides, the cpu went 100%, lots of errors like out of memory, sent error description ooopsss a TOTAL mess i should have thought it better
Please, mind the quotes (") surrounding %f !! it's very important for the correct use if the name of subtitles file have spaces, or strange characters
the problem was the for loop doesn't wait for txt2vobsub to finish, and spawns a new copy. So, let's make a .bat with all the names we want
first, i make a .bat for adding a line, and call it add.bat
previously you have to ensure that there isn't any previous file called tarea.bat, so i guess you shoud before starting
mind the %1 is without quotes " this time!
now, to fill our task.bat we do the following
then, you can run task.bat, and it should work
and now, you guess right i need a command line for vobsubmux, or batch proccessing :-p ... in that case, it shouldn't be any problem for there is nothing to check for size, isn't it?
i'll write a new topic under the appropiate program
my suggestions were just in time
the implementation you did is great, and it works, but once again, it takes too many clicks for me ... so i tried to do a little more automation
this is what i've done:
I analized the lines of a generated .bat file. I deducted the 3rd number from the end is for the language. 29 for english and 108 for spanish. btw, you should document what this numbers are (the position of subt, and colors, i guess, and font, language and colors)... well it doesn't matter right now.
DON'T try to do something like
Code: Select all
for %f in (*.srt) do txt2VobSub "%f" 282 4 0 18 0 30 -4 1 1 0 2 29 2 2
Please, mind the quotes (") surrounding %f !! it's very important for the correct use if the name of subtitles file have spaces, or strange characters
the problem was the for loop doesn't wait for txt2vobsub to finish, and spawns a new copy. So, let's make a .bat with all the names we want
first, i make a .bat for adding a line, and call it add.bat
Code: Select all
rem add individual task
echo "D:\futu-sub\preuba\txt2vobsub.exe" %1 282 4 0 18 0 30 -4 1 1 0 2 29 2 2 >> task.bat
Code: Select all
del task.bat
mind the %1 is without quotes " this time!
now, to fill our task.bat we do the following
Code: Select all
del task.bat
rem just to be sure :)
for %f in (*.srt) do add.bat "%f"
and now, you guess right i need a command line for vobsubmux, or batch proccessing :-p ... in that case, it shouldn't be any problem for there is nothing to check for size, isn't it?
i'll write a new topic under the appropiate program
VobsubMuxer 1.3 has command line support :
http://www.trustfm.net/phpBB2/viewtopic.php?t=1844
Documentation for Txt2Vobsub command line can be found here :
http://www.trustfm.net/phpBB2/viewtopic.php?t=1843
but as i say it is not reccomended to do it by hand because we have problems with the lenght of the subtitles etc...
Instead vobsubmuxer script is made by hand because does not need any input control
http://www.trustfm.net/phpBB2/viewtopic.php?t=1844
Documentation for Txt2Vobsub command line can be found here :
http://www.trustfm.net/phpBB2/viewtopic.php?t=1843
but as i say it is not reccomended to do it by hand because we have problems with the lenght of the subtitles etc...
Instead vobsubmuxer script is made by hand because does not need any input control
-
- Junior Member
- Posts: 8
- Joined: Fri Jan 25, 2008 11:33 am
sorry i didn't paid enough attention in fact, i took for granted there wasn't command linetrustfm wrote: Documentation for Txt2Vobsub command line can be found here :
http://www.trustfm.net/phpBB2/viewtopic.php?t=1843
but as i say it is not reccomended to do it by hand because we have problems with the lenght of the subtitles etc...
Instead vobsubmuxer script is made by hand because does not need any input control
as my particular situation is .srt to .vobsub conversion, i can process the srt previously in urusoft's subtitle workshop, which adjust the subtitles so that they fit in screen... so i'm sure, if i use the same font and size, that every subtitle gonna be allright
-
- Junior Member
- Posts: 8
- Joined: Fri Jan 25, 2008 11:33 am