Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

livecam didn't compile

Help
ludo
2007-08-20
2013-03-08
  • ludo
    ludo
    2007-08-20

    Hi

    I trie to compile livecam from the svn sources.
    In first step i change the mpegencoder.h :

    "#include <avcodec.h>" ==> "#include </usr/include/ffmpeg/avcodec.h>"

    I'm not sure it's good way but i'haven't another 'avcodec.h' in my system....

    now make give me this output :

    *********************************************************
    make  all-am
    make[1]: Entering directory `/home/ludo/Documents/Utils/webcam/livecam/trunk'
    if g++ -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL  -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -D_REENTRANT -I/usr/lib/qt3//include  -I/home/ilyes/local/include/ffmpeg -MT mpegencoder.o -MD -MP -MF ".deps/mpegencoder.Tpo" -c -o mpegencoder.o mpegencoder.cpp; \         then mv -f ".deps/mpegencoder.Tpo" ".deps/mpegencoder.Po"; else rm -f ".deps/mpegencoder.Tpo"; exit 1; fi
    /usr/include/ffmpeg/avcodec.h:2233: warning: ‘ImgReSampleContext’ is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2227)
    /usr/include/ffmpeg/avcodec.h:2243: warning: ‘ImgReSampleContext’ is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2227)
    mpegencoder.cpp: In member function ‘virtual int MPEGEncoder::Start(char*, v4l2_pix_format*)’:
    mpegencoder.cpp:53: error: ‘mpeg1video_encoder’ was not declared in this scope
    make[1]: *** [mpegencoder.o] Error 1
    make[1]: Leaving directory `/home/ludo/Documents/Utils/webcam/livecam/trunk'
    make: *** [all] Error 2
    ***********************************************************

    I hoppe you can help me with this info.
    Excuse my very bad english...

    Thanks

     
    • Sid Boyce
      Sid Boyce
      2008-01-31

      Same problem here. I upgraded to latest ffmpeg svn, no change.
      Snippet from /usr/include/ffmpeg/avcodec.h

      typedef struct ImgReSampleContext ImgReSampleContext attribute_deprecated;

      /**
      * @deprecated Use the software scaler (swscale) instead.
      */
      attribute_deprecated ImgReSampleContext *img_resample_init(int output_width, int output_height,
                                            int input_width, int input_height);

      /**
      * @deprecated Use the software scaler (swscale) instead.
      */
      attribute_deprecated ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
                                            int iwidth, int iheight,
                                            int topBand, int bottomBand,
                                            int leftBand, int rightBand,
                                            int padtop, int padbottom,
                                            int padleft, int padright);

      /**
      * @deprecated Use the software scaler (swscale) instead.
      */
      attribute_deprecated void img_resample(struct ImgReSampleContext *s,
                        AVPicture *output, const AVPicture *input);

      /**
      * @deprecated Use the software scaler (swscale) instead.
      */
      attribute_deprecated void img_resample_close(struct ImgReSampleContext *s);

      #endif

      Tried substituting <swscale.h> instead of <avcodec.h>, got errors there also.
      # make
      make  all-am
      make[1]: Entering directory `/ftp/jan08/LIVECAM/livecam/trunk'
      g++ -DHAVE_CONFIG_H -I.     -g -O2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL   -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -D_REENTRANT -I/usr/lib/qt3//include  -I/usr/include/ffmpeg -MT mpegencoder.o -MD -MP -MF .deps/mpegencoder.Tpo -c -o mpegencoder.o mpegencoder.cpp
      In file included from mpegencoder.cpp:28:
      mpegencoder.h:48: error: ISO C++ forbids declaration of ‘AVCodec’ with no type
      mpegencoder.h:48: error: expected ‘;’ before ‘*’ token
      mpegencoder.h:49: error: ISO C++ forbids declaration of ‘AVCodecContext’ with no type
      mpegencoder.h:49: error: expected ‘;’ before ‘*’ token
      mpegencoder.h:53: error: ISO C++ forbids declaration of ‘AVFrame’ with no type
      mpegencoder.h:53: error: expected ‘;’ before ‘*’ token
      mpegencoder.cpp: In constructor ‘MPEGEncoder::MPEGEncoder()’:
      mpegencoder.cpp:39: error: ‘m_MPEGCodec’ was not declared in this scope
      mpegencoder.cpp:40: error: ‘m_Ctx’ was not declared in this scope
      mpegencoder.cpp:41: error: ‘m_Picture’ was not declared in this scope
      mpegencoder.cpp:44: error: ‘avcodec_init’ was not declared in this scope
      mpegencoder.cpp: In member function ‘virtual int MPEGEncoder::Start(char*, v4l2_pix_format*)’:
      mpegencoder.cpp:53: error: ‘m_MPEGCodec’ was not declared in this scope
      mpegencoder.cpp:53: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope
      mpegencoder.cpp:53: error: ‘avcodec_find_encoder’ was not declared in this scope
      mpegencoder.cpp:70: error: ‘m_Ctx’ was not declared in this scope
      mpegencoder.cpp:70: error: ‘avcodec_alloc_context’ was not declared in this scope
      mpegencoder.cpp:73: error: ‘m_Picture’ was not declared in this scope
      mpegencoder.cpp:73: error: ‘avcodec_alloc_frame’ was not declared in this scope
      mpegencoder.cpp:86: error: ‘avcodec_open’ was not declared in this scope
      mpegencoder.cpp:93: error: jump to label ‘error’
      mpegencoder.cpp:74: error:   from here
      mpegencoder.cpp:81: error:   crosses initialization of ‘AVRational <anonymous>’
      mpegencoder.cpp:93: error: jump to label ‘error’
      mpegencoder.cpp:71: error:   from here
      mpegencoder.cpp:81: error:   crosses initialization of ‘AVRational <anonymous>’
      mpegencoder.cpp:94: error: ‘avcodec_close’ was not declared in this scope
      mpegencoder.cpp: In member function ‘virtual void MPEGEncoder::Encode(unsigned char*)’:
      mpegencoder.cpp:105: error: ‘m_Picture’ was not declared in this scope
      mpegencoder.cpp:121: error: ‘m_Ctx’ was not declared in this scope
      mpegencoder.cpp:127: error: ‘avcodec_encode_video’ was not declared in this scope
      mpegencoder.cpp: In member function ‘virtual void MPEGEncoder::Stop()’:
      mpegencoder.cpp:138: error: ‘m_Ctx’ was not declared in this scope
      mpegencoder.cpp:138: error: ‘avcodec_encode_video’ was not declared in this scope
      mpegencoder.cpp:153: error: ‘m_Ctx’ was not declared in this scope
      mpegencoder.cpp:153: error: ‘avcodec_close’ was not declared in this scope
      mpegencoder.cpp:154: error: ‘m_Ctx’ was not declared in this scope
      mpegencoder.cpp:156: error: ‘m_Picture’ was not declared in this scope
      mpegencoder.cpp:157: error: ‘m_Picture’ was not declared in this scope
      mpegencoder.cpp: In member function ‘void MPEGEncoder::ConvertRGB24ToYU12(unsigned char*)’:
      mpegencoder.cpp:162: error: ‘m_Ctx’ was not declared in this scope
      mpegencoder.cpp: In member function ‘void MPEGEncoder::ConvertRGB32ToYU12(unsigned char*)’:
      mpegencoder.cpp:186: error: ‘m_Ctx’ was not declared in this scope
      make[1]: *** [mpegencoder.o] Error 1
      make[1]: Leaving directory `/ftp/jan08/LIVECAM/livecam/trunk'
      make: *** [all] Error 2