Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with FFmpeg 5.0 #325

Merged
merged 1 commit into from
Mar 20, 2022
Merged

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented Mar 19, 2022

馃 Bug fix

Fixes #306

Summary

This PR fixes compilation against FFmpeg 5.0 . It has been tested by using the conda-forge build of ffmpeg 5.0 on Linux, in particular with this deps:

# packages in environment at /home/traversaro/mambaforge/envs/igncommondev:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
aom                       3.3.0                h27087fc_1    conda-forge
binutils                  2.36.1               hdd6e379_2    conda-forge
binutils_impl_linux-64    2.36.1               h193b22a_2    conda-forge
binutils_linux-64         2.36                 hf3e587d_8    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.18.1               h7f98852_0    conda-forge
c-compiler                1.4.1                h166bdaf_0    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
cmake                     3.22.3               h5432695_0    conda-forge
compilers                 1.4.1                ha770c72_0    conda-forge
cxx-compiler              1.4.1                h924138e_0    conda-forge
eigen                     3.4.0                h4bd325d_0    conda-forge
expat                     2.4.7                h27087fc_0    conda-forge
ffmpeg                    5.0.0                h594f047_1    conda-forge
fortran-compiler          1.4.1                h2a4ca65_0    conda-forge
freeimage                 3.18.0               h88c329d_7    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gcc                       10.3.0               he2824d0_8    conda-forge
gcc_impl_linux-64         10.3.0              hf2f2afa_14    conda-forge
gcc_linux-64              10.3.0               hc39de41_8    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
gfortran                  10.3.0               h18518b4_8    conda-forge
gfortran_impl_linux-64    10.3.0              h73f4979_14    conda-forge
gfortran_linux-64         10.3.0               hb09a455_8    conda-forge
glib                      2.70.2               h780b84a_4    conda-forge
glib-tools                2.70.2               h780b84a_4    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
gts                       0.7.6                h64030ff_2    conda-forge
gxx                       10.3.0               he2824d0_8    conda-forge
gxx_impl_linux-64         10.3.0              hf2f2afa_14    conda-forge
gxx_linux-64              10.3.0               h2593f52_8    conda-forge
icu                       69.1                 h9c3ff4c_0    conda-forge
ilmbase                   2.5.5                h780b84a_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jpeg                      9e                   h7f98852_0    conda-forge
jxrlib                    1.1                  h7f98852_2    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_15    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.19.3               h08a2579_0    conda-forge
lame                      3.100             h7f98852_1001    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      3.0                  h9c3ff4c_0    conda-forge
libcurl                   7.82.0               h2283fc2_0    conda-forge
libdeflate                1.10                 h7f98852_0    conda-forge
libdrm                    2.4.109              h7f98852_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-devel_linux-64     10.3.0              he6cfe16_14    conda-forge
libgcc-ng                 11.2.0              h1d223b6_14    conda-forge
libgfortran5              11.2.0              h5c6108e_14    conda-forge
libglib                   2.70.2               h174f98d_4    conda-forge
libgomp                   11.2.0              h1d223b6_14    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
libignition-cmake2        2.11.0               h27087fc_0    conda-forge
libignition-math6         6.10.0               h9c3ff4c_0    conda-forge
libnghttp2                1.47.0               he49606f_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libpciaccess              0.16                 h516909a_0    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libraw                    0.20.2               h10796ff_1    conda-forge
libsanitizer              10.3.0              h26c7422_14    conda-forge
libssh2                   1.10.0               ha35d2d1_2    conda-forge
libstdcxx-devel_linux-64  10.3.0              he6cfe16_14    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_14    conda-forge
libtiff                   4.3.0                h542a066_3    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libuv                     1.43.0               h7f98852_0    conda-forge
libva                     2.14.0               h7f98852_0    conda-forge
libvpx                    1.11.0               h9c3ff4c_3    conda-forge
libwebp-base              1.2.2                h7f98852_1    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxml2                   2.9.12               h885dcf4_1    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
ninja                     1.10.2               h4bd325d_1    conda-forge
openexr                   2.5.5                hf817b99_0    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   3.0.0                h7f98852_2    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pkg-config                0.29.2            h36c2ea0_1008    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
python                    3.10.2          hc74c709_4_cpython    conda-forge
python_abi                3.10                    2_cp310    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
rhash                     1.4.1                h7f98852_0    conda-forge
setuptools                60.10.0         py310hff52083_0    conda-forge
sqlite                    3.37.1               h4ff8645_0    conda-forge
svt-av1                   0.9.1                h27087fc_0    conda-forge
sysroot_linux-64          2.12                he073ed8_15    conda-forge
tinyxml2                  9.0.0                h9c3ff4c_2    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
x264                      1!161.3030           h7f98852_1    conda-forge
x265                      3.5                  h924138e_3    conda-forge
xorg-fixesproto           5.0               h7f98852_1002    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxfixes            5.0.3             h7f98852_1004    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.2                ha95c52a_0    conda-forge

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you so much! I've tested this locally with ffmpeg 5.0 on my Mac laptop and it is working great. I just have some comments about the tests that have been commented out; hopefully we can re-enable them at least for the older versions of ffmpeg

av/src/AudioDecoder_TEST.cc Outdated Show resolved Hide resolved
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
{
break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

av/src/AudioDecoder.cc Outdated Show resolved Hide resolved
@traversaro traversaro force-pushed the fix306 branch 2 times, most recently from dea1014 to abde9e4 Compare March 19, 2022 22:42
@traversaro
Copy link
Contributor Author

I think I confused the label bot logic as I originally created the PR against ign-common4 and only later changed it to target ign-common3, but as this targets ign-common3 the PR is also related to citadel.

Signed-off-by: Silvio Traversaro <silvio@traversaro.it>
@codecov
Copy link

codecov bot commented Mar 19, 2022

Codecov Report

Merging #325 (a11287b) into ign-common3 (14c585a) will not change coverage.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##           ign-common3     #325   +/-   ##
============================================
  Coverage        76.58%   76.58%           
============================================
  Files               73       73           
  Lines            10403    10403           
============================================
  Hits              7967     7967           
  Misses            2436     2436           
Impacted Files Coverage 螖
av/src/AudioDecoder.cc 83.96% <酶> (酶)
av/src/Video.cc 76.98% <100.00%> (酶)
av/src/VideoEncoder.cc 76.12% <100.00%> (酶)

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 14c585a...a11287b. Read the comment docs.

@scpeters scpeters added 馃彴 citadel Ignition Citadel and removed 馃彚 edifice Ignition Edifice 馃彲 fortress Ignition Fortress labels Mar 20, 2022
scpeters added a commit to osrf/homebrew-simulation that referenced this pull request Mar 20, 2022
@scpeters
Copy link
Member

I've opened osrf/homebrew-simulation#1833 to restore ffmpeg 5.0 as a dependency of ignition-common3 and a separate test PR #326 that will build against its matching branch name

Core development automation moved this from Inbox to In review Mar 20, 2022
scpeters added a commit to osrf/homebrew-simulation that referenced this pull request Mar 20, 2022
* Patch from gazebosim/gz-common#325
* update  bottle.

Co-authored-by: OSRF Build Bot <osrfbuild@osrfoundation.org>
@scpeters scpeters merged commit 429fbc6 into gazebosim:ign-common3 Mar 20, 2022
Core development automation moved this from In review to Done Mar 20, 2022
scpeters added a commit to scpeters/homebrew-simulation that referenced this pull request Mar 21, 2022
@scpeters scpeters moved this from Done to Highlights in Core development Mar 21, 2022
scpeters added a commit to scpeters/homebrew-simulation that referenced this pull request Mar 22, 2022
scpeters added a commit to osrf/homebrew-simulation that referenced this pull request Mar 22, 2022
Patch from gazebosim/gz-common#325

* Add ffmpeg dependency to ign-gazebo, ign-launch

brew test-bot was complaining that ign-gazebo and ign-launch
have "Undeclared dependencies with linkage" on ffmpeg@4.
This adds an ffmpeg dependency to the edifice and
fortress packages to accompany the ignition-common4 changes.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>

* update  bottle.

Co-authored-by: OSRF Build Bot <osrfbuild@osrfoundation.org>
@j-rivero j-rivero removed this from Highlights in Core development May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃彴 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation failure with ffmpeg 5.0
2 participants