ffmpeg icon indicating copy to clipboard operation
ffmpeg copied to clipboard

Container will not stay running: ffmpeg exits with code 0

Open sidgrafix opened this issue 8 years ago • 4 comments

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 ffmpeg-exits-with-code-0

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

sidgrafix avatar Jun 26 '17 01:06 sidgrafix

ffmpeg is a command line application, not a service.

Here is how I run it

#!/bin/sh
docker run -it -v=$(pwd):/tmp/workdir jrottenberg/ffmpeg:latest $@

-> then use it like ffmpeg was installed on your machine normally.

tuomas2 avatar Jun 26 '17 08:06 tuomas2

Thank you for the response (had my hopes up) - but that pretty much did the same. Started, then exited!

I understand ffmpeg is a command line application - I have it installed on a dedicated server which is used by one of the sites hosted on that server to transcode uploaded video via Drupal 7 (which works wonderfully, and has been active for several years now.

I'm trying to get everything from that server into docker and I'm down to this last hickup - ffmpeg

I appreciate the help, but looks like I'm just going to have to compile and install ffmpeg directly to the VM - seams this will be the only way to get the results I need, which is unfortunate being I wanted everything portable and instantly deploy-able.

I've even tried a few of the other docker containers out there for ffmpeg with the same results (starts, then exits and the site can't see it. The qt-faststart image I found runs and the site can connect to that, but no ffmpeg containers I've tried doesn't seam to work - as I would expect ffmpeg to work)

Was hoping someone had the magic info here! From what I see with this ffmpeg container is it needs to be executed with when you want to transcode and isn't listening otherwise at least from the documentation examples, that is the feeling I've gotten. Either that or I'm completely missing something (which is possible considering I've been stuck in a terminal for days trying to work this out)

If you have any other suggestions, I'm all ears!

Thanks again..

sidgrafix avatar Jun 26 '17 13:06 sidgrafix

Hi @sidgrafix, If you want to have the ffmpeg container running all time and being able to pass it parameters you might want to look at :https://github.com/alexellis/faas

I listen over HTTP and pass parameters to a command line tool.

GnaphronG avatar Jul 16 '17 20:07 GnaphronG

Hi, I want to use the container as a permanent container too. Maybe it is possible to add another tag, with a permanent CMD like "CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"". The background for me is the convert of a list of files found by the "find" command. For now, this does not work very easy. Greetings jan

jg-development avatar Dec 07 '17 19:12 jg-development