Closed sebastinas closed 2 years ago
Related issue (it was on the deprecated function that eventually were removed): https://github.com/osrf/gazebo/issues/2002
A bit of info on replacements extracted from ffmpeg:
avcodec_decode_audio4
and avcodec_decode_video2
need to be substitued with Use avcodec_send_packet() and avcodec_receive_frame(). (http://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#gaaa1fbe477c04455cdc7a994090100db4 and http://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga3ac51525b7ad8bca4ced9f3446e96532)codec
member of AVStream
needs to be substituted with "the codecpar struct instead" (https://github.com/FFmpeg/FFmpeg/blob/n4.4.1/libavformat/avformat.h#L885)For the usual #if
preprocessor magic, in libavformat/version.h
the macro LIBAVFORMAT_VERSION_MAJOR
is defined, that is:
Strictly related issue: https://github.com/ignitionrobotics/ign-common/issues/306 (as the affected classes are the same that as some point were copied there).
I also have this issue on manjaro linux
@KenwoodFox, did you manage to fix it? I experience the same on Manjaro when trying to build ros-noetic-desktop-full. I don't understand how to fix this myself, @traversaro.
Basically we need to substitute the function that were removed from ffmpeg API with the one that are still existing, see https://github.com/osrf/gazebo/issues/3180#issuecomment-1053641133 . If you want to try to fix it, perhaps it is a good idea to first get a basic idea of how the ffmpeg API works, for example reading the examples in https://github.com/FFmpeg/FFmpeg/tree/870bfe16a12bf09dca3a4ae27ef6f81a2de80c40/doc/examples . Once you got the general idea, I guess it may be easier to fix the code in Gazebo. Furthermore, a possible easier stepping stone may be fixing ffmpeg support in https://github.com/ignitionrobotics/ign-common/issues/306 .
@KenwoodFox, did you manage to fix it? I experience the same on Manjaro when trying to build ros-noetic-desktop-full. I don't understand how to fix this myself, @traversaro.
I have not yet, I fail building ignition due to ffmpeg deps, this may take a PR to solve I'll look into learning the API
@vebjornjr @traversaro @KenwoodFox Hi guys, the workaround that work for me was first unistall ffmpeg then install gazebo using ffmpeg4.4, finaly reinstall ffmpeg, i hope it works for you.
sudo pacman -Rd --nodeps ffmpeg (and any other ffmpeg you have installed, like the git version) sudo pacman -S ffmpeg4.4 yay -S gazebo sudo pacman -S ffmpeg
@vebjornjr @traversaro @KenwoodFox Hi guys, the workaround that work for me was first unistall ffmpeg then install gazebo using ffmpeg4.4, finaly reinstall ffmpeg, i hope it works for you.
sudo pacman -Rd --nodeps ffmpeg (and any other ffmpeg you have installed, like the git version) sudo pacman -S ffmpeg4.4 yay -S gazebo sudo pacman -S ffmpeg
This worked!
@vebjornjr @traversaro @KenwoodFox Hi guys, the workaround that work for me was first unistall ffmpeg then install gazebo using ffmpeg4.4, finaly reinstall ffmpeg, i hope it works for you.
sudo pacman -Rd --nodeps ffmpeg (and any other ffmpeg you have installed, like the git version) sudo pacman -S ffmpeg4.4 yay -S gazebo sudo pacman -S ffmpeg
Thank you, it worked for me too.
avcodec_decode_audio4
andavcodec_decode_video2
need to be substitued with Use avcodec_send_packet() and avcodec_receive_frame(). (http://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#gaaa1fbe477c04455cdc7a994090100db4 and http://ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga3ac51525b7ad8bca4ced9f3446e96532)
"Need to be substituted" is a bit generic. I found the relevant commit that change the ffmpeg examples to understand how they can be substituted:
avcodec_decode_audio4
: https://github.com/FFmpeg/FFmpeg/commit/3d66717f7cb5555257244be8f5bce172ed3af7acFor avcodec_decode_video2
this ign-common commit is strictly related: https://github.com/ignitionrobotics/ign-common/commit/e2f6a84100f39fe29d5ffc49447e12c1f6c4196d .
I guess that backporting:
Should fix the problem also for Classic Gazebo.
A fix for this issue is provided in https://github.com/osrf/gazebo/pull/3195 .
Fixed by https://github.com/osrf/gazebo/pull/3195.
gazebo is not compatible with ffmpeg 5.0: