View Single Post
Old 5th April 2022, 15:15   #11  |  Link
cubicibo
Registered User
 
Join Date: Feb 2022
Posts: 108
I think so?
Quote:
Originally Posted by screamingtrees View Post
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.
Assuming the timing were resets by the splitting tool, try this very elementary python script which will move all timestamps of sub2.sup to a value of your calculation (probably equal to duration of part1 + duration of subtitle-sliced sequence).

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
I have seen a few streams which sets PTS = DTS at all time. In general you don't need to specify the optional -dts argument (and in fact it should not matter).

When done, concatenate the two files and hopefully the subtitles appears now properly.
Attached Files
File Type: txt pgshift.txt (5.0 KB, 60 views)

Last edited by cubicibo; 5th April 2022 at 15:33.
cubicibo is offline   Reply With Quote