Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
subtitle_time_shift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gael MILLOT
subtitle_time_shift
Commits
be0fd2fb
You need to sign in or sign up before continuing.
Commit
be0fd2fb
authored
2 years ago
by
Gael MILLOT
Browse files
Options
Downloads
Patches
Plain Diff
release v1.2: README and subtitle_time_shift.R files improved
parent
48fab8db
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+6
-1
6 additions, 1 deletion
README.md
subtitle_time_shift.R
+36
-1
36 additions, 1 deletion
subtitle_time_shift.R
with
42 additions
and
2 deletions
README.md
+
6
−
1
View file @
be0fd2fb
...
@@ -39,7 +39,7 @@ Shift the time of .srt subtitle files
...
@@ -39,7 +39,7 @@ Shift the time of .srt subtitle files
### Using a R GUI (graphic user interface, i.e., R or RStudio windows)
### Using a R GUI (graphic user interface, i.e., R or RStudio windows)
1) Open the subtitle_time_shift.R file and set the parameters (
2 first lines
)
1) Open the subtitle_time_shift.R file and set the parameters (
in the "Parameters set by users" section
)
2) Open R or RStudio
2) Open R or RStudio
...
@@ -92,6 +92,11 @@ Not yet published
...
@@ -92,6 +92,11 @@ Not yet published
## WHAT'S NEW IN
## WHAT'S NEW IN
### v1.2
README and subtitle_time_shift.R files improved.
### v1.1
### v1.1
README file improved.
README file improved.
...
...
This diff is collapsed.
Click to expand it.
subtitle_time_shift.R
+
36
−
1
View file @
be0fd2fb
#!/usr/bin/env Rscript
#########################################################################
## ##
## subtitle_time_shift.R ##
## ##
## Gael A. Millot ##
## Bioinformatics and Biostatistics Hub ##
## Institut Pasteur Paris ##
## ##
#########################################################################
################################ From
# https://gitlab.pasteur.fr/gmillot/subtitle_time_shift
################################ End From
################################ Aim
# Shift the time of .srt subtitle files
################################ End Aim
################################ Parameters set by users
shift
<-
-1
# in seconds
shift
<-
-1
# in seconds
in.path
<-
"C:/Users/Gael/Documents/Git_projects/subtitle_time_shift/dataset/movie.srt"
# absolute path of the input file
in.path
<-
"C:/Users/Gael/Documents/Git_projects/subtitle_time_shift/dataset/movie.srt"
# absolute path of the input file
################################ End Parameters set by users
################################ Main code
a
<-
read.table
(
in.path
,
sep
=
"\t"
,
check.names
=
FALSE
,
quote
=
""
,
comment.char
=
""
,
blank.lines.skip
=
FALSE
)
a
<-
read.table
(
in.path
,
sep
=
"\t"
,
check.names
=
FALSE
,
quote
=
""
,
comment.char
=
""
,
blank.lines.skip
=
FALSE
)
out.path
<-
paste0
(
sub
(
x
=
in.path
,
pattern
=
"\\.srt$"
,
replacement
=
""
),
"_shift.srt"
)
out.path
<-
paste0
(
sub
(
x
=
in.path
,
pattern
=
"\\.srt$"
,
replacement
=
""
),
"_shift.srt"
)
...
@@ -17,5 +52,5 @@ f <- a
...
@@ -17,5 +52,5 @@ f <- a
f
[
tempo.log
,
]
<-
sapply
(
X
=
e
,
FUN
=
function
(
x
=
X
){
paste0
(
x
,
collapse
=
" --> "
)})
f
[
tempo.log
,
]
<-
sapply
(
X
=
e
,
FUN
=
function
(
x
=
X
){
paste0
(
x
,
collapse
=
" --> "
)})
write.table
(
f
,
file
=
out.path
,
row.names
=
FALSE
,
col.names
=
FALSE
,
append
=
FALSE
,
quote
=
FALSE
,
sep
=
"\t"
)
write.table
(
f
,
file
=
out.path
,
row.names
=
FALSE
,
col.names
=
FALSE
,
append
=
FALSE
,
quote
=
FALSE
,
sep
=
"\t"
)
################################ End Main code
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment