OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
249 stars 120 forks source link

Problem saving animation as .mp4 #592

Closed laralps closed 3 years ago

laralps commented 3 years ago

Hello!

I am quite new in python language and opendrift modelling, so I'm having some difficulties in saving model results. When I try to save plots with the filename argument as .png, images are saved perfectly. But when I try to save animations as .mp4 I get an error I cannot understand:

code: o.animation(fast = True, show_trajectories=True, filename = 'figures/test.mp4' )

error: INFO:opendrift.models.basemodel:Could not save animation: 18:10:13 INFO opendrift.models.basemodel: Command '['ffmpeg', '-f', 'rawvideo', '-vcodec', 'rawvideo', '-s', '792x484', '-pix_fmt', 'rgba', '-r', '20', '-loglevel', 'error', '-i', 'pipe:', '-vcodec', 'h264', '-pix_fmt', 'yuv420p', '-y', 'figures/testeSpectrum.mp4']' returned non-zero exit status 1.

Another doubt is if there is a limit of 'trajectory duration' to save animations as .gif. I can save gifs normally when the model has only a few days of duration, but if I increase the drift time, I cannot save animation as gif.

I am using ubuntu linux and running opendrift in spyder. Any help will be much appreciated.

knutfrode commented 3 years ago

Solved by Slack

Kusal1997 commented 1 year ago

I also have this problem, even I can't save the file as gifs. What should I do

knutfrode commented 1 year ago

Hi, what is your command, and which error message do you get?