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

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th June 2024, 12:41   #1781  |  Link
RobertM
Registered User
 
Join Date: Apr 2011
Posts: 435
Quote:
Originally Posted by markfilipak View Post
But a script that includes regular expression processing will be easier. The subtitle file is just text.
Yes, the subtitle files (srt, ass, etc.) are plain text, and could easily be edited to rewrite the durations as you desire. Are you looking for a standalone script to post-process the subtitle files outside of SE?
RobertM is offline   Reply With Quote
Old 29th June 2024, 18:45   #1782  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 328
Quote:
Originally Posted by RobertM View Post
Yes, the subtitle files (srt, ass, etc.) are plain text, and could easily be edited to rewrite the durations as you desire. Are you looking for a standalone script to post-process the subtitle files outside of SE?
I am. If you have one handy that you want to share, that'd be great. If you don't, that's okay, too. It will be easy enough to write. I'm a little bogged down at the moment preparing a revised bug summary to submit to FFmpeg's trac system. That's why I haven't gotten around to this.

When/if I write my own, it will be HTML+javascript that works like this: Copy the srt into the web page, push a button, copy the result back to the srt. I'll have a field for the 'attention' duration and another for 'milliseconds per character'.
markfilipak is offline   Reply With Quote
Old 30th June 2024, 01:26   #1783  |  Link
RobertM
Registered User
 
Join Date: Apr 2011
Posts: 435
Quote:
Originally Posted by markfilipak View Post
I am. If you have one handy that you want to share, that'd be great.
I have a python script that I have used in the past to parse .ass files. It could be modified pretty easily to do what you want.
RobertM is offline   Reply With Quote
Old 30th June 2024, 01:49   #1784  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 328
Quote:
Originally Posted by RobertM View Post
I have a python script that I have used in the past to parse .ass files. It could be modified pretty easily to do what you want.
It's been about 20 years since I wrote any python. I'd be pleased to look at it. If it's not too many lines, I imagine you could paste in doom9.
markfilipak is offline   Reply With Quote
Old 30th June 2024, 05:40   #1785  |  Link
RobertM
Registered User
 
Join Date: Apr 2011
Posts: 435
I took my old file and rolled it into a new little script file for you. Seems to work in my testing, but you'll have to give it some real-world exercise. If you have Python installed on your system then you should be able to simply double-click it and the usage should become evident. Let me know if you have trouble.

[edit] I appended the script to this message, but it won't be available until it has been reviewed, I understand. [/edit]
Attached Files
File Type: rar SubTailor.rar (2.0 KB, 12 views)

Last edited by RobertM; 30th June 2024 at 19:06.
RobertM is offline   Reply With Quote
Old 3rd July 2024, 21:19   #1786  |  Link
RobertM
Registered User
 
Join Date: Apr 2011
Posts: 435
Quote:
Originally Posted by markfilipak View Post
I'd be pleased to look at it. If it's not too many lines, I imagine you could paste in doom9.
Doesn't seem like my attachment is getting looked at, so I'll send you the code in a PM. It's a python script, so just text.
RobertM is offline   Reply With Quote
Old 3rd July 2024, 23:19   #1787  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,738
You may report your own attachment for approval.
P.S. as RobertM did not, I just stepped in and reported it for approval.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 9th July 2024 at 23:48.
Emulgator is offline   Reply With Quote
Old 2nd August 2024, 20:29   #1788  |  Link
jairovital
Registered User
 
Join Date: Sep 2010
Posts: 6
Quote:
Originally Posted by RobertM View Post
I took my old file and rolled it into a new little script file for you. Seems to work in my testing, but you'll have to give it some real-world exercise. If you have Python installed on your system then you should be able to simply double-click it and the usage should become evident. Let me know if you have trouble.

Interesting what your Python scrip purposes to do.
I'd like to use it.

But I'm receiving this error:

Code:
==========================================================
SubTailor                                          v0.0.01
==========================================================

This does not appear to be a valid *.ass file

Press 'enter' to quit.
Ass file is this:

Code:
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None

[Aegisub Project Garbage]
Scroll Position: 28
Active Line: 60

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:24.93,0:00:29.15,Default,,0,0,0,,I've had enough of danger
Dialogue: 0,0:00:30.97,0:00:34.40,Default,,0,0,0,,And people on the streets
Dialogue: 0,0:00:37.24,0:00:41.51,Default,,0,0,0,,I'm looking out for angels
Dialogue: 0,0:00:43.06,0:00:47.28,Default,,0,0,0,,Just trying to find some peace
Dialogue: 0,0:00:49.28,0:00:52.97,Default,,0,0,0,,Now I think it's time
Dialogue: 0,0:00:55.33,0:00:59.73,Default,,0,0,0,,That you let me know
Dialogue: 0,0:01:01.02,0:01:06.66,Default,,0,0,0,,So if you love me\NSay you love me
Dialogue: 0,0:01:06.93,0:01:12.53,Default,,0,0,0,,But if you don't\NJust let me go
Dialogue: 0,0:01:13.68,0:01:16.75,Default,,0,0,0,,Cause teacher
Dialogue: 0,0:01:16.75,0:01:22.44,Default,,0,0,0,,There are things that I don't want to learn
Dialogue: 0,0:01:24.48,0:01:28.75,Default,,0,0,0,,And the last one I had
Dialogue: 0,0:01:28.75,0:01:32.26,Default,,0,0,0,,Made me cry
Dialogue: 0,0:01:34.71,0:01:36.75,Default,,0,0,0,,So I don't want to learn to
Dialogue: 0,0:01:36.75,0:01:42.53,Default,,0,0,0,,Hold you, touch you
Dialogue: 0,0:01:43.68,0:01:47.11,Default,,0,0,0,,Think that you're mine
Dialogue: 0,0:01:47.64,0:01:51.28,Default,,0,0,0,,Because there ain't no joy
Dialogue: 0,0:01:52.71,0:01:57.06,Default,,0,0,0,,For an uptown boy
Dialogue: 0,0:01:57.06,0:02:02.13,Default,,0,0,0,,Whose teacher has told him goodbye
Dialogue: 0,0:02:03.06,0:02:06.31,Default,,0,0,0,,Goodbye
Dialogue: 0,0:02:06.31,0:02:08.31,Default,,0,0,0,,Goodbye
Dialogue: 0,0:02:08.31,0:02:12.62,Default,,0,0,0,,When you were just a stranger
Dialogue: 0,0:02:14.04,0:02:18.62,Default,,0,0,0,,And I was at your feet
Dialogue: 0,0:02:20.04,0:02:24.22,Default,,0,0,0,,I didn't feel the danger
Dialogue: 0,0:02:24.66,0:02:29.42,Default,,0,0,0,,Now I feel the heat
Dialogue: 0,0:02:31.46,0:02:36.04,Default,,0,0,0,,That look in your eyes
Dialogue: 0,0:02:38.31,0:02:42.31,Default,,0,0,0,,Telling me no
Dialogue: 0,0:02:42.31,0:02:45.64,Default,,0,0,0,,So you think that you love me
Dialogue: 0,0:02:45.64,0:02:48.97,Default,,0,0,0,,Know that you need me
Dialogue: 0,0:02:48.97,0:02:52.44,Default,,0,0,0,,I wrote the song, I know it's wrong
Dialogue: 0,0:02:52.44,0:02:55.91,Default,,0,0,0,,Just let me go
Dialogue: 0,0:02:56.40,0:02:59.68,Default,,0,0,0,,And teacher
Dialogue: 0,0:02:59.68,0:03:01.91,Default,,0,0,0,,There are things
Dialogue: 0,0:03:01.91,0:03:06.26,Default,,0,0,0,,That I don't want to learn
Dialogue: 0,0:03:07.68,0:03:11.73,Default,,0,0,0,,Oh the last one I had
Dialogue: 0,0:03:12.71,0:03:16.48,Default,,0,0,0,,Made me cry
Dialogue: 0,0:03:17.73,0:03:20.31,Default,,0,0,0,,So I don't want to learn to
Dialogue: 0,0:03:20.31,0:03:26.84,Default,,0,0,0,,Hold you, touch you
Dialogue: 0,0:03:26.84,0:03:30.31,Default,,0,0,0,,Think that you're mine
Dialogue: 0,0:03:30.88,0:03:34.40,Default,,0,0,0,,Because there ain't no joy
Dialogue: 0,0:03:36.66,0:03:40.26,Default,,0,0,0,,For an uptown boy
Dialogue: 0,0:03:40.26,0:03:46.40,Default,,0,0,0,,Whose teacher has told him goodbye
Dialogue: 0,0:03:46.88,0:03:48.97,Default,,0,0,0,,Goodbye
Dialogue: 0,0:03:48.97,0:03:52.00,Default,,0,0,0,,Goodbye
Dialogue: 0,0:04:24.57,0:04:28.97,Default,,0,0,0,,So when you say that you need me
Dialogue: 0,0:04:28.97,0:04:32.17,Default,,0,0,0,,That you'll never leave me
Dialogue: 0,0:04:32.17,0:04:36.31,Default,,0,0,0,,I know you're wrong, you're not that strong
Dialogue: 0,0:04:36.31,0:04:38.93,Default,,0,0,0,,Let me go
Dialogue: 0,0:04:38.93,0:04:42.04,Default,,0,0,0,,And teacher
Dialogue: 0,0:04:42.04,0:04:44.84,Default,,0,0,0,,There are things
Dialogue: 0,0:04:44.84,0:04:48.66,Default,,0,0,0,,That I still have to learn
Dialogue: 0,0:04:50.66,0:04:58.80,Default,,0,0,0,,But the one thing I have is my pride
Dialogue: 0,0:04:59.46,0:05:03.77,Default,,0,0,0,,Oh so I don't want to learn to
Dialogue: 0,0:05:03.77,0:05:08.84,Default,,0,0,0,,Hold you, touch you
Dialogue: 0,0:05:09.55,0:05:13.02,Default,,0,0,0,,Think that you're mine
Dialogue: 0,0:05:13.91,0:05:17.60,Default,,0,0,0,,Because there ain't no joy
Dialogue: 0,0:05:19.73,0:05:23.33,Default,,0,0,0,,For an uptown boy
Dialogue: 0,0:05:23.33,0:05:29.02,Default,,0,0,0,,Who just isn't willing to try
Dialogue: 0,0:05:29.02,0:05:32.40,Default,,0,0,0,,I'm so cold
Dialogue: 0,0:05:32.40,0:05:34.88,Default,,0,0,0,,Inside
Dialogue: 0,0:05:35.51,0:05:41.73,Default,,0,0,0,,Maybe just one more try
Dialogue: 0,0:00:00.00,0:00:05.00,Default,,0,0,0,,
What's wrong?


Thanks.
jairovital is offline   Reply With Quote
Old 2nd August 2024, 20:35   #1789  |  Link
jairovital
Registered User
 
Join Date: Sep 2010
Posts: 6
I have too many files, grab from Youtube, that overlap end and start times between sequential subtitles.

"Tool/Adjust durations" solves all the errors, separating conflicted times.
But how to apply it to hundred of files at once?

Is there a command line for SE?
What parameters/commands/options for such solution?
jairovital is offline   Reply With Quote
Old 4th August 2024, 00:01   #1790  |  Link
Nikse555
Registered User
 
Join Date: Feb 2004
Location: Mars
Posts: 432
You can use "Adjust durations" on many files via the UI in "Tools" - "Batch convert"
Nikse555 is offline   Reply With Quote
Old 4th August 2024, 00:04   #1791  |  Link
jairovital
Registered User
 
Join Date: Sep 2010
Posts: 6
Quote:
Originally Posted by jairovital View Post
Interesting what your Python scrip purposes to do.
I'd like to use it.

But I'm receiving this error:

...

What's wrong?


Thanks.

I'll answer my own question:

The file I used as a test is missing string:

Code:
; advanced sub station alpha

Now, it works fine.

Thanks.
jairovital is offline   Reply With Quote
Old 4th August 2024, 00:08   #1792  |  Link
GCRaistlin
Registered User
 
GCRaistlin's Avatar
 
Join Date: Jun 2006
Posts: 361
Nikse555
Is there any chance that https://github.com/SubtitleEdit/subt...it/issues/7983 will be fixed? You marked it as completed but the issue is still present in 4.0.7.
__________________
Windows 8.1 x64

Magically yours
Raistlin
GCRaistlin is offline   Reply With Quote
Old 4th August 2024, 00:09   #1793  |  Link
jairovital
Registered User
 
Join Date: Sep 2010
Posts: 6
Quote:
Originally Posted by Nikse555 View Post
You can use "Adjust durations" on many files via the UI in "Tools" - "Batch convert"
Oh, my!...
I didn't see that!

Wonderful!
Solve all the times issues!

Many thanks!
jairovital is offline   Reply With Quote
Old 5th August 2024, 10:03   #1794  |  Link
oniiz86
Registered User
 
Join Date: Oct 2019
Posts: 68
@Nikse555 Is there any chance you could remove the Subtitle Edit version number from the thread title as it's always several versions behind & no longer reflects the current release version, it be greatly appreciated
oniiz86 is offline   Reply With Quote
Old 6th August 2024, 17:45   #1795  |  Link
oniiz86
Registered User
 
Join Date: Oct 2019
Posts: 68
@Nikse555 Thanks but oddly only your first post was altered, the thread title remains unchanged & still reflects version 4.0.4, perhaps a moderator can only change this now?
oniiz86 is offline   Reply With Quote
Old 8th August 2024, 04:34   #1796  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 328
Hi All,

I'm happy with SE except for one thing, and it's probably my fault.

When I click the 'Start time' or 'Duration' up/down arrows, the start time or duration increment/decrement by 100 ms. I'd prefer it increment/decrement by one frame. I have the video loaded in 'Beautify time codes' and 448291 time codes loaded -- the video is over 5 hours long. The video is 24/1.001 FPS, which is also set.

Is there a way to get SE to use the time codes instead of 100 ms? I have searched everywhere for it.

Thanks!--Mark.
markfilipak is offline   Reply With Quote
Old 16th August 2024, 07:37   #1797  |  Link
arslan
Registered User
 
Join Date: Feb 2016
Posts: 3
suggestion for a new feature - improved line breaking in text box

Hi Nikse and all forum members,

I would have a suggestion that I believe might improve the functionality of line breaking in the Text box. Here is what I mean:

If I have this in the Text box:

WORDspaceWORDspaceWORDspaceWORDspaceWORD
WORD

and I want to have only 2 words in line 1 and 4 words in line 2, when I hit the Enter right after the second word I get this in the text box:

WORDspaceWORD
spaceWORDspaceWORDspaceWORD
WORD

So there's a space at the beginning of line 2 now, and what used to be line 2 is now line 3 (even though in the Settings I have set a maximum of 2 lines).

Would it be possible to program the Text box to automatically do this:

WORDspaceWORD
WORDspaceWORDspaceWORDspaceWORD

that is, to erase the space at the beginning of line 2 automatically and to keep only 2 lines? That would save a bit of manual line editing.

Thank you very much!

arslan
arslan is offline   Reply With Quote
Old 30th August 2024, 11:13   #1798  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 7,122
Quote:
Originally Posted by oniiz86 View Post
@Nikse555 Thanks but oddly only your first post was altered, the thread title remains unchanged & still reflects version 4.0.4, perhaps a moderator can only change this now?
Done.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 30th August 2024, 12:09   #1799  |  Link
oniiz86
Registered User
 
Join Date: Oct 2019
Posts: 68
@tebasuna51 Thanks so very much for that, much obliged
oniiz86 is offline   Reply With Quote
Old 13th September 2024, 07:17   #1800  |  Link
varekai
Registered User
 
varekai's Avatar
 
Join Date: Jul 2006
Posts: 545

Best regards,
varekai
varekai 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 15:36.


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