Board index FlightGear Support Compiling

osgdb_ffmpeg

Building FlightGear from source, and in the need for help?

osgdb_ffmpeg

Postby gcb » Sun Feb 17, 2019 9:47 pm

I had build 2017.x branches only. Today I tried a clean build of the superbuild following the wiki http://wiki.flightgear.org/Superbuild

I am trying to build the next branch (not exactly sure if that is stable or not) but that is what the wiki says


Code: Select all
Scanning dependencies of target osgdb_ffmpeg
[ 85%] Building CXX object src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegClocks.o
[ 85%] Building CXX object src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderAudio.o
[ 86%] Building CXX object src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoder.o
[ 86%] Building CXX object src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderVideo.o
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function 'void osgFFmpeg::FFmpegDecoderVideo::open(AVStream*)':
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:74:46: error: 'PIX_FMT_YUVA420P' was not declared in this scope
     m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P);
                                              ^~~~~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:74:46: note: suggested alternative: 'AV_PIX_FMT_YUVA420P'
     m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P);
                                              ^~~~~~~~~~~~~~~~
                                              AV_PIX_FMT_YUVA420P
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:98:19: error: 'avcodec_alloc_frame' was not declared in this scope
     m_frame.reset(avcodec_alloc_frame());
                   ^~~~~~~~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:98:19: note: suggested alternative: 'avcodec_send_frame'
     m_frame.reset(avcodec_alloc_frame());
                   ^~~~~~~~~~~~~~~~~~~
                   avcodec_send_frame
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:102:48: error: 'PIX_FMT_RGB24' was not declared in this scope
     m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height()));
                                                ^~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:102:48: note: suggested alternative: 'AV_PIX_FMT_RGB24'
     m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height()));
                                                ^~~~~~~~~~~~~
                                                AV_PIX_FMT_RGB24
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:110:16: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'get_buffer'; did you mean 'get_buffer2'?
     m_context->get_buffer = getBuffer;
                ^~~~~~~~~~
                get_buffer2
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:111:16: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'release_buffer'; did you mean 'get_buffer2'?
     m_context->release_buffer = releaseBuffer;
                ^~~~~~~~~~~~~~
                get_buffer2
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function 'int osgFFmpeg::FFmpegDecoderVideo::convert(AVPicture*, int, AVPicture*, int, int, int)':
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:270:64: error: 'PixelFormat' was not declared in this scope
         m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt,
                                                                ^~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:270:64: note: suggested alternative: 'AVPixelFormat'
         m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt,
                                                                ^~~~~~~~~~~
                                                                AVPixelFormat
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function 'void osgFFmpeg::FFmpegDecoderVideo::publishFrame(double, bool)':
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:318:92: error: 'PIX_FMT_RGB24' was not declared in this scope
     avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height());
                                                                                            ^~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:318:92: note: suggested alternative: 'AV_PIX_FMT_RGB24'
     avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height());
                                                                                            ^~~~~~~~~~~~~
                                                                                            AV_PIX_FMT_RGB24
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:322:31: error: 'PIX_FMT_YUVA420P' was not declared in this scope
     if (m_context->pix_fmt == PIX_FMT_YUVA420P)
                               ^~~~~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:322:31: note: suggested alternative: 'AV_PIX_FMT_YUVA420P'
     if (m_context->pix_fmt == PIX_FMT_YUVA420P)
                               ^~~~~~~~~~~~~~~~
                               AV_PIX_FMT_YUVA420P
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function 'void osgFFmpeg::FFmpegDecoderVideo::yuva420pToRgba(AVPicture*, AVPicture*, int, int)':
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:352:18: error: 'PIX_FMT_RGB24' was not declared in this scope
     convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
                  ^~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:352:18: note: suggested alternative: 'AV_PIX_FMT_RGB24'
     convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
                  ^~~~~~~~~~~~~
                  AV_PIX_FMT_RGB24
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In static member function 'static int osgFFmpeg::FFmpegDecoderVideo::getBuffer(AVCodecContext*, AVFrame*)':
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:376:24: error: 'avcodec_default_get_buffer' was not declared in this scope
     const int result = avcodec_default_get_buffer(context, picture);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:376:24: note: suggested alternative: 'avcodec_default_get_buffer2'
     const int result = avcodec_default_get_buffer(context, picture);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
                        avcodec_default_get_buffer2
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In static member function 'static void osgFFmpeg::FFmpegDecoderVideo::releaseBuffer(AVCodecContext*, AVFrame*)':
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:392:5: error: 'avcodec_default_release_buffer' was not declared in this scope
     avcodec_default_release_buffer(context, picture);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gcb/code/flightgear/superbuild/build/src/OSG/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:392:5: note: suggested alternative: 'avcodec_default_get_buffer2'
     avcodec_default_release_buffer(context, picture);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     avcodec_default_get_buffer2
make[5]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/build.make:102: src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderVideo.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:6246: src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
[ 86%] Building CXX object src/osgWrappers/deprecated-dotosg/osgVolume/CMakeFiles/osgdb_deprecated_osgvolume.dir/VolumeTile.o
[ 86%] Linking CXX shared module ../../../../lib/osgPlugins-3.2.3/osgdb_deprecated_osgvolume.so
[ 86%] Built target osgdb_deprecated_osgvolume
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/OSG.dir/build.make:112: src/OSG-stamp/OSG-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/OSG.dir/all] Error 2
make: *** [Makefile:84: all] Error 2


If this is not easy to understand/fix, is there a way to disable video decoding? i do not plan to need it at all.

appreciate any help. thanks!
gcb
 
Posts: 7
Joined: Thu May 31, 2018 1:37 am

Re: osgdb_ffmpeg

Postby wkitty42 » Sun Feb 17, 2019 11:50 pm

1. that's Open Scene Graph (aka OSG)... you'd have to ask them how to disable parts...

2. the problem looks like a code defect... in other words, a compilation bug they have to fix in that version...

3. what version of OSG are you trying to build? i build 3.4.2 over here on linux with no problems...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5557
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: osgdb_ffmpeg

Postby gcb » Mon Feb 18, 2019 1:03 am

> what version of OSG are you trying to build

good question :)

I am following the SuperBuild wiki instructions. I just run cmake/make and things happen :roll:

I am trying to backtrack everything... but it doesn't look like it fetch a tarball nor checkout a git repo... so i just have a dir with a bunch of source files with no idea about the origin or version without finding the actual step that downloaded them.

anyone have any pointers while i go about it here?

edit:
`grep -i osg .gitmodules` shows nothing.

edit2:
found this:

flightgear-fgmeta/CMakeLists.txt
Code: Select all
# OpenSceneGraph configuration
#set(OSG_SOURCE http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip)
set(OSG_SOURCE https://github.com/openscenegraph/osg.git)
set(OSG_TAG OpenSceneGraph-3.2)
gcb
 
Posts: 7
Joined: Thu May 31, 2018 1:37 am

Re: osgdb_ffmpeg

Postby gcb » Mon Feb 18, 2019 1:11 am

tried blindly changing the tag to 3.4 since there is a 3.4 tag on that repo. Not much experience with qmake. let's see.
gcb
 
Posts: 7
Joined: Thu May 31, 2018 1:37 am

Re: osgdb_ffmpeg

Postby gcb » Mon Feb 18, 2019 4:10 am

thanks, the newer version made things better. now i got a (hopefully) silly error on the install step (still for osg)

Code: Select all
-- Set runtime path of "/home/gcb/code/flightgear/superbuild/flightgear-fgmeta/install/bin/present3D" to ""
[ 45%] Performing after_install step for 'OSG'
failed to create symbolic link '/home/gcb/code/flightgear/superbuild/flightgear-fgmeta/install/lib' because existing path cannot be removed: Is a directory
make[2]: *** [CMakeFiles/OSG.dir/build.make:117: src/OSG-stamp/OSG-after_install] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/OSG.dir/all] Error 2
make: *** [Makefile:84: all] Error 2


already run the build a second time, removing that directory, to make sure it was not the state i had before. something bogus with the build for sure. will debug later on today.

thanks again!

PS: should i send a PR to the meta repo to update the osg lib?
gcb
 
Posts: 7
Joined: Thu May 31, 2018 1:37 am

Re: osgdb_ffmpeg

Postby wkitty42 » Mon Feb 18, 2019 5:16 pm

i don't know what repo that would be... i use the download_and_compile.sh script instead of the "super build" stuff... dnc was what i found first when i decided to build my own and i've been using it (with some modifications) since i found the project and joined the forums... two more days will mark 4 years for me :)

but yes, it would be worthwhile to let the super build folks know that they need to fix the OSG stuff to use 3.4 instead of 3.2... there's also likely going to be a move to 3.6 in the "near future" once some more bugs are worked out with the integration of it...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5557
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5


Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests