ercanserteli / condenser

Condenser allows you to extract speech audio from video files, based on subtitle timings. By omitting the audio outside of speech, it increases the language per second that you are getting exposed to.
https://ercanserteli.com/condenser
GNU General Public License v3.0
33 stars 7 forks source link

Wrong timestamp of output_condensed_subtitles #16

Closed Ttixan closed 5 months ago

Ttixan commented 5 months ago

for example, the output of Yuricamp:

1
00:00:00,500 --> 00:00:04,004
(各務原(かがみはら)なでしこ)う~ん…

2
00:00:04,087 --> 00:00:05,213
あ!

3
00:00:06,213 --> 00:00:08,257
んん…

4
00:00:03,544 --> 00:00:07,506
ない ない ない…

5
00:00:07,840 --> 00:00:10,801
ない ない ない!

6
00:00:10,884 --> 00:00:11,885
ない…

7
00:00:12,594 --> 00:00:13,595
ああ…

8
00:00:11,551 --> 00:00:12,803
あれ?

9
00:00:02,752 --> 00:00:05,130
あった! テント!

you can see that the 4, 8, 9 are in wrong order, while the original srt file:

1
00:00:04,296 --> 00:00:07,800
(各務原(かがみはら)なでしこ)う~ん…

2
00:00:07,883 --> 00:00:09,009
あ!

3
00:00:10,177 --> 00:00:12,221
んん…

4
00:00:20,271 --> 00:00:24,233
ない ない ない…

5
00:00:24,567 --> 00:00:27,528
ない ない ない!

6
00:00:27,611 --> 00:00:28,612
ない…

7
00:00:29,321 --> 00:00:30,322
ああ…

8
00:00:39,039 --> 00:00:40,291
あれ?

9
00:00:42,209 --> 00:00:44,587
あった! テント!
Ttixan commented 5 months ago

I looked through the source code of condenser.py in function condense_subtitles, in line: 337, these is a mistake:

        end_time = end - start - offset

you should change this line of code to

        end_time = end - start

then it works.

ercanserteli commented 5 months ago

You are right, thanks