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 > Linux, Mac OS X, & Co

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th October 2021, 18:16   #1  |  Link
ravs
Registered User
 
Join Date: Nov 2010
Posts: 15
Linux Subtitle "calculator"?

Is there something like a Linux Subtitle "calculator"?
By "calculator" I mean the following.

Suppose you have several episodes of a series, and you have created the Subtitle .ass file for one episode creating the subtitles for the intro song and probably also for the "extro" song.

Now, the intro starts at different times for each episode. I would need a way to convert e.g.
Code:
Dialogue: 0,0:22:55.00,0:23:05.50,Rava Dialogue,,0000,0000,0000,,I will head for tomorrow in this cradle woven from kindness
up or down certain minutes/seconds/milliseconds.

E.g. add 15 seconds zero milliseconds to the start time of 0:22:55:0,0 and the same offset to the end time of 0:23:05.50, making the above
Code:
Dialogue: 0,0:23:10.00,0:23:20.50,Rava Dialogue,,0000,0000,0000,,I will head for tomorrow in this cradle woven from kindness
Or minus 1 min 22 seconds .20 milliseconds. The relative times (relative to each other) in the .ass all stay the same, but all start and end times shift by the same difference.
ravs is offline   Reply With Quote
Old 21st October 2021, 14:12   #2  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 366
You can run SubtitleEdit with mono, this is what I do.
The synchronization requires selecting specific lines, though.
__________________
LG OLED C8 | GitHub Projects
quietvoid is online now   Reply With Quote
Old 21st October 2021, 21:32   #3  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,301
This is what you would use prass for.

https://github.com/tp7/prass (or maybe https://github.com/Ryu1845/Prass since it's been updated)

But you might need to splice the files apart first so only the lines that need to get shifted do (an alternative is that you could use ordered chapters and have the intro/outro in their own files, in which case the subs are always correctly timed). Or you know, just load the thing up in Aegisub and use it to perform the time shifting.
qyot27 is online now   Reply With Quote
Old 22nd October 2021, 04:05   #4  |  Link
ravs
Registered User
 
Join Date: Nov 2010
Posts: 15
Quote:
Originally Posted by quietvoid View Post
You can run SubtitleEdit with mono, this is what I do.
The synchronization requires selecting specific lines, though.
as in https://github.com/SubtitleEdit/subtitleedit ?

Quote:
Originally Posted by qyot27 View Post
This is what you would use prass for.
I check that out,
Quote:
Originally Posted by qyot27 View Post
an alternative is that you could use ordered chapters and have the intro/outro in their own files, in which case the subs are always correctly timed
you mean like extracting an ffmetadata file
Code:
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
and after adding chapter info reinserting edited metadata information from the FFMETADATAFILE file
Code:
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
?

If so, how does have the intro/outro in their own files work? You mean the video itself split?

Or chapters added via metadata (like the code above) but the video still only one file? If so how does that work? E.g. mpv loads subtitle when video and subtitle file have the same name.
E.g. video "whatever ep. 01.mp4" and subtitles "whatever ep. 01.ass"
ravs is offline   Reply With Quote
Old 22nd October 2021, 05:09   #5  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,301
Ordered chapters is a Matroska feature. It's possible through manipulating the XML chapters file and doing segment linking in combination, so that the OP file and ED files are separate, and each of the episodes has those segments removed (but the chapters file redirects the chapter points for the OP and ED to the external files).
qyot27 is online now   Reply With Quote
Old 22nd October 2021, 14:25   #6  |  Link
ravs
Registered User
 
Join Date: Nov 2010
Posts: 15
^

I see, so when one has another container but Matroska : only calculating and adjusting the e.g. .ass file is possible.
ravs is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:53.


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