Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
materials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
osak
materials
Commits
cbc4f036
"README.md" did not exist on "_static-resources"
Commit
cbc4f036
authored
13 years ago
by
Milan Santosi
Browse files
Options
Downloads
Patches
Plain Diff
should be done now.
Signed-off-by:
Milan Santosi
<
milan.santosi@gmail.com
>
parent
b32d635a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
kiss/ffmpeg_splitter.sh
+10
-6
10 additions, 6 deletions
kiss/ffmpeg_splitter.sh
with
10 additions
and
6 deletions
kiss/ffmpeg_splitter.sh
+
10
−
6
View file @
cbc4f036
...
...
@@ -2,7 +2,8 @@
# dirty little script to split a video into 15 minutes parts with ten
# seconds overlap (for upload to youtube)
# Author: milan <milan.santosi@gmail.com>
#
# USAGE: read comments and adjust where necessary, then:
# ./ffmpeg_splitter.sh <inputfile>
####################################################################
...
...
@@ -25,13 +26,16 @@ else
fi
# get length and calculate amount of segments
let
vidlen
=
$(
ffprobe
-show_format
$1
|
grep
duration |
cut
-d
"."
-f
1 |
cut
-d
"="
-f
2
)
+1
let
segcount
=
$vidlen
/890
# get length of the original video, calculate amount of segments and
# combined length of all parts (with overlap)
let
vidlen
=
$(
ffprobe
-show_format
$bname
-keyframes
.
$ext
|
grep
duration |
cut
-d
"."
-f
1 |
cut
-d
"="
-f
2
)
let
segcount
=
$vidlen
/900
let
withoverlap
=
$vidlen
+
$segcount
*
10
let
newsegcount
=
$withoverlap
/900
# loop until it's done
for
((
i
=
1
;
i <
=
$segcount
;
i++
))
# loop until it's done
(actually one more time, just to make sure)
for
((
i
=
1
;
i <
=
$
new
segcount
+1
;
i++
))
do
ffmpeg
-vcodec
copy
-acodec
copy
-ss
$[
i
*
890 - 890]
-t
899.999
-i
$bname
-keyframes
.
$ext
$bname
-part0
$i
.
$ext
done
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