-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmp4_merge.command
executable file
·40 lines (32 loc) · 1.1 KB
/
mp4_merge.command
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
40
#**********INFO:**********
#
# This script must be copied into the folder containing the video files
# In order for this file to be executable you must run the following:
#
# chmod +x mp4_merge.command
#
# This command will let the mp4_merge file run by double clicking it
#
# This file works for merging .mp4 .MP4 .AVI
#
#*************************
#!/bin/bash
cd "$(dirname "$0")" #navigates to current directory
echo “Files in this folder:“
ls
inputFilenameDefault=G*.MP4
read -p "Enter input filename [$inputFilenameDefault]: " inputFilename
inputFilename=${inputFilename:-$inputFilenameDefault}
echo "inputFilename is $inputFilename"
outputFilenameDefault=race.mp4
read -p "Enter output filename [$outputFilenameDefault]: " outputFilename
outputFilename=${outputFilename:-$outputFilenameDefault}
echo "outputFilename is $outputFilename"
#the concat operation
shift
ls $inputFilename | perl -ne 'print "file $_"' > concat.list
ffmpeg -f concat -i concat.list -c copy $outputFilename
rm concat.list
if [[ $outputFilename == *".AVI"* ]]; then
ffmpeg -i $outputFilename -vcodec copy -an $outputFilename.mp4
fi