gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.21k stars 484 forks source link

Fix compatibility with FFmpeg 5.0 #3195

Closed traversaro closed 2 years ago

traversaro commented 2 years ago

Partial backport of:

to Classic Gazebo.

With respect to https://github.com/ignitionrobotics/ign-common/pull/325, I noticed a strange behaviour for which the avcodec_parameters_to_context function that in https://github.com/osrf/gazebo/pull/3195/files#diff-08c8dfc0ffe4733c2fcc1ebd0e3f67032e24b302b25a90c26e87994582503198R326 was not copying the members of the AVCodecParameters structure to the AVCodecContext structure. I was not able to understand why that happened, but copying the members manually worked fine, however it is probably worth to check that the tests work fine on another setup by commenting out https://github.com/osrf/gazebo/pull/3195/files#diff-08c8dfc0ffe4733c2fcc1ebd0e3f67032e24b302b25a90c26e87994582503198R334-R348 .

scpeters commented 2 years ago

thank you so much for fixing this in both ign-common and here in gazebo!

I still see two deprecation warnings for av_init_packet in Video.cc and VideoEncoder.cc, but we can address those another day