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

ffmpeg-debian's People

Contributors

denismakogon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

asdfsx jandyu

ffmpeg-debian's Issues

Error in github.com/3d0c/gmf downloading stage

Hi @denismakogon! Thank you so much for your help repository.

I'm trying to launch my web service with github.com/3d0c/gmf library in docker.

I've checked your recommendations to create image, and I'm catching the error in go packages download. The error is:

# github.com/3d0c/gmf
/usr/bin/ld: $WORK/b334/_x011.o: in function `gmf_get_timecode':
/go/pkg/mod/github.com/3d0c/[email protected]/frame_go112.go:36: undefined reference to `av_timecode_make_smpte_tc_string2'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `FcWeightToOpenTypeDouble'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined reference to `fribidi_get_bracket'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined reference to `fribidi_get_par_embedding_levels_ex'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `FcWeightFromOpenTypeDouble'
collect2: error: ld returned 1 exit status

Have you ever faced with its problem?

My full Dockerfile is:

FROM ghcr.io/denismakogon/ffmpeg-debian:5.0.1-golang-1 as build-stage

RUN go version
RUN pkg-config --libs libavformat

WORKDIR /app
COPY . .

RUN go build -o videophash /app/cmd/main.go


FROM ghcr.io/denismakogon/ffmpeg-debian:5.0.1-runtime

WORKDIR /app
COPY --from=builder /app/ ./

ENTRYPOINT ["./videophash", "--config=./configs/config.yaml"]

Also I'm trying to build it from sources in your images like:

RUN wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ffmpeg/7:5.1.1-1ubuntu1/ffmpeg_5.1.1.orig.tar.xz
RUN tar -C /usr/local -xvf ffmpeg_5.1.1.orig.tar.xz

RUN cd /usr/local/ffmpeg-5.1.1 && ./configure --disable-x86asm --prefix=/usr/local/ffmpeg --enable-shared && make && make install && cd -

But It didn't help.

I will be happy if you help me. Have a nice day!

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.