Ask Your Question
1

`sage -pip install --user ffmpeg` did not make the "`OSError: Error: ffmpeg does not appear to be installed.`" message go away

asked 2019-08-18 14:06:07 -0500

otherrealm gravatar image

updated 2019-08-19 19:09:11 -0500

I am running a Docker instance of Cocalc on a Ubuntu 16 server. Everything seems to be working but I am trying to debug why sage -pip install --user ffmpeg did not make the "OSError: Error: ffmpeg does not appear to be installed." message go away, even though it said it had been installed. Here is the full message.

Error in lines 9-9
Traceback (most recent call last):
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute
    flags=compile_flags) in namespace, locals
  File "", line 1, in <module>
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2944, in show
    s = show0(objs, combine_all=True)
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2903, in show0
    b = show0(a)
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2868, in show0
    show_animation(obj, **kwds)
  File "/usr/local/sage/local/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2642, in show_animation
    obj.ffmpeg(t, delay=delay, **kwds)
  File "/usr/local/sage/local/lib/python2.7/site-packages/sage/plot/animate.py", line 885, in ffmpeg
    raise OSError(msg)
OSError: Error: ffmpeg does not appear to be installed. Saving an animation to
a movie file in any format other than GIF requires this software, so
please install it and try again.

For reference, here is the code that gives the error:

n = var("n")
frames = []
xr = (x, 0, 1)
for k in srange(1, 50):
    g = plot((sum((-1)^(n-1)*sin(n*x)/n,n,1,k)), xr, color="blue", legend_label='k = %d' % k)
    g += plot(x/2, xr, color="green", legend_label="x/2")
    frames.append(g)

a = animate(frames, ymin=0.0, ymax=1.0, legend_loc=(0.2,0.8))
a.show()
edit retag flag offensive close merge delete

Comments

It's not really clear what you mean by "I restarted everywhere I could restart", nor is it clear in what context you're getting this message. Did you try re-creating the Docker container? I don't think this is really a question about Sage unfortunately. Probably not related to anything you were trying to do with ffmpeg though.

Iguananaut gravatar imageIguananaut ( 2019-08-19 03:30:12 -0500 )edit

Recreating docker appears to have resolved the communications issue, but I'm still getting the OSError: Error: ffmpeg does not appear to be installed. one

otherrealm gravatar imageotherrealm ( 2019-08-19 17:22:30 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-08-19 23:58:58 -0500

tmonteil gravatar image

I do not know exactly what is the ffmpeg Python package, but the genuine ffmpeg program is written in C, so i bet that the ffmpegPython package is only an interface of the latter, see https://github.com/jiashaokun/ffmpeg. So you should install the ffmpeg from the distro by adding something like RUN apt-get apt-get install -y ffmpeg somewhere in you dockerfile.

edit flag offensive delete link more

Comments

It looks like there is a poorly(?) documented optional dependency on ffmpeg for saving plot animations as video formats. That should probably be improved somehow. It looks like there isn't even an optional sage package for it...

Iguananaut gravatar imageIguananaut ( 2019-08-21 04:24:37 -0500 )edit

Installing the apt-get version in the docker bash console seems to have worked. Thanks!!!

otherrealm gravatar imageotherrealm ( 2019-08-24 19:53:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-08-18 14:06:07 -0500

Seen: 36 times

Last updated: Aug 19