jrottenberg / ffmpeg Goto Github PK
View Code? Open in Web Editor NEWDocker build for FFmpeg on Ubuntu / Alpine / Centos / Scratch / nvidia / vaapi
Home Page: https://hub.docker.com/r/jrottenberg/ffmpeg/
License: Apache License 2.0
Docker build for FFmpeg on Ubuntu / Alpine / Centos / Scratch / nvidia / vaapi
Home Page: https://hub.docker.com/r/jrottenberg/ffmpeg/
License: Apache License 2.0
This works:
sd run -it -rm -v $(pwd):/v jrottenberg/ffmpeg -i /v/video.mp4 -movflags faststart /v/video.webm
This does not work:
sd run -it -rm -v $(pwd):/v jrottenberg/ffmpeg -i /v/video.mp4 -movflags faststart /v/video.ogg
Error:
Encoder (codec theora) not found for output stream #0:0
How do I encode to OGG Theora?
Thank you for excelent image for ffmpeg.
I want to use -vf ass option to burn ass subtitle.
Please add --enable-libass when exec coufigure command.
best regard.
It would be really handy if, when compiling ffmpeg, its (development) headers could be copied.
This would allow the easier compilation of applications that link against ffmpeg.
docker logs -tf xxx does not show ffmpeg status
if docker runs in daemon mode
like
frame= 450 fps= 73 q=-1.0 Lsize= 6562kB time=00:00:17.91 bitrate=3000.1kbits/s speed=2.91x
any idea how this can be fixed?
as title
I must be missing something - but I cannot seam to get this container to run.
No matter how I try to initiate it with docker it just exits with code 0
Tried :
docker run jrottenberg/ffmpeg
and - docker run --name ffmpeg -d jrottenberg/ffmpeg
and docker-compose.yml with:
ffmpeg:
image: jrottenberg/ffmpeg
Even tried centos and alpine versions.
Here is a screen cap showing the exit code after running docker-compose up and how it continually restarting when using restart: always in my docker-compose.yml
Currently ffmpeg is the only thing in this compose file!
Is this not meant to keep running in the background like it would be if ffmpeg was installed directly to a server outside of docker?
I have docker running on a GCP compute instance running Centos 7 and out of all the active containers this is the only one I can't seam to get working. The VM should have more than enough resources dedicated to it to make it work fine - n1-highmem-4 (4 vCPUs, 26 GB memory) and plenty of hard drive space
Any assistance here would be greatly appreciated!
Thank You..
While streaming to an FB rtmp for FB live my stream gets randomly interrupted after a while with a connection reset by peer.
Probably not the image's fault but a network issue and just was curious to see that no-one reported the issue. There might be a workaround possible with the image I am not sure yet.
Hello!
Add the GPAC package
https://github.com/gpac/gpac
It is very useful for generating MPD manifests for DASH.
How can I pipe the generated image from this command to stdout?
-i https://s3-eu-west-1.amazonaws.com/.../original.mp4 -c:a copy -f mjpeg -preset ultrafast -an -c:v mjpeg -vf \"select='not(mod(n\\,29))',yadif,scale=480:-1,crop=iw:270,tile=1x50\" -q:v 20 -vframes 1
For example, I'm trying to reduce downloaded size, so I'll always want the alpine
based image. Currently, to download the latest alpine based image, I have to pull jrottenberg/ffmpeg:3.4-alpine
. I'll have to keep track of new releases and update the image tag. I'd much prefer being able to pull jrottenberg/ffmpeg:latest-alpine
or just jrottenberg/ffmpeg:alpine
to be always working with the latest alpine based image.
First, thank you very much for putting this together and sharing it.
Second, I have a question on how I can use your library with another library, FEniCS:
https://fenics.readthedocs.io/projects/containers/en/latest/jupyter.html
The above link shows how to start jupyter notebooks and I am learning to embed movies but this needs ffmpeg. When I try running my code it doesn't work because it can't find ffmpeg. Is there a way to get my fenics docker to use my ffmpeg docker?
As this container is only meant to run ffmpeg and its other programs, I believe shared libs do not really make a lot of sense here. I would like to suggest to build the binaries statically.
As Docker now allows for multistage builds, this would come in very handy, if one would like to use the result of your great build in another container. This can now be done as follows:
FROM jrottenberg/ffmpeg:3.3-alpine as ffmpeg
FROM node:alpine
COPY --from=ffmpeg /usr/local/bin/ff* /usr/local/bin/
Since ff* binaries are not compiled with static linking however, this becomes a lot more complicated.
any chance to include ndi support for future releases? it's getting attention now it's out and it's very useful for live transcoding and related tasks.
update to ffmpeg 3.2.1 release from 26.11.2016
Have a command like:
docker run jrottenberg/ffmpeg -stats -i http://url/file.mp4 -b 640k -c:v libx264 -profile:v high -preset medium -f mp4 - > /tmp/out.mp4
On output i have:
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
[libx264 @ 0x2ef8b20] final ratefactor: 24.75
[aac @ 0x2e65f80] Qavg: -nan
You have not encountered a similar problem for the mp4 container?
i found http://superuser.com/questions/760056/receiving-ffmpeg-error-22-when-piping-data-to-stdout
I'm trying to start this container using Docker remote API but the stream seems to be invalid. I think that this has nothing to do with this Docker image but I'm reaching here :)
I'm trying to stream to input using -i pipe:0 and then stream the output via pipe:1 but this is what ffmpeg tells me in the logs:
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.3.0 (Alpine 5.3.0)
configuration: --bindir=/usr/local/bin --disable-debug --disable-doc --disable-ffplay --disable-static --enable-avresample --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-openssl --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --prefix=/usr/local
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55dd87f5cce0] stream 0, offset 0x30: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55dd87f5cce0] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 3986 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55dd87f5cce0] Could not find codec parameters for stream 1 (Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, 2 channels, s16p, 128 kb/s): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.12.102
Duration: 00:00:01.19, bitrate: N/A
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none, 1280x720, 3986 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 23976 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55dd87f5cce0] stream 0, offset 0x30: partial file
pipe:0: Invalid data found when processing input
Finishing stream 0:0 without any data written to it.
Nothing was written into output file 0 (pipe:), because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
Do you have any idea whats going on here? If not, any idea how I can see the complete command used for starting, log the input stream or something?
Cheers
It might not actually make a difference in your setup, as you are clearing caches in your last line anyways, but there is the apk add --no-cache
switch, which you could use to prevent caches from being created in the first place.
Great work!
My best regards,
Markus
In 3.3 Ubuntu image.
I have a m3u8 playlist with corresponding .ts files that have been recorded with ffmpeg on my Mac.
The codec is aac.
In the docker image, when I try to mux the m3u8 and .ts into a standalone .aac, ffmpeg is stuck on the first segment:
ffmpeg -i index.m3u8 test.aac
[hls,applehttp @ 0x1bdfec0] Opening 'index0.ts' for reading
<- never process.
Would it be possible to create a set of images where FFmpeg is not dynamically linked to its shared libraries? My reasoning is that then you could use docker's multi-stage build process to simply copy the FFmpeg / FFprobe binaries out of this container and into any other container. E.g:
FROM jrottenberg/ffmpeg AS ffmpeg
FROM python
# Copy in FFmpeg and FFprobe
COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/
Currently doing this means calls to FFmpeg give the message
ffmpeg: error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory
It would be a nice alternative to changing the FROM
as suggested #90 .
I'm sure this is much more complicated than I am imagining!
Tool ffprobe is important in ffmpeg which probe media file information and is useful. I found that ffprobe wasn't in current docker image. I'm wondering that whether it can be added in? Thanks.
Hello. I am running a Homebridge Docker image and I need for it to be able to use ffmpeg. So inside the other dockerfile can I copy and paste the run code? I am fairly new to Docker , will having it install and compile for Ubuntu work in every use case scenario without having to worry about the host os that has Docker installed on it? Or is there someway for docker to pick up the host os and install the correct version of ffmpeg? Or is there some way to pull the package that is already built since this takes a long time to build?
I have tried -v "/mnt/user/media/fonts/":"/usr/share/fonts"
but I have
Fontconfig error: Cannot load default config file
[Parsed_ass_0 @ 0x82fb60] No usable fontconfig configuration file found, using fallback.
Fontconfig error: Cannot load default config file
ffmpeg: error while loading shared libraries: libgomp.so.1: cannot open shared object file: No such file or directory
With either 3.2
or 3.3
.
Executing : bash -c docker run -v=/Users/rriel/projects/poka/in-house-transcoding/__temp/:/tmp/ffmpeg jrottenberg/ffmpeg:3.2 -i /tmp/ffmpeg/tmpp8t70ih3/input -c:a libfdk_aac -b:a 64k -ac 2 -vf "scale=w=trunc((iw*min(1\,min(min(200\,iw)/iw\,min(200\,ih)/ih)))/2)*2:-2" -c:v libx264 -x264-params keyint=90 -b:v 136k -refs 1 -preset slow -profile:v baseline -pix_fmt yuv420p -level 3.0 -hls_init_time 10 -hls_time 10 -hls_list_size 0 -hls_segment_filename "/tmp/ffmpeg/tmpp8t70ih3/output/out_200K%05d.ts" /tmp/ffmpeg/tmpp8t70ih3/output/out_200K.m3u8
Return code : 127
Output:
3.2: Pulling from jrottenberg/ffmpeg
d5c6f90da05d: Already exists
bbbe761fcb56: Already exists
7afa5ede606f: Already exists
f6b7253b56f4: Already exists
2b8db33536d4: Already exists
6f5ab11f8bba: Pulling fs layer
9043ea512e45: Pulling fs layer
9043ea512e45: Verifying Checksum
9043ea512e45: Download complete
6f5ab11f8bba: Verifying Checksum
6f5ab11f8bba: Download complete
6f5ab11f8bba: Pull complete
9043ea512e45: Pull complete
Digest: sha256:eb5378b1ae2064fd51f2644f8258b065128e551f9107f53ff6c5b1fe91941754
Status: Downloaded newer image for jrottenberg/ffmpeg:3.2
ffmpeg: error while loading shared libraries: libgomp.so.1: cannot open shared object file: No such file or directory
Thanks,
Dragos
Hi!
Please consider using the stable branch of x264?
Thanks,
I'm trying to get the number of frames using this command below bu it generates an invalid data exception when processing the input.
ffprobe version 3.3.2 Copyright (c) 2007-2017 the FFmpeg developers
built with gcc 5.3.0 (Alpine 5.3.0)
configuration: --bindir=/usr/local/bin --disable-debug --disable-doc --disable-ffplay --disable-static --enable-avresample --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-openssl --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --prefix=/usr/local
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
{
pipe:0: Invalid data found when processing input
}
This is the command I'm using
cat big_buck_bunny.mp4 | docker run --entrypoint ffprobe jrottenberg/ffmpeg:3.3-alpine -i pipe:0 -print_format json -select_streams v:0 -show_entries stream=nb_frames
I have also tried using ffmpeg
from the container but that doesn't work either.
cat big_buck_bunny.mp4 | docker run jrottenberg/ffmpeg:3.3-alpine -i pipe:0
Produces
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.3.0 (Alpine 5.3.0)
configuration: --bindir=/usr/local/bin --disable-debug --disable-doc --disable-ffplay --disable-static --enable-avresample --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-nonfree --enable-openssl --enable-postproc --enable-shared --enable-small --enable-version3 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --prefix=/usr/local
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
pipe:0: Invalid data found when processing input
I need to use ffprobe
to get the total frames before I use ffmpeg
. Is this command available through you image?
Current behaviour:
# docker run -it --entrypoint=/bin/sh jrottenberg/ffmpeg:3.4
# ffprobe -v error -show_streams test.mp4 | grep profile
profile=1
profile=578
Expected behaviour: (ffmpeg 3.4 installed on alpine, macOS, and Ubuntu)
# ffprobe -show_streams -v error test.mp4 | grep profile
profile=LC
profile=Constrained Baseline
Hello
I am trying to compile your Dockerfile on my Synology but Im'getting this error:
checking pkg-config is at least version 0.9.0... yes
checking for OGG... no
checking for Ogg... no
*** Could not run Ogg test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means Ogg was incorrectly installed
*** or that you have moved Ogg since it was installed.
configure: error:
libogg is required to build this package!
please see http://www.xiph.org/ for how to
obtain a copy.
The command '/bin/sh -c DIR=/tmp/theora && mkdir -p ${DIR} && cd ${DIR} && curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && make && make install && rm -rf ${DIR}' returned a non-zero code: 1
Do you know why?
I want ffmpeg reconnect to src after lost input stream, may be lets make exit from docker after lost stream and docker auto restart ?
How i can make exit from docker after lost ffmpeg src stream input ?
Hello!
Please update build ffmpeg to 3.4.2.
thank you. ))
Hello, is it possible to provide simple example of saving transcoding output into AWS S3 Bucket?
It would be superusefull. Thank you! :)
See: https://ffmpeg.org/general.html#OpenCORE-AMR
OpenCORE AMR
and VisualOn AMR-WB encoder library
can be used for encoding amr audio.
Fribidi won't compile anymore. Package can't be downloaded. Changed the url to:
https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz
and modified the parameters, but then it complains that it can't find configure.
b892353 introduced support for libass, but there is no /usr/share/fonts dir at all so the feature just doesn't work.
jrottenberg/ffmpeg:3.3-alpine image:
/ $ ls -l /usr/share/
total 12
drwxr-xr-x 3 root root 4096 Jul 30 18:23 ca-certificates
drwxr-xr-x 2 root root 4096 Jun 25 17:52 man
drwxr-xr-x 2 root root 4096 Jun 25 17:52 misc
/ $
Adding ttf-liberation
package to the image makes it possible to render subs into video.
Hello
any plans to add ffprobe and qt-faststart?
Thank you
I'm not sure is it intended to be like that or it's disabled by some non-obvious option?
Hi,
Does this container supports hardware acceleration like intel quicksync ?
gpg: requesting key D67658D8 from hkp server ha.pool.sks-keyservers.net
gpg: keyserver timed out
He tried to use the version 3.3 Dockerfile and I get this error, tried a change ha.pool.sks-keyservers.net by pool.sks-keyservers.net and it works correctly
My company uses docker for developer VMs, and one of these extends FROM jrottenberg/ffmpeg:2.7
. Today I noticed that the 2.7 tag is no longer available on docker hub. Do you know why that is? Was it removed by you, or does docker hub have an automatic expiration on old tags?
Thanks!
docker run --rm -it --entrypoint=/bin/sh jrottenberg/ffmpeg
# which apk
#
has anyone attempted to get this to build on ARM64? I don't want to spend hours just find out something is blocking.
@jrottenberg Are you open to a PR introducing the libspeex
codec?
If so, I'd be happy to submit the PR!
Thank you for the repo!
I don't know what difference this makes in practice, but please consider building this image for speed instead of size?
--enable-small optimize for size instead of speed
Thanks!
I try to build and it fails at step 20. I am on ubuntu 16.04.
`Step 20/45 : RUN DIR=/tmp/opencore-amr && mkdir -p ${DIR} && cd ${DIR} && curl -sL https://10gbps-io.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | tar -zx --strip-components=1 && ./configure --prefix="${PREFIX}" --enable-shared && make && make install && rm -rf ${DIR}
---> Running in 67c287050b6d
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
`
Something is wrong with tags description
$ docker pull jrottenberg/ffmpeg:3.1-ubuntu
Pulling repository docker.io/jrottenberg/ffmpeg
Tag 3.1-ubuntu not found in repository docker.io/jrottenberg/ffmpeg
I use this command with jrottenberg/ffmpeg:3.3-alpine
which works fine but using the 4.0
release does not produce any output?
docker run jrottenberg/ffmpeg:4.0-alpine -stats -i http://techslides.com/demos/sample-videos/small.mp4 -f mjpeg -vf select='not(mod(n\,3))',yadif,scale=480:-1,crop=iw:270,tile=1x50 -q:v 5 -vframes 1 - > scrub.jpg
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.