Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
00:01:25,166 --> 00:01:28,233
Any stuff that does not sell at all?
00:01:30,800 --> 00:01:32,500
Here is one!
You got it?
00:01:34,166 --> 00:01:37,200
Of course I have!
Why shouldn't I bring this?
and so forth
The original file has the following format:
text (OPTIONAL, some subtitles might have only one line of text)
The converted file should have the following format. The last number in the timecode m4=n4*33.33, rounded to the nearest integer, could be either rounded up or down:
n1:n2:n3,ROUND(n4*33.33) --> m1:m2:m3,ROUND(m4*33.33)
textIF THERE'S A SECOND LINE OF TEXT
I guess, the algorithm would be:
1 open original file
2 create a new file
3 initiate a line number counter at 1
4 write the line number value to the new file
5 write a linebreak
6 read the chunk of timecode till you hit SPACE (gives n1:n2:n3:n4)
7 perform the calculation ROUND(n4*33.33)
8 write the new timecode chunk n1:n2:n3,ROUND(n4*33.33) to file
10 read the next chunk of timecode till hit LINEBREAK (gives m1:m2:m3:m4)
11 perform the calculation in line 7
12 write the new timecode chunk m1:m2:m3,ROUND(m4*33.33) to file
13 write a linebreak
14 read the text till you reach a linebreak
15 copy it to the new file
I suppose it could also do it this way:
1) Check if the first character on the line is a number. If it is, then, in the new file,
write the line number
insert a linebreak
do the calculation and write the result
insert a linebreak
2) If the first characted on the line is text
just copy the text and linebreaks as is
1 The text lines might contain all sorts of characters and punctuation like ,.:!?()/"' and so forth or even accented characters
2 The text lines will NEVER begin with a number and ALWAYS end with a linebreak
3 The timecode lines ALWAYS begin with a number and ALWAYS end with a linebreak
Thanks for reading all this!
The source text file is generated by an editing application (Avid Media Composer).
The output is a subrip format text file, used by Youtube.
The finished script would be the first open source "Avid DS to Subrip convertor script". None exist (for Linux) right now, as far as I know.
I'll share copies around and will be happy to call it the "LQ Avid to Youtube Subtitle Script" !