batch conversion .srt to .sub (vobsub)

Discussion about Txt2Vobsub. Requests and bug fixing.

Moderators: george, roger_rabbit

shouseillo
Junior Member
Posts: 8
Joined: Fri Jan 25, 2008 11:33 am

batch conversion .srt to .sub (vobsub)

Post by shouseillo »

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!!
trustfm
Site Admin
Posts: 1649
Joined: Sun Feb 27, 2005 4:40 pm

Post by trustfm »

i will add this option as soon as i can . (command line option maybe...)
Older version of txt2vobsub does not include batch mode and they are not recommended any more
shouseillo
Junior Member
Posts: 8
Joined: Fri Jan 25, 2008 11:33 am

Post by shouseillo »

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 :wink: and getting better with everyones's ideas :roll:

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 :roll:
trustfm
Site Admin
Posts: 1649
Joined: Sun Feb 27, 2005 4:40 pm

Post by trustfm »

Thanks for your good words !
Seems really easy to implement a commandline and that's it but it isnt because txt2vobsub checks everytime the size of the letters if they can fit into the screen and there we will have problems . I am still thinking the best way to do it. :roll:
trustfm
Site Admin
Posts: 1649
Joined: Sun Feb 27, 2005 4:40 pm

Post by trustfm »

I just added a new version of txt2vobsub 3.3 which support batch mode.
Can you test it ?
Thanks
shouseillo
Junior Member
Posts: 8
Joined: Fri Jan 25, 2008 11:33 am

various tests

Post by shouseillo »

well! 1st of all, i cannot believe it!! :D

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 :wink: ... 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 
I did it :lol: 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 :oops: i should have thought it better :roll:

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
previously you have to ensure that there isn't any previous file called tarea.bat, so i guess you shoud

Code: Select all

del task.bat
before starting

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"
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
trustfm
Site Admin
Posts: 1649
Joined: Sun Feb 27, 2005 4:40 pm

Post by trustfm »

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
shouseillo
Junior Member
Posts: 8
Joined: Fri Jan 25, 2008 11:33 am

Post by shouseillo »

trustfm 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
sorry i didn't paid enough attention :oops: in fact, i took for granted there wasn't command line :oops:

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
trustfm
Site Admin
Posts: 1649
Joined: Sun Feb 27, 2005 4:40 pm

Post by trustfm »

no prroblem ! VobsubMuxer with the command line option is released today ! :wink:
shouseillo
Junior Member
Posts: 8
Joined: Fri Jan 25, 2008 11:33 am

Post by shouseillo »

yeah!!

as a matter of fact, i was the 2nd one to download it, according to easy-file :P

it worked fine
Post Reply