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. |
|
|
Thread Tools | Search this Thread | Display Modes |
4th September 2015, 02:34 | #1 | Link |
Registered User
Join Date: Mar 2010
Posts: 18
|
pball's Bluray PGS Subtitle splitter (.sup file splitter)
I was annoyed by the severe lack of tools for splitting PGS subtitles (.sup files). So I created a simple program to split bluray subtitles.
Please report any issues with my program. I've tested it pretty thoroughly but I only have so many subtitles to split. I'm also open to suggestions and feature requests. Download: http://www.mediafire.com/download/g2...litter_1.1.zip Usage: Syntax: supsplitter input:<input filename> <options> output:<output filename> output filename will have _1, _2, ... appended to filename if multiple splits are made Options: ms:ms-ms<;ms-ms;...> Millisecond times for start and end of output sub file frames:frame-frame<;frame-frame;...> Frames for start and end of output sub file, starts at 0, requires fps parameter fps:fps Frames per second of subtitle's video, required when using frames parameter. Known limitations: Program will not split a subtitle line between two files. I personally don't see why someone would split a video in the middle of a subtitle being displayed. To do list: Update program to properly split subtitle line between two files. (it was requested) Clean up code and make any improvements possible Release source code after previous item, it's python currently. Port to C# to get a smaller exe and just because. Graphical interface? Version: 1.1 Fixed error in error message (ironic isn't it) 1.0 Initial release Last edited by pball; 5th June 2016 at 15:06. |
14th December 2018, 16:12 | #3 | Link |
Registered User
Join Date: Jun 2013
Posts: 5
|
Hello,
I would like to use that programme to split a PGS sup file into 4 separate sup file. Each separate file represents an individual TV episode. the video Frame rate is: 23.976 after watching the bluray and looking at the SUP file with "bdsup2sub" I determined the following split requirements: Episode 1: 1st subtitle line number: 1 1st subtitle start time: 00:00:01.460 1st subtitle end time: 00:00:04.046 Last subtitle line number: 556 Last subtitle start time: 00:53:29.915 Last subtitle end time: 00:53:31.500 Episode 2: 1st subtitle line number: 557 1st subtitle start time: 00:55:07.805 1st subtitle end time: 00:55:10.891 Last subtitle line number: 1102 Last subtitle start time: 01:52:35.082 Last subtitle end time: 01:52:37.584 Episode 3: 1st subtitle Index number: 1103 1st subtitle start time: 01:54:59.976 1st subtitle end time: 01:55:02.479 Last subtitle Index number: 1653 Last subtitle start time: 02:49:30.327 Last subtitle end time: 02:49:32.829 Episode 4: 1st subtitle Index number: 1654 1st subtitle start time: 02:52:03.814 1st subtitle end time: 02:52:06.900 Last subtitle Index number: 2135 Last subtitle start time: 03:49:09.236 Last subtitle end time: 03:49:10.904 But I don't know how to put the above into the command line parameters. could you help me out? cheers, |
15th December 2018, 03:57 | #4 | Link |
Registered User
Join Date: Mar 2010
Posts: 18
|
Well I personally use the frames and fps options, but I played with the millisecond option some to refresh myself. The times you have will not work, you will need the times that the video of each episode starts and stops, otherwise the subtitles will not sync to the video. So episode 1 should start at 0sec and lets say it ends at 54min 25.400sec and episode two starts at 54min 25.401sec and ends at 1h 53min 22.000sec. The below command should work.
supsplitter.exe input:"c:\encoding\subtitle ep 1-3.sup" output:"c:\encoding\subtitle ep 1.sup" ms:0-3265400;3265401-6802000 This will create "subtitle ep 1_1.sup" and "subtitle ep 1_2.sup" since multiple times were given in one command. You could also run the program multiple times with a different output names and ms numbers for each episode. ep 1 start = 0ms ep 1 end 54min 25.400sec = 3265.400sec = 3265400ms ep 2 start just add 1ms to get 3265401ms ep 2 end 1h 53min 22.000sec = 6802.000sec = 6802000ms I hope this helps, let me know if you need more help. |
4th April 2022, 18:19 | #7 | Link |
Registered User
Join Date: Feb 2022
Posts: 100
|
If they are split correctly, that is:
|
4th April 2022, 19:51 | #8 | Link |
Registered User
Join Date: Oct 2013
Posts: 14
|
Thanks for the reply. I tried this using a "copy sub1.sup+sub2.sup output.sup" command, but it seems like it's not going to work for my purposes. I can't seem to get a "blank" sup segment to keep it's duration when rejoining. Basically I'm splitting out the opening/endings of an anime, removing the subs, and trying to rejoin, but the subs that come after the opening just immediately show up without waiting for the opening theme to play out first. I tried using BDSup2Sub for this, but it caused other problems with my subtitles like shortening some it deemed as "errors".
|
4th April 2022, 23:02 | #9 | Link |
Registered User
Join Date: Feb 2022
Posts: 100
|
There is no such thing as duration in PGS. Each caption has a presentation (decode) timestamp and remain on screen until a new presentation empties the graphics plane.
So, if you take the SUP from a given video, slice out (properly) a portion of the raw data then mux it back to the same untouched, video stream, the removed portion will either: • Display the last shown subtitle (missing plane clear segment) • Show nothing (the desired behaviour, properly sliced) I don't know how you generated your two files but it sounds like sub2.sup has modified timestamps in the stream. |
5th April 2022, 15:15 | #11 | Link | |
Registered User
Join Date: Feb 2022
Posts: 100
|
I think so?
Quote:
Usage: Code:
python3 pgshift.py input.sup MS output.sup [-dts] Where: MS is the shift delay in MILLISECONDS to add or subtract. It must be an integer. -dts, if provided, also shifts the decoding timestamps When done, concatenate the two files and hopefully the subtitles appears now properly. Last edited by cubicibo; 5th April 2022 at 15:33. |
|
Tags |
.sup file, pgs subtitle, subtitle splitter, sup file |
Thread Tools | Search this Thread |
Display Modes | |
|
|