Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Subtitles
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th February 2014, 20:28   #1  |  Link
pepelugil
Registered User
 
Join Date: Jul 2010
Posts: 37
Split blu-ray (sup or xml+pngs) subtitles?

Hello,

Is there any tool (free or pro) that lets you choose split points to create multiples subtitle files from a whole movie subtitle stream in order to create a seamless branching movie subtitles?

I have Lemony Pro but it seems that this cannot be done with it.

Thank you.
pepelugil is offline   Reply With Quote
Old 24th August 2015, 00:05   #2  |  Link
pball
Registered User
 
Join Date: Mar 2010
Posts: 18
I'd also like to know if there is a tool that can split pgs (.sup) subtitle files.

I'm currently using mkvmerge with the splitting option which ends up splitting a .sup file. But this seems like a pretty lousy work around as it takes time to make the split mkv files then demux the .sup files. I also believe this method doesn't always split the subs to the exact frame specified because mkvmerge splits the video at the nearest key frame or something and not always the specified frame.
pball is offline   Reply With Quote
Old 24th August 2015, 05:02   #3  |  Link
minhjirachi
Registered User
 
Join Date: Sep 2012
Posts: 110
I have the same question and don't know how to split them in order to create a seamless branching.
minhjirachi is offline   Reply With Quote
Old 24th August 2015, 09:18   #4  |  Link
DarkSpace
Registered User
 
Join Date: Oct 2011
Posts: 204
You could try using ffmpeg:
Code:
ffmpeg -i INPUT.sup -c:s copy -ss STARTTIME -to ENDTIME OUTPUT.sup
I don't know if this will work, but since ffmpeg only needs to modify the timing information this way, rather than having to re-encode to sup (which it can't), it might work...
DarkSpace is offline   Reply With Quote
Old 24th August 2015, 09:29   #5  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
I believe it can be done, by splitting the main movie according to the required/desired positions, then rip the subtitles of each segment.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 25th August 2015, 00:58   #6  |  Link
pball
Registered User
 
Join Date: Mar 2010
Posts: 18
DarkSpace:
That didn't work for me. ffmpeg threw an error about not finding codec parameters and it also mentioned mp3 format somewhere in the output also.

Ghitulescu:
That sounds like the method I described using mkvmerge to create a set of split mkv files and demux the subs from them. That works but the timing is thrown off because the video does not split at the exact time specified.

Unless there is another better method you could suggest.
pball is offline   Reply With Quote
Old 25th August 2015, 07:52   #7  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by pball View Post
That sounds like the method I described using mkvmerge to create a set of split mkv files and demux the subs from them. That works but the timing is thrown off because the video does not split at the exact time specified.
Turn off all video and audio when muxing, then mkvmerge will not be limited to the keyframes. But: mkvmerge will never cut a subtitle line into two parts. Selur has written an extra app because of that limitation (I have not tested it):
Code:
SECut filename:<filename> cut:<ms-ms>[;ms-ms][...] outfilename:<output file name>
https://www.sendspace.com/file/jynqgz
http://forum.gleitz.info/showthread....l=1#post439066
sneaker_ger is offline   Reply With Quote
Old 25th August 2015, 10:42   #8  |  Link
minhjirachi
Registered User
 
Join Date: Sep 2012
Posts: 110
Quote:
Originally Posted by sneaker_ger View Post
Turn off all video and audio when muxing, then mkvmerge will not be limited to the keyframes. But: mkvmerge will never cut a subtitle line into two parts. Selur has written an extra app because of that limitation (I have not tested it):
Code:
SECut filename:<filename> cut:<ms-ms>[;ms-ms][...] outfilename:<output file name>
https://www.sendspace.com/file/jynqgz
http://forum.gleitz.info/showthread....l=1#post439066
Do you have any example commands? I have tested with this command:

Code:
SECut filename:sample.sup cut:1500ms outfilename:part1.sup
But I the output just get 0 KB.

Last edited by minhjirachi; 25th August 2015 at 10:47.
minhjirachi is offline   Reply With Quote
Old 25th August 2015, 11:02   #9  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Not tested, but I assume you always need to use a range, i.e. 0ms-1500ms to get your first file. Then run again for the next part etc.
Are you sure you want only 1500ms? That's only 1.5 seconds...
sneaker_ger is offline   Reply With Quote
Old 25th August 2015, 11:23   #10  |  Link
DarkSpace
Registered User
 
Join Date: Oct 2011
Posts: 204
Quote:
Originally Posted by pball View Post
DarkSpace:
That didn't work for me. ffmpeg threw an error about not finding codec parameters and it also mentioned mp3 format somewhere in the output also.
I see. A bit of research showed me that ffmpeg apparently can't write raw pgs files. I'm sorry about that, it was just an idea.
I can't explain the bit about mp3, though...
DarkSpace is offline   Reply With Quote
Old 25th August 2015, 13:12   #11  |  Link
minhjirachi
Registered User
 
Join Date: Sep 2012
Posts: 110
Quote:
Originally Posted by sneaker_ger View Post
Not tested, but I assume you always need to use a range, i.e. 0ms-1500ms to get your first file. Then run again for the next part etc.
Are you sure you want only 1500ms? That's only 1.5 seconds...
Just for testing.

P/S: I have try again but same problem. Here is my command:

Code:
SECut filename:Vietnamese.sup cut:20000ms-500000ms outfilename:Test1.sup

Last edited by minhjirachi; 25th August 2015 at 13:16.
minhjirachi is offline   Reply With Quote
Old 26th August 2015, 00:40   #12  |  Link
pball
Registered User
 
Join Date: Mar 2010
Posts: 18
I was able to get that program to work, mostly. I used the following command and it made a split sup file. The issue is the time codes for the subs aren't edited so the episode 2 subs start at 22m and the episode 3 subs start at 44m. I checked by loading the .sup file into an sub ocr program.

E:\Pics>secut.exe filename:"T5_Subtitle - English.sup" cut:2672671-4008004 outfilename:"ep3 subs.sup"

I have a idea of how .sup files are structured thanks to the mkvmerge dev mosu, so I'm going to try and write my own program to split .sup files. I'll post back if I make any progress, not exactly a first rate programmer lol.

minhjirachi:
Try it without the "ms" on the times.
pball is offline   Reply With Quote
Old 26th August 2015, 04:42   #13  |  Link
minhjirachi
Registered User
 
Join Date: Sep 2012
Posts: 110
Quote:
Originally Posted by pball View Post
I was able to get that program to work, mostly. I used the following command and it made a split sup file. The issue is the time codes for the subs aren't edited so the episode 2 subs start at 22m and the episode 3 subs start at 44m. I checked by loading the .sup file into an sub ocr program.

E:\Pics>secut.exe filename:"T5_Subtitle - English.sup" cut:2672671-4008004 outfilename:"ep3 subs.sup"

I have a idea of how .sup files are structured thanks to the mkvmerge dev mosu, so I'm going to try and write my own program to split .sup files. I'll post back if I make any progress, not exactly a first rate programmer lol.

minhjirachi:
Try it without the "ms" on the times.
Thank you,
I have success. But the another problem like you said. That the timecode doesn't start from the beginning of each video files.
minhjirachi is offline   Reply With Quote
Old 27th August 2015, 01:41   #14  |  Link
pball
Registered User
 
Join Date: Mar 2010
Posts: 18
Well I have the source code for SECut and mkvmerge both of which deal with splitting sup files. So together with my expert programmer friend, we should be able to put something together that works. Hopefully will have an update this weekend.
pball is offline   Reply With Quote
Old 28th August 2015, 21:08   #15  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,379
Hi pball

sounds good what you want to do.

What is when the split point are between of a sup's display time?

Sup splitting works for me very well with mkvmerge, but not for the case in my question.

small example:

subtitle 1 starts at 10sec and ends after 14sec. display time 4 sec.

The split should be at 12sec.

mkvmerge cut well but the subtitle lose the info of the display time (PGS have a start time and a duration, not an end time, I think).
While playing the mkv the subtitle starts at 10 sec but it will shown for the rest of the mkv. All following sups will not shown. Only after a "jump" in the timeline stops the display of subtitle 1.

Can you keep this problem in your mind?
hubblec4 is offline   Reply With Quote
Old 29th August 2015, 04:29   #16  |  Link
pball
Registered User
 
Join Date: Mar 2010
Posts: 18
I can try, but that sounds like an odd case to me. I'm personally only going to be cutting subtitles when multiple episodes worth are in a single file (because of how the bluray was made). I'm going to focus on splitting between subtitles to start, considering that is supposedly easy and I don't perfectly understand how .sup files work yet. Anything more will come after that point. I'm also going to make a dedicated thread when I have something to show.
pball is offline   Reply With Quote
Old 29th August 2015, 10:25   #17  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,379
Ok thanks.

I'm sure if you try this, you can get help from Mosu or other developers for that problem.

Can you have a look to the SUP-specs?(sorry i haven't it).
hubblec4 is offline   Reply With Quote
Old 29th August 2015, 10:41   #18  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
It's a known problem, Mosu said he won't fix it. (But that was a long time ago, maybe he has forgotten and you can convince him now.)
sneaker_ger is offline   Reply With Quote
Old 29th August 2015, 20:48   #19  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,379
Quote:
Originally Posted by sneaker_ger View Post
It's a known problem, Mosu said he won't fix it. (But that was a long time ago, maybe he has forgotten and you can convince him now.)
I ask him per pn last 2 month, i think he know it :-).

He said, he could implement this, but not yet and in a long future.

@pball

The "solution" must cut the subtitle and write new timestamps and durations.
hubblec4 is offline   Reply With Quote
Old 31st August 2015, 00:44   #20  |  Link
pball
Registered User
 
Join Date: Mar 2010
Posts: 18
Well for anyone hitting F5 on this thread, I have news. I have code that reads a .sup file and gets me the time codes. I still have to write the code to write the newly split .sup files and adjust time codes as needed. It won't be hard at all but it'll take a bit of time for me to get it together. So my next post should be a new thread for my script.
pball is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.