Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding ffmpeg v7 #1777

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/build/src/extensions/core/ffmpeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,40 @@ export function ffmpeg(options: FfmpegOptions = {}): BuildExtension {
},
};
}

/**
* Add ffmpeg 7.x to the build, and automatically set the FFMPEG_PATH and FFPROBE_PATH environment variables.
* This uses the static build from johnvansickle.com to install the latest 7.x version.
*
* @returns The build extension.
*/

export function ffmpeg7(): BuildExtension {
return {
name: "ffmpeg7",
onBuildComplete(context) {
if (context.target === "dev") {
return;
}

context.logger.debug("Adding ffmpeg 7");

context.addLayer({
id: "ffmpeg7",
image: {
instructions:[
"RUN apt-get update && apt-get install -y --no-install-recommends wget xz-utils && apt-get clean && rm -rf /var/lib/apt/lists/*",
"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",
],
},
deploy: {
env: {
FFMPEG_PATH: "/usr/bin/ffmpeg",
FFPROBE_PATH: "/usr/bin/ffprobe",
},
override: true,
}
})
}
}
}