https://github.com/denismakogon/ffmpeg-debian
FFMPEG shared libs for OpenJDK | Golang
https://github.com/denismakogon/ffmpeg-debian
compile docker ffmpeg gmf golang java media multistage openjdk
Last synced: about 1 year ago
JSON representation
FFMPEG shared libs for OpenJDK | Golang
- Host: GitHub
- URL: https://github.com/denismakogon/ffmpeg-debian
- Owner: denismakogon
- Created: 2018-06-28T11:22:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-05-21T18:37:20.000Z (about 4 years ago)
- Last Synced: 2025-03-24T14:44:35.678Z (about 1 year ago)
- Topics: compile, docker, ffmpeg, gmf, golang, java, media, multistage, openjdk
- Language: Dockerfile
- Homepage:
- Size: 77.1 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FFMPEG & Golang binding for Go Media Framework (GMF)
## What's inside?
In this repo you'll find the following images:
- base (something that you don't need but used across all other images)
- -build (ffmpeg compiled from source with all plugins available, you don't need that as well)
- -golang- (golang + ffmpeg build environment)
- -runtime (ffmpeg runtime for golang compiled application)
- -openjdk- (ffmpeg runtime for openjdk compiled application)
- test (test image with one of the Go Media Framework applications complied and executed as the verification that all images work fine)
## How to build a GMF application?
Check the following GMF application:
```dockerfile
FROM ghcr.io/denismakogon/ffmpeg-debian:5.0.1-golang-1 as build-stage
RUN go get github.com/3d0c/gmf
WORKDIR $GOPATH/src/github.com/3d0c/gmf/examples
RUN mkdir -p /examples/tmp && \
cp tmp/big_buck_bunny.webm /examples/tmp/big_buck_bunny.webm
RUN go build -o /examples/video-to-frames video-to-jpeg-avio.go
FROM ghcr.io/denismakogon/ffmpeg-debian:5.0.1-runtime
COPY --from=build-stage /examples /examples
WORKDIR /examples
ENTRYPOINT ["./video-to-frames"]
```
In this dockerfile:
- you need `denismakogon/ffmpeg-debian:5.0.1-golang-1` as a build environment for GMF-based applications
- you need `denismakogon/ffmpeg-debian:5.0.1-runtime` as a runtime for complied application from the build stage
- compile a binary at the build stage
- copy binary through docker multi-stage feature to the runtime
```shell
docker build -t test-ffmpeg --build-arg "FFMPEG_VERSION=5.0.1" --build-arg "GOLANG_VERSION=1" -f test/Dockerfile .
```
## How to build docker images
base image:
```shell
docker build -t ghcr.io/denismakogon/ffmpeg-debian:base -f base/Dockerfile .
```
FFMPEG build stage image:
```shell
docker build -t ghcr.io/denismakogon/ffmpeg-debian:5.0.1-build -f ffmpeg/5.0.1/Dockerfile .
```
optional build arg is `BASE_IMAGE_DIGEST_TAG`, it used to point to a specific version of [ffmpeg-debian:base](https://ghcr.io/denismakogon/ffmpeg-debian:base) image.
```shell
docker build -t ghcr.io/denismakogon/ffmpeg-debian:5.0.1-build -f ffmpeg/5.0.1/Dockerfile \
--build-arg "BASE_IMAGE_DIGEST_TAG=ghcr.io/denismakogon/ffmpeg-debian@sha256:f6781e831ef68a7ff7170374639be85098b49c6a7740a3652d2f8f1ba43afc1e" \
.
```
see the [following documentation](https://github.com/denismakogon/ffmpeg-debian/pkgs/container/ffmpeg-debian/22132531?tag=sha256-f6781e831ef68a7ff7170374639be85098b49c6a7740a3652d2f8f1ba43afc1e.sig).
runtime image:
```shell
docker build -t ghcr.io/denismakogon/ffmpeg-debian:5.0.1-runtime -f runtime/Dockerfile \
--build-arg "BASE_IMAGE_DIGEST_TAG=ghcr.io/denismakogon/ffmpeg-debian@sha256:f6781e831ef68a7ff7170374639be85098b49c6a7740a3652d2f8f1ba43afc1e" \
--build-arg "BUILD_IMAGE_DIGEST_TAG=ghcr.io/denismakogon/ffmpeg-debian@sha256:2b421ef4be773ce80d3f82717d9fd845e6cc03dfad4c961b2886b7a59117a609" \
.
```
Golang image:
```shell
docker build -t ghcr.io/denismakogon/ffmpeg-debian:5.0.1-golang-1 -f golang/Dockerfile \
--build-arg "BUILD_IMAGE_DIGEST_TAG=ghcr.io/denismakogon/ffmpeg-debian@sha256:2b421ef4be773ce80d3f82717d9fd845e6cc03dfad4c961b2886b7a59117a609" \
--build-arg "GOLANG_VERSION=1" \
.
```
Please note, golang version must in ffmpeg image must match to `GOLANG_VERSION` build arg.
OpenJDK image:
```shell
docker build -t ghcr.io/denismakogon/ffmpeg-debian:5.0.1-openjdk-18 -f openjdk/Dockerfile \
--build-arg "BASE_IMAGE_DIGEST_TAG=ghcr.io/denismakogon/ffmpeg-debian@sha256:f6781e831ef68a7ff7170374639be85098b49c6a7740a3652d2f8f1ba43afc1e" \
--build-arg "BUILD_IMAGE_DIGEST_TAG=ghcr.io/denismakogon/ffmpeg-debian@sha256:2b421ef4be773ce80d3f82717d9fd845e6cc03dfad4c961b2886b7a59117a609" \
--build-arg "JDK_PKG_URL=https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_linux-x64_bin.tar.gz" \
.
```
```shell
docker build -t ghcr.io/denismakogon/ffmpeg-debian:5.0.1-openjdk-19-ea-panama -f openjdk/Dockerfile \
--build-arg "FFMPEG_VERSION=5.0.1" \
--build-arg "JDK_PKG_URL=https://download.java.net/java/early_access/panama/1/openjdk-19-panama+1-13_linux-x64_bin.tar.gz" .
```