Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ffmpeg-stabilizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Richard Torenvliet
ffmpeg-stabilizer
Commits
e46c9660
Commit
e46c9660
authored
7 years ago
by
Richard Torenvliet
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parents
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
convert.sh
+38
-0
38 additions, 0 deletions
convert.sh
makefile
+3
-0
3 additions, 0 deletions
makefile
stablize.sh
+55
-0
55 additions, 0 deletions
stablize.sh
with
96 additions
and
0 deletions
convert.sh
0 → 100755
+
38
−
0
View file @
e46c9660
#!/bin/bash
if
[
$#
-lt
2
]
;
then
echo
"missing arguments:"
echo
"usage
$0
<video> <options>"
exit
1
fi
video
=
$1
output_video
=
$2
echo
"output_video"
$2
#options=$2
base
=
$(
basename
"
$output_video
"
)
extension
=
"
${
base
##*.
}
"
base_filename
=
"
${
base
%.*
}
"
transform_file
=
"converted/
$base_filename
.trf"
output_merged
=
"converted/
$base_filename
-stb
$opts
-merged.
$extension
"
echo
"ffmpeg -i
$video
$options
-vf vidstabdetect=shakiness=8:accuracy=15:result=
$transform_file
-f null -"
echo
"Options"
echo
$options
echo
"==="
if
[
-z
"
$options
"
]
;
then
echo
"No time limit"
ffmpeg
-y
-i
$video
-vf
vidstabdetect
=
shakiness
=
5:accuracy
=
15:result
=
$transform_file
-f
null -
ffmpeg
-y
-i
$video
-vf
\
vidstabtransform
=
smoothing
=
5:interpol
=
bicubic:input
=
$transform_file
,unsharp
=
5:5:0.8:3:3:0.4
$output_video
ffmpeg
-y
-i
$video
-i
$output_video
-filter_complex
"[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w"
$output_merged
fi
if
[
-n
"
$options
"
]
;
then
echo
"Time limit"
ffmpeg
-y
-i
$video
$options
-vf
vidstabdetect
=
shakiness
=
5:accuracy
=
15:result
=
$transform_file
-f
null -
ffmpeg
-y
-i
$video
$options
-vf
\
vidstabtransform
=
smoothing
=
5:interpol
=
bicubic:input
=
$transform_file
,unsharp
=
5:5:0.8:3:3:0.4
$output_video
ffmpeg
-y
$options
-i
$video
-i
$output_video
-filter_complex
"[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w"
$output_merged
fi
This diff is collapsed.
Click to expand it.
makefile
0 → 100644
+
3
−
0
View file @
e46c9660
converted/%.MOV
:
./convert.sh
$(
VIDEO
)
$@
"
$(
OPTIONS
)
"
This diff is collapsed.
Click to expand it.
stablize.sh
0 → 100755
+
55
−
0
View file @
e46c9660
#!/bin/bash
if
[
$#
-ne
1
]
;
then
echo
"missing arguments:"
echo
"usage
$0
<list>"
exit
1
fi
tmpIFS
=
$IFS
while
IFS
=
''
read
-r
var
do
video
=
`
echo
"
$var
"
|
cut
-f1
-d
','
`
video
=
`
echo
$video
|
sed
's/,//g'
`
options
=
`
echo
"
$var
"
|
cut
-f2
-d
','
`
base
=
$(
basename
"
$video
"
)
extension
=
"
${
base
##*.
}
"
base_filename
=
"
${
base
%.*
}
"
transform_file
=
"converted/
$base_filename
.trf"
opts
=
$(
echo
$options
|
sed
's/\ //g'
)
opts
=
$(
echo
$opts
|
sed
's/:/-/g'
)
opts
=
$(
echo
$opts
|
sed
's/\"//g'
)
output_video
=
"converted/
$base_filename
-stb
$opts
.
$extension
"
output_merged
=
"converted/
$base_filename
-stb
$opts
-merged.
$extension
"
#echo $output_video
echo
$video
original_video
=
$(
echo
$output_video
|
sed
's/\(.*\)\(-stb.*\)\(.MOV$\)/\1\3/g'
)
#echo $derp
echo
$tmpIFS
IFS
=
$tmpIFS
if
[
-z
"
$options
"
]
;
then
VIDEO
=
$video
make
$output_video
;
fi
if
[
-n
"
$options
"
]
;
then
VIDEO
=
$video
OPTIONS
=
$options
make
$output_video
;
fi
done
<
"
$1
"
# for t in $ALL_TARGETS; do IFS=" " ;
# video=`echo $$t | cut -f1 -d ','`
# options=`echo $$t | cut -f2 -d ','`
# base=`basename $video`
# extension=MOV
# base_filename=`echo $base | sed 's/.MOV//g'`
# transform_file="converted/$base_filename.trf"
# opts=`echo $options | sed 's/\ //g'`
# opts=`echo $opts | sed 's/:/-/g'`
# output_video="$base_filename-stb$opts.$extension"
# output_merged="$base_filename-stb$opts-merged.$extension"
# #MOVIE=echo $t | cut -f1 -d ',' "OPT=${echo $t | cut -f2 -d ','}" make $output_video
# 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