OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Disable FFMpeg while building OSG?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build]
View previous topic :: View next topic  
Author Message
jiapei100
Newbie


Joined: 30 Sep 2016
Posts: 1

PostPosted: Fri Jan 06, 2017 11:36 pm    Post subject:
Disable FFMpeg while building OSG?
Reply with quote

Hi,

Trying to build OSG from source, under Ubuntu 16.04.1, with GCC/G++ 5.4.0. It seems there is NO Option for FFMPEG (Enable or NOT), but it automatically look for FFMPEG related directories by default, and found the following:


Code:
                                                                                                                         
 FFMPEG_LIBAVCODEC_INCLUDE_DIRS   /usr/local/include                                                                                                                                   
 FFMPEG_LIBAVCODEC_LIBRARIES      /usr/local/lib/libavcodec.so                                                                                                                         
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR   /usr/local/include                                                                                                                                   
 FFMPEG_LIBAVDEVICE_LIBRARIES     /usr/local/lib/libavdevice.so                                                                                                                         
 FFMPEG_LIBAVFORMAT_INCLUDE_DIR   /usr/local/include                                                                                                                                   
 FFMPEG_LIBAVFORMAT_LIBRARIES     /usr/local/lib/libavformat.so                                                                                                                         
 FFMPEG_LIBAVUTIL_INCLUDE_DIRS    /usr/local/include                                                                                                                                   
 FFMPEG_LIBAVUTIL_LIBRARIES       /usr/local/lib/libavutil.so                                                                                                                           
 FFMPEG_LIBSWSCALE_INCLUDE_DIRS   /usr/local/include                                                                                                                                   
 FFMPEG_LIBSWSCALE_LIBRARIES      /usr/local/lib/libswscale.so


And, what I got later on is the following ERROR messages:

Code:

....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function ‘void osgFFmpeg::FFmpegDecoderVideo::open(AVStream*)’:
....../OpenSceneGraph/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);
                                              ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:98:39: error: ‘avcodec_alloc_frame’ was not declared in this scope
     m_frame.reset(avcodec_alloc_frame());
                                       ^
....../OpenSceneGraph/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()));
                                                ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:110:28: error: invalid conversion from ‘int (*)(AVCodecContext*, AVFrame*)’ to ‘int (*)(AVCodecContext*, AVFrame*, int)’ [-fpermissive]
     m_context->get_buffer2 = getBuffer;
                            ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:111:16: error: ‘AVCodecContext {aka struct AVCodecContext}’ has no member named ‘release_buffer’
     m_context->release_buffer = releaseBuffer;
                ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function ‘int osgFFmpeg::FFmpegDecoderVideo::convert(AVPicture*, int, AVPicture*, int, int, int)’:
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:270:64: error: ‘PixelFormat2’ was not declared in this scope
         m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat2) src_pix_fmt,
                                                                ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:271:77: error: expected ‘)’ before ‘dst_pix_fmt’
                                       src_width, src_height, (PixelFormat2) dst_pix_fmt,
                                                                             ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function ‘void osgFFmpeg::FFmpegDecoderVideo::publishFrame(double, bool)’:
....../OpenSceneGraph/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());
                                                                                            ^
....../OpenSceneGraph/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)
                               ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In member function ‘void osgFFmpeg::FFmpegDecoderVideo::yuva420pToRgba(AVPicture*, AVPicture*, int, int)’:
....../OpenSceneGraph/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);
                  ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In static member function ‘static int osgFFmpeg::FFmpegDecoderVideo::getBuffer(AVCodecContext*, AVFrame*)’:
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:376:68: error: too few arguments to function ‘int avcodec_default_get_buffer2(AVCodecContext*, AVFrame*, int)’
     const int result = avcodec_default_get_buffer2(context, picture);
                                                                    ^
In file included from ....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp:11:0,
                 from ....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp:6,
                 from ....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:1:
/usr/local/include/libavcodec/avcodec.h:4669:5: note: declared here
 int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
     ^
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp: In static member function ‘static void osgFFmpeg::FFmpegDecoderVideo::releaseBuffer(AVCodecContext*, AVFrame*)’:
....../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp:392:52: error: ‘avcodec_default_release_buffer’ was not declared in this scope
     avcodec_default_release_buffer(context, picture);
                                                    ^



So, my questions:

    Is there a way to DISABLE FFMPEG while building OSG?


    if FFMPEG MUST be ENABLED by default, any way to make current OSG compatible with current FFMPEG release 3.2.2 ?



Thank you!

Cheers,
Pei
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Sat Jan 07, 2017 10:26 am    Post subject:
Disable FFMpeg while building OSG?
Reply with quote

Hi Pei,

You can disable the build by just setting one the include vars to empty:

cmake . -DFFMPEG_LIBAVCODEC_INCLUDE_DIRS=""
make

W.r.t ffmpeg API, it's constantly changing and breaking backwards
compatibility, it's the single worst offender of all the 3rd party
dependencies that we use, even worse the what Apple do. We keep do
keep updating our plugin to track what's happening with ffmpeg but
this can't retrospectively fix already released stable releases. In
your case you could try OSG git master to see if it builds against the
ffmpeg version you have installed.

I've got Kubuntu 16.04 on my system with the ffmpeg that comes with it
and it builds fine with the OSG-3.2, 3.4 and master branches:

Quote:
ffmpeg
ffmpeg version 2.8.8-0ubuntu0.16.04.1 Copyright (c) 2000-2016 the
FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1
--build-suffix=-ffmpeg --toolchain=hardened
--libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl
--enable-shared --disable-stripping --disable-decoder=libopenjpeg
--disable-decoder=libschroedinger --enable-avresample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
--enable-libflite --enable-libfontconfig --enable-libfreetype
--enable-libfribidi --enable-libgme --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
--enable-libopus --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid
--enable-libzvbi --enable-openal --enable-opengl --enable-x11grab
--enable-libdc1394 --enable-libiec61883 --enable-libzmq
--enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100


When ffmpeg moves the goal posts yet again the only thing we can do is
rely upon members of the community that wish to use this most recent
ffmpeg releases to port the OSG's plugin across and provide these
revisions. These changes have to respect the fact that the community
use the OSG across a wide range of platforms and versions of ffmpeg so
we have to try and straddle compatibility otherwise we ended breaking
the build for open set of users to fix it for a another set.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Building Nvidia Texture Tools plugin ... hbucher Build system [build] 2 Thu Dec 07, 2017 11:21 pm View latest post
No new posts People currently using the ffmpeg/lib... Chris Hanson General 7 Fri Nov 03, 2017 4:08 pm View latest post
No new posts Disable/Enable default keyevent petertohen General 0 Mon Oct 09, 2017 2:45 am View latest post
No new posts Multiple video textures using ffmpeg ... mmaurus Plugins [osgPlugins] 6 Thu Oct 05, 2017 10:02 am View latest post
No new posts Disable rendering to screen wernerM General 0 Fri Apr 28, 2017 1:13 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP