-
Notifications
You must be signed in to change notification settings - Fork 1
/
ffmpeg.sh
82 lines (72 loc) · 3.22 KB
/
ffmpeg.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
##
## @rse/ffmpeg -- FFmpeg distribution for NPM
## Copyright (c) 2021-2023 Dr. Ralf S. Engelschall <rse@engelschall.com>
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the
## "Software"), to deal in the Software without restriction, including
## without limitation the rights to use, copy, modify, merge, publish,
## ffmpeg.dribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to
## the following conditions:
##
## The above copyright notice and this permission notice shall be included
## in all copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
##
set -e
# create ffmpeg.dribution area
rm -rf ffmpeg.d
mkdir -p ffmpeg.d
# helper function for downloading a file
download () {
echo "-- url: $1"
echo "-- file: $2"
curl -k -L "-#" --compressed -A "https://github.com/rse/ffmpeg" -o "$2" "$1"
}
# fetch Windows/x64 executable (version 6.1)
echo "++ win-x64"
download "https://github.com/GyanD/codexffmpeg/releases/download/6.1/ffmpeg-6.1-essentials_build.zip" win-x64.zip
unzip -q -o -x win-x64.zip
mv ffmpeg-6.1-essentials_build/bin/ffmpeg.exe ffmpeg.d/ffmpeg-win-x64.exe
chmod 755 ffmpeg.d/ffmpeg-win-x64.exe
rm -rf ffmpeg-6.1-essentials_build
rm -f win-x64.zip
# fetch macOS/x64 executable (version 6.1)
echo "++ mac-x64"
download "https://evermeet.cx/pub/ffmpeg/ffmpeg-6.1.zip" mac-x64.zip
unzip -q -o -x -d ffmpeg.d mac-x64.zip ffmpeg
mv ffmpeg.d/ffmpeg ffmpeg.d/ffmpeg-mac-x64
rm -f mac-x64.zip
# fetch macOS/a64 executable (version 6.1)
echo "++ mac-a64"
download "https://www.osxexperts.net/ffmpeg61arm.zip" mac-a64.zip
unzip -q -o -d ffmpeg.d mac-a64.zip ffmpeg
mv ffmpeg.d/ffmpeg ffmpeg.d/ffmpeg-mac-a64
rm -f mac-a64.zip
# fetch Linux/x64 executable (version 6.1)
echo "++ lnx-x64"
download "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" lnx-x64.tar.xz
xz -d <lnx-x64.tar.xz | tar -x -C ffmpeg.d --strip-components 1 -f- "ffmpeg-6.1-amd64-static/ffmpeg"
mv ffmpeg.d/ffmpeg ffmpeg.d/ffmpeg-lnx-x64
chmod 755 ffmpeg.d/ffmpeg-lnx-x64
rm -f lnx-x64.tar.xz
# fetch Linux/a64 executable (version 6.1)
echo "++ lnx-a64"
download "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz" lnx-a64.tar.xz
xz -d <lnx-a64.tar.xz | tar -x -C ffmpeg.d --strip-components 1 -f- "ffmpeg-6.1-arm64-static/ffmpeg"
mv ffmpeg.d/ffmpeg ffmpeg.d/ffmpeg-lnx-a64
chmod 755 ffmpeg.d/ffmpeg-lnx-a64
rm -f lnx-a64.tar.xz
# fetch FreeBSD/x64 executable (version 6.1)
echo "++ bsd-x64"
download "https://github.com/Thefrank/ffmpeg-static-freebsd/releases/download/v6.1.0/ffmpeg" ffmpeg.d/ffmpeg-bsd-x64
chmod 755 ffmpeg.d/ffmpeg-bsd-x64