Giter VIP home page Giter VIP logo

ffmpeg-debian's Introduction

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:

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
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:

docker build -t ghcr.io/denismakogon/ffmpeg-debian:base -f base/Dockerfile .

FFMPEG build stage image:

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 image.

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.

runtime image:

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:

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:

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" \
  .
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" .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.