yarp
yarp copied to clipboard
ffmpeg_grabber does not compile against Ffmpeg 5.0
Compilation error:
yarp_plugin_yarpmod_ffmpeg_grabber.cpp
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,25): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\buildd
ev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,36): error C2065: 'dst': undeclared identifier [C:\src\yarp\builddev\src
\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,41): error C2062: type 'int' unexpected [C:\src\yarp\builddev\src\device
s\ffmpeg\yarp_ffmpeg.vcxproj]
FfmpegGrabber.cpp
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,25): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\buildd
ev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,36): error C2065: 'dst': undeclared identifier [C:\src\yarp\builddev\src
\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,41): error C2062: type 'int' unexpected [C:\src\yarp\builddev\src\device
s\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(121,47): error C2039: 'codec': is not a member of 'AVStream' [C:\src\y
arp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(124,1): error C2440: '=': cannot convert from 'const AVCodec *' to 'AV
Codec *' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(124,38): message : Conversion loses qualifiers [C:\src\yarp\builddev\s
rc\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(153,22): error C3861: 'avpicture_get_size': identifier not found [C:\s
rc\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(158,25): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\
builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(158,36): error C2059: syntax error: ')' [C:\src\yarp\builddev\src\devi
ces\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(215,21): error C3861: 'avcodec_decode_audio4': identifier not found [C
:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(254,9): error C3861: 'avcodec_decode_video2': identifier not found [C:
\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(273,46): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\
builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(273,56): error C2059: syntax error: ')' [C:\src\yarp\builddev\src\devi
ces\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(408,81): error C2440: '=': cannot convert from 'const AVInputFormat *'
to 'AVInputFormat *' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(408,35): message : Conversion loses qualifiers [C:\src\yarp\builddev\s
rc\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(441,45): error C2440: '=': cannot convert from 'const AVInputFormat *'
to 'AVInputFormat *' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(441,35): message : Conversion loses qualifiers [C:\src\yarp\builddev\s
rc\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(490,5): error C3861: 'av_register_all': identifier not found [C:\src\y
arp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegGrabber.cpp(701,13): error C3861: 'av_free_packet': identifier not found [C:\src\y
arp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
FfmpegWriter.cpp
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,25): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\buildd
ev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,36): error C2065: 'dst': undeclared identifier [C:\src\yarp\builddev\src
\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,41): error C2062: type 'int' unexpected [C:\src\yarp\builddev\src\device
s\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(95,13): error C2039: 'codec': is not a member of 'AVStream' [C:\src\yar
p\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(112,13): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(115,46): error C2440: '=': cannot convert from 'const AVCodec *' to 'AV
Codec *' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(115,33): message : Conversion loses qualifiers [C:\src\yarp\builddev\sr
c\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(138,20): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(216,13): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(228,16): error C3861: 'avcodec_encode_audio2': identifier not found [C:
\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(239,30): error C2039: 'coded_frame': is not a member of 'AVCodecContext
' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavcodec/avcodec.h(389): message : see dec
laration of 'AVCodecContext' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(258,13): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(290,24): error C3861: 'avcodec_encode_audio2': identifier not found [C:
\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(301,38): error C2039: 'coded_frame': is not a member of 'AVCodecContext
' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavcodec/avcodec.h(389): message : see dec
laration of 'AVCodecContext' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(326,23): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(348,13): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(394,12): error C3861: 'avpicture_get_size': identifier not found [C:\sr
c\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(400,21): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\b
uilddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(400,32): error C2059: syntax error: ')' [C:\src\yarp\builddev\src\devic
es\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(411,13): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(414,46): error C2440: '=': cannot convert from 'const AVCodec *' to 'AV
Codec *' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(414,33): message : Conversion loses qualifiers [C:\src\yarp\builddev\sr
c\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(474,13): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(478,29): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\b
uilddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(478,40): error C2059: syntax error: ')' [C:\src\yarp\builddev\src\devic
es\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(491,16): error C3861: 'avcodec_encode_video2': identifier not found [C:
\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(504,34): error C2039: 'coded_frame': is not a member of 'AVCodecContext
' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavcodec/avcodec.h(389): message : see dec
laration of 'AVCodecContext' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(505,16): error C2039: 'coded_frame': is not a member of 'AVCodecContext
' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavcodec/avcodec.h(389): message : see dec
laration of 'AVCodecContext' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(539,23): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(601,5): error C3861: 'av_register_all': identifier not found [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(605,62): error C2440: '=': cannot convert from 'const AVOutputFormat *'
to 'AVOutputFormat *' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(605,26): message : Conversion loses qualifiers [C:\src\yarp\builddev\sr
c\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(608,56): error C2440: '=': cannot convert from 'const AVOutputFormat *'
to 'AVOutputFormat *' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(608,30): message : Conversion loses qualifiers [C:\src\yarp\builddev\sr
c\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(620,18): error C2039: 'filename': is not a member of 'AVFormatContext'
[C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(1215): message : see
declaration of 'AVFormatContext' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(620,39): error C2039: 'filename': is not a member of 'AVFormatContext'
[C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(1215): message : see
declaration of 'AVFormatContext' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(635,47): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\FfmpegWriter.cpp(688,35): error C2039: 'codec': is not a member of 'AVStream' [C:\src\ya
rp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:/Users/STraversaro/AppData/Local/mambaforge/envs/yarpdev/Library/include\libavformat/avformat.h(950): message : see d
eclaration of 'AVStream' [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
ffmpeg_api.cpp
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,25): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\buildd
ev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,36): error C2065: 'dst': undeclared identifier [C:\src\yarp\builddev\src
\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.h(44,41): error C2062: type 'int' unexpected [C:\src\yarp\builddev\src\device
s\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.cpp(10,25): error C2065: 'AVPicture': undeclared identifier [C:\src\yarp\buil
ddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.cpp(10,36): error C2065: 'dst': undeclared identifier [C:\src\yarp\builddev\s
rc\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.cpp(10,41): error C2062: type 'int' unexpected [C:\src\yarp\builddev\src\devi
ces\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.cpp(12,56): error C2143: syntax error: missing ';' before '{' [C:\src\yarp\bu
ilddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
C:\src\yarp\src\devices\ffmpeg\ffmpeg_api.cpp(12,56): error C2447: '{': missing function header (old-style formal list?
) [C:\src\yarp\builddev\src\devices\ffmpeg\yarp_ffmpeg.vcxproj]
Generating Code...
Warning when compiling against ffmpeg 4.4, that are mostly related to deprecations that are errors on yarp 5.0 :
2022-10-06T13:45:03.1420138Z [767/1284] Linking CXX shared module lib/yarp/yarp_transformClient.so
2022-10-06T13:45:03.1420601Z [768/1284] Building CXX object src/devices/ffmpeg/CMakeFiles/yarp_ffmpeg.dir/FfmpegWriter.cpp.o
2022-10-06T13:45:03.1421451Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp: In function 'AVStream* add_audio_stream(AVFormatContext*, AVCodecID)':
2022-10-06T13:45:03.1422573Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:95:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1423157Z 95 | c = st->codec;
2022-10-06T13:45:03.1423386Z | ^~~~~
2022-10-06T13:45:03.1424014Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1424820Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1425368Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1425728Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1425993Z | ^~~~~
2022-10-06T13:45:03.1426838Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:95:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1427424Z 95 | c = st->codec;
2022-10-06T13:45:03.1427653Z | ^~~~~
2022-10-06T13:45:03.1428265Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1429226Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1429760Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1430133Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1430462Z | ^~~~~
2022-10-06T13:45:03.1431319Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:95:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1431888Z 95 | c = st->codec;
2022-10-06T13:45:03.1432131Z | ^~~~~
2022-10-06T13:45:03.1432855Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1433644Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1434194Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1434567Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1434832Z | ^~~~~
2022-10-06T13:45:03.1435537Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp: In function 'void open_audio(AVFormatContext*, AVStream*)':
2022-10-06T13:45:03.1436646Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:112:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1437231Z 112 | c = st->codec;
2022-10-06T13:45:03.1437459Z | ^~~~~
2022-10-06T13:45:03.1438068Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1438861Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1439484Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1439843Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1440103Z | ^~~~~
2022-10-06T13:45:03.1440958Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:112:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1441521Z 112 | c = st->codec;
2022-10-06T13:45:03.1441764Z | ^~~~~
2022-10-06T13:45:03.1442373Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1443166Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1443693Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1444068Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1444332Z | ^~~~~
2022-10-06T13:45:03.1445171Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:112:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1445755Z 112 | c = st->codec;
2022-10-06T13:45:03.1446000Z | ^~~~~
2022-10-06T13:45:03.1446603Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1447380Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1447928Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1448302Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1448551Z | ^~~~~
2022-10-06T13:45:03.1449403Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:138:20: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1450042Z 138 | switch(st->codec->codec_id) {
2022-10-06T13:45:03.1450316Z | ^~~~~
2022-10-06T13:45:03.1450917Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1451707Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1452319Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1452695Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1452942Z | ^~~~~
2022-10-06T13:45:03.1453801Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:138:20: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1454445Z 138 | switch(st->codec->codec_id) {
2022-10-06T13:45:03.1454702Z | ^~~~~
2022-10-06T13:45:03.1455316Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1456117Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1456660Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1457017Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1457284Z | ^~~~~
2022-10-06T13:45:03.1458143Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:138:20: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1458836Z 138 | switch(st->codec->codec_id) {
2022-10-06T13:45:03.1459109Z | ^~~~~
2022-10-06T13:45:03.1459725Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1460518Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1461050Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1461419Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1461684Z | ^~~~~
2022-10-06T13:45:03.1462406Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp: In function 'void write_audio_frame(AVFormatContext*, AVStream*)':
2022-10-06T13:45:03.1463465Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:214:24: warning: 'void av_init_packet(AVPacket*)' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1464022Z 214 | av_init_packet(&pkt);
2022-10-06T13:45:03.1464283Z | ^
2022-10-06T13:45:03.1464626Z In file included from /usr/share/miniconda3/envs/test/include/libavcodec/bsf.h:30,
2022-10-06T13:45:03.1465072Z from /usr/share/miniconda3/envs/test/include/libavcodec/avcodec.h:44,
2022-10-06T13:45:03.1465759Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:13,
2022-10-06T13:45:03.1466539Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1467062Z /usr/share/miniconda3/envs/test/include/libavcodec/packet.h:488:6: note: declared here
2022-10-06T13:45:03.1467455Z 488 | void av_init_packet(AVPacket *pkt);
2022-10-06T13:45:03.1467735Z | ^~~~~~~~~~~~~~
2022-10-06T13:45:03.1631108Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:216:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1632318Z 216 | c = st->codec;
2022-10-06T13:45:03.1632571Z | ^~~~~
2022-10-06T13:45:03.1633192Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1634012Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1634565Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1635328Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1635590Z | ^~~~~
2022-10-06T13:45:03.1636538Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:216:13: warning: 'AVStream::codec' is deprecated [-Wdeprecated-declarations]
2022-10-06T13:45:03.1637141Z 216 | c = st->codec;
2022-10-06T13:45:03.1637384Z | ^~~~~
2022-10-06T13:45:03.1637985Z In file included from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.h:14,
2022-10-06T13:45:03.1638791Z from /home/runner/work/robotology-superbuild/robotology-superbuild/src/YARP/src/devices/ffmpeg/FfmpegWriter.cpp:38:
2022-10-06T13:45:03.1639341Z /usr/share/miniconda3/envs/test/include/libavformat/avformat.h:888:21: note: declared here
2022-10-06T13:45:03.1639703Z 888 | AVCodecContext *codec;
2022-10-06T13:45:03.1639968Z | ^~~~~
PR that fixes a similar problem in Gazebo Classic: https://github.com/osrf/gazebo/pull/3195 .
At the moment I am not working on this, so anyone that wants to work on this is welcome. Note that Ubuntu 24.04 probably will only ship with ffmpeg 5, and not with ffmpeg 4.
It interesting to note that the image_compression_ffmpeg portmonitor instead compiles fine with both ffmpeg 5 and 6, so that one can compile fine with recent ffmpeg.
I do not know if it is related to this issue or not but I am having a compilation error as below when the option ENABLE_yarpcar_portmonitor is ON: (https://github.com/ami-iit/element_haptic-gloves/issues/159#issuecomment-1805295330)
[ 50%] Building CXX object src/portmonitors/image_compression_ffmpeg/CMakeFiles/yarp_pm_image_compression_ffmpeg.dir/ffmpegPortmonitor.cpp.o
[ 50%] Linking CXX shared module ../../../lib/yarp/yarp_pm_image_compression_ffmpeg.so
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libswscale.a(hscale_fast_bilinear_simd.o): relocation R_X86_64_32S against `.text.unlikely' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[5]: *** [src/portmonitors/image_compression_ffmpeg/CMakeFiles/yarp_pm_image_compression_ffmpeg.dir/build.make:118: lib/yarp/yarp_pm_image_compression_ffmpeg.so] Error 1
make[4]: *** [CMakeFiles/Makefile2:5623: src/portmonitors/image_compression_ffmpeg/CMakeFiles/yarp_pm_image_compression_ffmpeg.dir/all] Error 2
make[3]: *** [Makefile:156: all] Error 2
make[2]: *** [CMakeFiles/YARP.dir/build.make:85: src/YARP/CMakeFiles/YCMStamp/YARP-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1083: CMakeFiles/YARP.dir/all] Error 2
make: *** [Makefile:101: all] Error 2
No, that error is different. Can you open a new issue describing the environment in which you are experiencing this problem?