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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_XVMC_MPEG2_MC’ was not declared in this scope #323

Closed
OtacilioNeto opened this issue Jan 18, 2018 · 14 comments

Comments

@OtacilioNeto
Copy link

OtacilioNeto commented Jan 18, 2018

I'm getting this erros below related with ffmpeg when compiling under Ubuntu 16.04. Some idea?

[ 71%] Building CXX object src/CMakeFiles/pangolin.dir/video/drivers/ffmpeg.cpp.o
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp: In function ‘std::cxx11::string pangolin::FfmpegFmtToString(AVPixelFormat)’:
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_XVMC_MPEG2_MC’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT
##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:83:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(XVMC_MPEG2_MC);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_XVMC_MPEG2_IDCT’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT
##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:84:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(XVMC_MPEG2_IDCT);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_VDPAU_H264’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:104:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(VDPAU_H264);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_VDPAU_MPEG1’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:105:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(VDPAU_MPEG1);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_VDPAU_MPEG2’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:106:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(VDPAU_MPEG2);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_VDPAU_WMV3’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:107:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(VDPAU_WMV3);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_VDPAU_VC1’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:108:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(VDPAU_VC1);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:47:41: error: ‘AV_PIX_FMT_VDPAU_MPEG4’ was not declared in this scope
#define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:128:5: note: in expansion of macro ‘TEST_PIX_FMT_RETURN’
TEST_PIX_FMT_RETURN(VDPAU_MPEG4);
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp: In function ‘AVStream* pangolin::CreateStream(AVFormatContext*, pangolin::CodecID, uint64_t, int, AVPixelFormat, int, int)’:
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:519:33: error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope
stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
^
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp: In member function ‘void pangolin::FfmpegVideoOutputStream::WriteFrame(AVFrame*)’:
/home/ota/src/Pangolin/src/video/drivers/ffmpeg.cpp:582:39: error: ‘AVFMT_RAWPICTURE’ was not declared in this scope
if (recorder.oc->oformat->flags & AVFMT_RAWPICTURE) {
^
src/CMakeFiles/pangolin.dir/build.make:1790: recipe for target 'src/CMakeFiles/pangolin.dir/video/drivers/ffmpeg.cpp.o' failed
make[2]: *** [src/CMakeFiles/pangolin.dir/video/drivers/ffmpeg.cpp.o] Error 1
CMakeFiles/Makefile2:135: recipe for target 'src/CMakeFiles/pangolin.dir/all' failed
make[1]: *** [src/CMakeFiles/pangolin.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

@norouzzadeh
Copy link

I have the same problem. +1

@stevenlovegrove
Copy link
Owner

Does this PR help? #318

@jj-tetraquark
Copy link

@stevenlovegrove That pull request worked for me :)

@NcJie
Copy link

NcJie commented May 4, 2018

@stevenlovegrove The PR is confirmed working with Mac OS X high sierra. Thanks!

@bringert
Copy link

#318 works for me too, on OS X 10.11. It would be great to have that merged to simplify building.

@Paul92
Copy link

Paul92 commented Jun 19, 2018

Can confirm that #318 works on Archlinux too

@stevenlovegrove
Copy link
Owner

I finally cherry-picked that PR here d9daba6

@visigoth
Copy link
Contributor

despite having commit d9daba62dfa3f6c786699723621b5ca4566206dd in my checkout (i tried building at v0.8 as well as master), i got this error building on my M1 mac. i have ffmpeg installed via homebrew. i looked inside libavutil's headers and the FF_API_* macros are there. for some reason, they are not #defined in the Pangolin build despite the cmake tests having found the support for them.

@stevenlovegrove
Copy link
Owner

@visigoth this same thing actually happened to me today too (on an m1 mac as well). I killed my build dir, upgraded my macports installation and it suddenly was fine, so I didn't look further into it, assuming something was out of date / out of sync.

@bjourne
Copy link

bjourne commented Aug 29, 2022

I'm also getting the same errors:

/home/bjourne/p/ElasticFusion/third-party/Pangolin/src/video/drivers/ffmpeg.cpp: In function 'std::string pangolin::FfmpegFmtToString(AVPixelFormat)':
/home/bjourne/p/ElasticFusion/third-party/Pangolin/src/video/drivers/ffmpeg.cpp:56:41: error: 'AV_PIX_FMT_XVMC_MPEG2_MC' was not declared in this scope
   56 | #  define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
      |                                         ^~~~~~~~~~~
/home/bjourne/p/ElasticFusion/third-party/Pangolin/src/video/drivers/ffmpeg.cpp:56:41: note: in definition of macro 'TEST_PIX_FMT_RETURN'
   56 | #  define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
      |                                         ^~~~~~~~~~~
/home/bjourne/p/ElasticFusion/third-party/Pangolin/src/video/drivers/ffmpeg.cpp:56:41: error: 'AV_PIX_FMT_XVMC_MPEG2_IDCT' was not declared in this scope
   56 | #  define TEST_PIX_FMT_RETURN(fmt) case AV_PIX_FMT_##fmt: return #fmt;
...

@Otterverse
Copy link

I just hit this now too. Pretty sure it's because XVMC is being removed from ffmpeg entirely.

https://www.phoronix.com/news/FFmpeg-Drops-XvMC

This fixes it for me (at least against 0.8.0)
sed -i '/FF_API_XVMC/,+3d' components/pango_video/include/pangolin/video/drivers/ffmpeg_common.h

@NikolausDemmel
Copy link
Contributor

This fixes it for me (at least against 0.8.0)

This also fixes the build for me on Intel Mac (Catalina) with up-to-date dependencies from Homebrew. Thanks!

I'm not sure I understand how this relates to older ffmpeg versions. Will this break things with older versions of ffmpeg? Otherwise, it would be great to get this merged.

NikolausDemmel added a commit to NikolausDemmel/Pangolin that referenced this issue Oct 12, 2022
@stevenlovegrove
Copy link
Owner

Thanks @Otterverse. @NikolausDemmel great, that looks easily mergeable - I can accept a PR with that if it is working for you.

NikolausDemmel added a commit to NikolausDemmel/Pangolin that referenced this issue Oct 12, 2022
Recent versions of ffmpeg lead to compilation errors. This commit
removes XVMC format parsing. It doesn't seem to be relevant these
days, see https://www.phoronix.com/news/FFmpeg-Drops-XvMC

Credit to [James Otting](https://github.com/Otterverse) for the fix
and link.
@NikolausDemmel
Copy link
Contributor

According to @Otterverse's reference above, it's unlikely anybody is using XVMC, so removing it from the format string should be ok. PR is up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests