-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgp2mov.sh
More file actions
executable file
·39 lines (34 loc) · 1.09 KB
/
gp2mov.sh
File metadata and controls
executable file
·39 lines (34 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
d=$1
# create an mov for each subdirectory
#
# ffmpeg options culled from the following sources:
# http://mewiki.project357.com/wiki/X264_Encoding_Suggestions#QuickTime-compatible_Encoding
# https://trac.ffmpeg.org/wiki/Encode/H.264
# http://en.wikipedia.org/wiki/High-definition_television
# http://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence
for f in $d/*GOPRO
do
echo "Working on directory $f"
ffmpeg -f image2 -pattern_type glob -i "$f/*.JPG" -r 30 -s 1920x1080 -pix_fmt yuv420p ${f}_ffmpeg.mov
done
cd $d
# from: https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join%2C%20merge)%20media%20files#samecodec
# Create a file list for use with ffmpeg in concate mode
for f in ./*.mov
do
echo "file '$f'" >> flist.txt
done
#printf "file '%s'\n" ./*.wav > mylist.txt
# Use ffmpeg to concatenate all the subdirectory mov files into one big one
curr_dir=${PWD##*/}
echo "combined output file name: ${curr_dir}.mov"
ffmpeg -f concat -i flist.txt -c copy "../${curr_dir}.mov"
# Cleanup
rm flist.txt
for f in ./*.mov
do
echo "removing file '$f'"
rm $f
done
cd ..