GenericMappingTools / 2020-unavco-course

Planning and material for the 2020 UNAVCO GMT for Geodesy course
34 stars 18 forks source link

Error while creating [?].webm in ./test_2.sh running #20

Closed husduman closed 4 years ago

husduman commented 4 years ago

Dear GMT users and course mates,

I installed the GMT using conda without any problem. In running the tests, the first bash file was run and all desired files were successfully created . But in the second one, the MP4 animation file was successfully created again while the WEBM was not, which of the following error I encountered;

movie [NOTICE]: Running: ffmpeg -loglevel warning -f image2 -framerate 4 -y -i "count/count_%02d.png" -vcodec libx264  -pix_fmt yuv420p count.mp4
movie [NOTICE]: Running: ffmpeg -loglevel warning -f image2 -framerate 4 -y -i "count/count_%02d.png" -vcodec libvpx -crf 10 -b:v 1.2M -pix_fmt yuv420p count.webm
Unknown encoder 'libvpx'
movie [ERROR]: Running FFmpeg conversion to webM returned error 256 - exiting.
Open either count.mp4 or count.webm in an application that can view movies

Thank you in advance for your help. Sincerely, Huseyin

PaulWessel commented 4 years ago

Seems your ffmpeg installation is lacking a runtime library. What operating system are you on? What does ffmpeg -version say?

When I run the -version it shows how ffmpeg was made and in my case it has --enable-libvpx.

husduman commented 4 years ago

The OS is Ubuntu 18.04. The version ffmpeg is 4.1.3 and once running the -version, "--enable-libvpx" does not seem. Is there any way to enable libvpx or should I recompile ffmpeg externaly?

Thank you

PaulWessel commented 4 years ago

I could not find a clear answer why ffpmeg on ubunto does not have that library or if there is a sequence of steps you would take to get the library installed first, then build ffmpeg. Since I dont use ubuntu I do not really know if there are options during the install to add them. You can certainly build it externally after installing those libraries first. Why ubuntu would ship affmpeg that cannot make mp4 seems odd. Might you know, @seisman ?

seisman commented 4 years ago

I installed the GMT using conda without any problem.

If you installed GMT using conda, your ffmpeg should also come from conda. conda provides ffmpeg 4.3, but you said

The version ffmpeg is 4.1.3 and once running the -version, "--enable-libvpx" does not seem

Could you run which ffmpeg to see the full path of your ffmpeg command?

seisman commented 4 years ago

Just checked the ffmpeg from conda. I think it doesn't support "libvpx", possibly due to the complicated dependency. But the ffmpeg from Ubuntu should support "libvpx".

I think there are two options for you:

  1. Just ignore it. Since your ffmpeg can generate MP4 correctly, there is no need to have one more video format (webM) if it's not necessary for you.
  2. Uninstall the ffmpeg from conda and install the one provided by Ubuntu official repository. The command should be:
    conda uninstall ffmpeg
    apt-get install ffmpeg
husduman commented 4 years ago

Hi @seisman, I am sure any ffmpeg package have not been installed on my system until the GMT installation. Now, I have just tried what you comment, and it works well.

@PaulWessel, @seisman thanks for your time.

acalahorrano commented 4 years ago

Hi @seisman, I do have the same issue. I also installed gmt 6.1 using conda. However, the count.mp4 has not been generated correctly either. Since I installed gmt in an environment, I am pretty sure that the system ffmpeg and conda's ffmpeg are different. When trying to use "conda uninstall ffmpeg" , it also uninstalls gmt! Is there any way to modify the path to ffmpeg within conda's environment so that GMT calls to Ubuntu's version instead of conda's?

Thank you!

*Edit: I installed VLC media player and the .mp4 does play correctly there, while xdg-open just shows a black screen. I guess I could just ignore it as suggested, but I would still be interested in knowing how to modify the paths to certain dependencies in case something similar happens again...

seisman commented 4 years ago

Hi @seisman, I do have the same issue. I also installed gmt 6.1 using conda. However, the count.mp4 has not been generated correctly either. Since I installed gmt in an environment, I am pretty sure that the system ffmpeg and conda's ffmpeg are different. When trying to use "conda uninstall ffmpeg" , it also uninstalls gmt! Is there any way to modify the path to ffmpeg within conda's environment so that GMT calls to Ubuntu's version instead of conda's?

I just installed gmt using conda in an isolated environment. It can generate count.mp4 but not count.webm, as mentioned above. But I'm using macOS, perhaps the ffmpeg from conda is slightly different on Linux.

To remove the ffmpeg from conda, you can run:

conda remove --force ffmpeg

This command will remove ffmpeg package only, but won't uninstall any packages that depends on ffmpeg (e.g., gmt). Then, your gmt should be able to use the ffmpeg from Ubuntu.

acalahorrano commented 4 years ago

@seisman Thank you! It worked like a charm.

PaulWessel commented 4 years ago

Closing this as solved.