File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
packages/build/src/extensions/core Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,40 @@ export function ffmpeg(options: FfmpegOptions = {}): BuildExtension {
38
38
} ,
39
39
} ;
40
40
}
41
+
42
+ /**
43
+ * Add ffmpeg 7.x to the build, and automatically set the FFMPEG_PATH and FFPROBE_PATH environment variables.
44
+ * This uses the static build from johnvansickle.com to install the latest 7.x version.
45
+ *
46
+ * @returns The build extension.
47
+ */
48
+
49
+ export function ffmpeg7 ( ) : BuildExtension {
50
+ return {
51
+ name :"ffmpeg7" ,
52
+ onBuildComplete ( context ) {
53
+ if ( context . target === "dev" ) {
54
+ return ;
55
+ }
56
+
57
+ context . logger . debug ( "Adding ffmpeg 7" ) ;
58
+
59
+ context . addLayer ( {
60
+ id :"ffmpeg" ,
61
+ image : {
62
+ instructions :[
63
+ "RUN apt-get update && apt-get install -y --no-install-recommends wget xz-utils && apt-get clean && rm -rf /var/lib/apt/lists/*" ,
64
+ "RUN wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -O ffmpeg.tar.xz && tar xvf ffmpeg.tar.xz -C /usr/bin --strip-components=1 --no-anchored 'ffmpeg' 'ffprobe' && rm ffmpeg.tar.xz" ,
65
+ ] ,
66
+ } ,
67
+ deploy : {
68
+ env : {
69
+ FFMPEG_PATH : "/usr/bin/ffmpeg" ,
70
+ FFPROBE_PATH : "/usr/bin/ffprobe" ,
71
+ } ,
72
+ override : true ,
73
+ }
74
+ } )
75
+ }
76
+ }
77
+ }
You can’t perform that action at this time.
0 commit comments