Não é possível instalar o pacote python FFVideo

2

Estou tentando instalar o pacote FFVideo do pypi. Eu instalei todas as dependências listadas aqui: link Agora estou recebendo o seguinte erro.

$ pip install -U FFVideo
Collecting FFVideo
  Using cached https://files.pythonhosted.org/packages/00/88/1837ebf7d023f03ecfcad0d49e95102969c4d0f631efcc137f2611500770/FFVideo-0.0.13.tar.gz
Building wheels for collected packages: FFVideo
  Running setup.py bdist_wheel for FFVideo ... error
  Complete output from command /home/kuba/.local/share/virtualenvs/myproject-Wt0aku_V/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-wkJ7XB/FFVideo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-OmIzSN --python-tag cp27:
  running bdist_wheel
  running build
  running build_ext
  building 'ffvideo' extension
  creating build
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/ffvideo
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ffmpeg -I/home/kuba/.pyenv/versions/2.7.14/include/python2.7 -c ffvideo/ffvideo.c -o build/temp.linux-x86_64-2.7/ffvideo/ffvideo.o
  ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream___cinit__’:
  ffvideo/ffvideo.c:1581:25: warning: implicit declaration of function ‘avcodec_alloc_frame’; did you mean ‘avcodec_send_frame’? [-Wimplicit-function-declaration]
     __pyx_v_self->frame = avcodec_alloc_frame();
                           ^~~~~~~~~~~~~~~~~~~
                           avcodec_send_frame
  ffvideo/ffvideo.c:1581:23: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __pyx_v_self->frame = avcodec_alloc_frame();
                         ^
  ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_2__init__’:
  ffvideo/ffvideo.c:1886:5: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
       __pyx_t_3 = ((__pyx_v_self->format_ctx->streams[__pyx_v_i])->codec->codec_type == AVMEDIA_TYPE_VIDEO);
       ^~~~~~~~~
  In file included from ffvideo/ffvideo.c:259:0:
  /usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
       AVCodecContext *codec;
                       ^~~~~
  ffvideo/ffvideo.c:1998:3: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
     __pyx_t_10 = __pyx_v_self->stream->codec;
     ^~~~~~~~~~
  In file included from ffvideo/ffvideo.c:259:0:
  /usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
       AVCodecContext *codec;
                       ^~~~~
  ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_4__dealloc__’:
  ffvideo/ffvideo.c:2344:5: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
       av_free_packet((&__pyx_v_self->packet));
       ^~~~~~~~~~~~~~
  In file included from ffvideo/ffvideo.c:258:0:
  /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
   void av_free_packet(AVPacket *pkt);
        ^~~~~~~~~~~~~~
  ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_8__decode_next_frame’:
  ffvideo/ffvideo.c:2636:13: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
               __pyx_v_ret = avcodec_decode_video2(__pyx_v_self->codec_ctx, __pyx_v_self->frame, (&__pyx_v_frame_finished), (&__pyx_v_self->packet));
               ^~~~~~~~~~~
  In file included from ffvideo/ffvideo.c:258:0:
  /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4993:5: note: declared here
   int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
       ^~~~~~~~~~~~~~~~~~~~~
  ffvideo/ffvideo.c:2668:9: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
           av_free_packet((&__pyx_v_self->packet));
           ^~~~~~~~~~~~~~
  In file included from ffvideo/ffvideo.c:258:0:
  /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
   void av_free_packet(AVPacket *pkt);
        ^~~~~~~~~~~~~~
  ffvideo/ffvideo.c:2742:5: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
       av_free_packet((&__pyx_v_self->packet));
       ^~~~~~~~~~~~~~
  In file included from ffvideo/ffvideo.c:258:0:
  /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
   void av_free_packet(AVPacket *pkt);
        ^~~~~~~~~~~~~~
  ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_12current’:
  ffvideo/ffvideo.c:2989:24: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __pyx_v_scaled_frame = avcodec_alloc_frame();
                          ^
  ffvideo/ffvideo.c:3024:3: warning: ‘avpicture_get_size’ is deprecated [-Wdeprecated-declarations]
     __pyx_v_buflen = avpicture_get_size(__pyx_v_self->ffmpeg_frame_mode, __pyx_v_self->frame_width, __pyx_v_self->frame_height);
     ^~~~~~~~~~~~~~
  In file included from ffvideo/ffvideo.c:258:0:
  /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5653:5: note: declared here
   int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
       ^~~~~~~~~~~~~~~~~~
  ffvideo/ffvideo.c:3045:51: warning: passing argument 2 of ‘PyObject_AsCharBuffer’ from incompatible pointer type [-Wincompatible-pointer-types]
     __pyx_t_3 = PyObject_AsCharBuffer(__pyx_v_data, (&__pyx_v_data_ptr), (&__pyx_v_buflen)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                     ^
  In file included from /home/kuba/.pyenv/versions/2.7.14/include/python2.7/Python.h:133:0,
                   from ffvideo/ffvideo.c:4:
  /home/kuba/.pyenv/versions/2.7.14/include/python2.7/abstract.h:476:22: note: expected ‘const char **’ but argument is of type ‘char **’
        PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
                        ^~~~~~~~~~~~~~~~~~~~~
  ffvideo/ffvideo.c:3068:9: warning: ‘avpicture_fill’ is deprecated [-Wdeprecated-declarations]
           avpicture_fill(((struct AVPicture *)__pyx_v_scaled_frame), ((__pyx_t_6ffmpeg_uint8_t *)__pyx_v_data_ptr), __pyx_v_self->ffmpeg_frame_mode, __pyx_v_self->frame_width, __pyx_v_self->frame_height);
           ^~~~~~~~~~~~~~
  In file included from ffvideo/ffvideo.c:258:0:
  /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5638:5: note: declared here
   int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
       ^~~~~~~~~~~~~~
  ffvideo/ffvideo.c:3086:44: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type [-Wincompatible-pointer-types]
           sws_scale(__pyx_v_img_convert_ctx, __pyx_v_self->frame->data, __pyx_v_self->frame->linesize, 0, __pyx_v_self->height, __pyx_v_scaled_frame->data, __pyx_v_scaled_frame->linesize);
                                              ^~~~~~~~~~~~
  In file included from ffvideo/ffvideo.c:261:0:
  /usr/include/x86_64-linux-gnu/libswscale/swscale.h:217:5: note: expected ‘const uint8_t * const* {aka const unsigned char * const*}’ but argument is of type ‘uint8_t ** {aka unsigned char **}’
   int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
       ^~~~~~~~~
  ffvideo/ffvideo.c: In function ‘initffvideo’:
  ffvideo/ffvideo.c:6432:30: error: ‘PIX_FMT_RGB24’ undeclared (first use in this function); did you mean ‘AV_PIX_FMT_RGB24’?
     __pyx_t_2 = PyInt_FromLong(PIX_FMT_RGB24); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                ^~~~~~~~~~~~~
                                AV_PIX_FMT_RGB24
  ffvideo/ffvideo.c:6432:30: note: each undeclared identifier is reported only once for each function it appears in
  ffvideo/ffvideo.c:6444:30: error: ‘PIX_FMT_GRAY8’ undeclared (first use in this function); did you mean ‘AV_PIX_FMT_GRAY8’?
     __pyx_t_2 = PyInt_FromLong(PIX_FMT_GRAY8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                ^~~~~~~~~~~~~
                                AV_PIX_FMT_GRAY8
  ffvideo/ffvideo.c:6456:30: error: ‘PIX_FMT_YUV420P’ undeclared (first use in this function); did you mean ‘AV_PIX_FMT_YUV420P’?
     __pyx_t_2 = PyInt_FromLong(PIX_FMT_YUV420P); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                ^~~~~~~~~~~~~~~
                                AV_PIX_FMT_YUV420P
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for FFVideo
  Running setup.py clean for FFVideo
Failed to build FFVideo
Installing collected packages: FFVideo
  Running setup.py install for FFVideo ... error
    Complete output from command /home/kuba/.local/share/virtualenvs/myproject-Wt0aku_V/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-wkJ7XB/FFVideo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6GrcYv/install-record.txt --single-version-externally-managed --compile --install-headers /home/kuba/.local/share/virtualenvs/myproject-Wt0aku_V/include/site/python2.7/FFVideo:
    running install
    running build
    running build_ext
    building 'ffvideo' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/ffvideo
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ffmpeg -I/home/kuba/.pyenv/versions/2.7.14/include/python2.7 -c ffvideo/ffvideo.c -o build/temp.linux-x86_64-2.7/ffvideo/ffvideo.o
    ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream___cinit__’:
    ffvideo/ffvideo.c:1581:25: warning: implicit declaration of function ‘avcodec_alloc_frame’; did you mean ‘avcodec_send_frame’? [-Wimplicit-function-declaration]
       __pyx_v_self->frame = avcodec_alloc_frame();
                             ^~~~~~~~~~~~~~~~~~~
                             avcodec_send_frame
    ffvideo/ffvideo.c:1581:23: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
       __pyx_v_self->frame = avcodec_alloc_frame();
                           ^
    ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_2__init__’:
    ffvideo/ffvideo.c:1886:5: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
         __pyx_t_3 = ((__pyx_v_self->format_ctx->streams[__pyx_v_i])->codec->codec_type == AVMEDIA_TYPE_VIDEO);
         ^~~~~~~~~
    In file included from ffvideo/ffvideo.c:259:0:
    /usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^~~~~
    ffvideo/ffvideo.c:1998:3: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
       __pyx_t_10 = __pyx_v_self->stream->codec;
       ^~~~~~~~~~
    In file included from ffvideo/ffvideo.c:259:0:
    /usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^~~~~
    ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_4__dealloc__’:
    ffvideo/ffvideo.c:2344:5: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
         av_free_packet((&__pyx_v_self->packet));
         ^~~~~~~~~~~~~~
    In file included from ffvideo/ffvideo.c:258:0:
    /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
     void av_free_packet(AVPacket *pkt);
          ^~~~~~~~~~~~~~
    ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_8__decode_next_frame’:
    ffvideo/ffvideo.c:2636:13: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
                 __pyx_v_ret = avcodec_decode_video2(__pyx_v_self->codec_ctx, __pyx_v_self->frame, (&__pyx_v_frame_finished), (&__pyx_v_self->packet));
                 ^~~~~~~~~~~
    In file included from ffvideo/ffvideo.c:258:0:
    /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4993:5: note: declared here
     int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
         ^~~~~~~~~~~~~~~~~~~~~
    ffvideo/ffvideo.c:2668:9: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
             av_free_packet((&__pyx_v_self->packet));
             ^~~~~~~~~~~~~~
    In file included from ffvideo/ffvideo.c:258:0:
    /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
     void av_free_packet(AVPacket *pkt);
          ^~~~~~~~~~~~~~
    ffvideo/ffvideo.c:2742:5: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
         av_free_packet((&__pyx_v_self->packet));
         ^~~~~~~~~~~~~~
    In file included from ffvideo/ffvideo.c:258:0:
    /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
     void av_free_packet(AVPacket *pkt);
          ^~~~~~~~~~~~~~
    ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_12current’:
    ffvideo/ffvideo.c:2989:24: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
       __pyx_v_scaled_frame = avcodec_alloc_frame();
                            ^
    ffvideo/ffvideo.c:3024:3: warning: ‘avpicture_get_size’ is deprecated [-Wdeprecated-declarations]
       __pyx_v_buflen = avpicture_get_size(__pyx_v_self->ffmpeg_frame_mode, __pyx_v_self->frame_width, __pyx_v_self->frame_height);
       ^~~~~~~~~~~~~~
    In file included from ffvideo/ffvideo.c:258:0:
    /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5653:5: note: declared here
     int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
         ^~~~~~~~~~~~~~~~~~
    ffvideo/ffvideo.c:3045:51: warning: passing argument 2 of ‘PyObject_AsCharBuffer’ from incompatible pointer type [-Wincompatible-pointer-types]
       __pyx_t_3 = PyObject_AsCharBuffer(__pyx_v_data, (&__pyx_v_data_ptr), (&__pyx_v_buflen)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                       ^
    In file included from /home/kuba/.pyenv/versions/2.7.14/include/python2.7/Python.h:133:0,
                     from ffvideo/ffvideo.c:4:
    /home/kuba/.pyenv/versions/2.7.14/include/python2.7/abstract.h:476:22: note: expected ‘const char **’ but argument is of type ‘char **’
          PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
                          ^~~~~~~~~~~~~~~~~~~~~
    ffvideo/ffvideo.c:3068:9: warning: ‘avpicture_fill’ is deprecated [-Wdeprecated-declarations]
             avpicture_fill(((struct AVPicture *)__pyx_v_scaled_frame), ((__pyx_t_6ffmpeg_uint8_t *)__pyx_v_data_ptr), __pyx_v_self->ffmpeg_frame_mode, __pyx_v_self->frame_width, __pyx_v_self->frame_height);
             ^~~~~~~~~~~~~~
    In file included from ffvideo/ffvideo.c:258:0:
    /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5638:5: note: declared here
     int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
         ^~~~~~~~~~~~~~
    ffvideo/ffvideo.c:3086:44: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type [-Wincompatible-pointer-types]
             sws_scale(__pyx_v_img_convert_ctx, __pyx_v_self->frame->data, __pyx_v_self->frame->linesize, 0, __pyx_v_self->height, __pyx_v_scaled_frame->data, __pyx_v_scaled_frame->linesize);
                                                ^~~~~~~~~~~~
    In file included from ffvideo/ffvideo.c:261:0:
    /usr/include/x86_64-linux-gnu/libswscale/swscale.h:217:5: note: expected ‘const uint8_t * const* {aka const unsigned char * const*}’ but argument is of type ‘uint8_t ** {aka unsigned char **}’
     int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
         ^~~~~~~~~
    ffvideo/ffvideo.c: In function ‘initffvideo’:
    ffvideo/ffvideo.c:6432:30: error: ‘PIX_FMT_RGB24’ undeclared (first use in this function); did you mean ‘AV_PIX_FMT_RGB24’?
       __pyx_t_2 = PyInt_FromLong(PIX_FMT_RGB24); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                  ^~~~~~~~~~~~~
                                  AV_PIX_FMT_RGB24
    ffvideo/ffvideo.c:6432:30: note: each undeclared identifier is reported only once for each function it appears in
    ffvideo/ffvideo.c:6444:30: error: ‘PIX_FMT_GRAY8’ undeclared (first use in this function); did you mean ‘AV_PIX_FMT_GRAY8’?
       __pyx_t_2 = PyInt_FromLong(PIX_FMT_GRAY8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                  ^~~~~~~~~~~~~
                                  AV_PIX_FMT_GRAY8
    ffvideo/ffvideo.c:6456:30: error: ‘PIX_FMT_YUV420P’ undeclared (first use in this function); did you mean ‘AV_PIX_FMT_YUV420P’?
       __pyx_t_2 = PyInt_FromLong(PIX_FMT_YUV420P); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                  ^~~~~~~~~~~~~~~
                                  AV_PIX_FMT_YUV420P
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/kuba/.local/share/virtualenvs/myproject-Wt0aku_V/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-wkJ7XB/FFVideo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6GrcYv/install-record.txt --single-version-externally-managed --compile --install-headers /home/kuba/.local/share/virtualenvs/myproject-Wt0aku_V/include/site/python2.7/FFVideo" failed with error code 1 in /tmp/pip-install-wkJ7XB/FFVideo/

Encontrei isto: link

Mas não consigo instalar uma versão antiga do ffmpeg (atualmente 3.4.2-2). Eu estou no Ubuntu 18.04

    
por Quba 09.05.2018 / 14:37

2 respostas

2

Você pode tentar algo assim, que parece instalar e importar sem erros.

#download FFVideo without installing
pip download FFVideo

#unpack tar file
tar -xvf FFVideo-0.0.13.tar.gz

#replace deprecated references
sed -i -e 's/avcodec_alloc_frame/av_frame_alloc/g' FFVideo-0.0.13/ffvideo/ffvideo.c

sed -i -e 's/PIX_FMT_RGB24/AV_PIX_FMT_RGB24/g' FFVideo-0.0.13/ffvideo/ffvideo.c

sed -i -e 's/PIX_FMT_GRAY8/AV_PIX_FMT_GRAY8/g' FFVideo-0.0.13/ffvideo/ffvideo.c

sed -i -e 's/PIX_FMT_YUV420P/AV_PIX_FMT_YUV420P/g' FFVideo-0.0.13/ffvideo/ffvideo.c

#pack it
tar -zcvf FFVideo-0.0.13.tar.gz FFVideo-0.0.13

#install
pip install --upgrade FFVideo-0.0.13.tar.gz
    
por jackw11111 11.05.2018 / 02:28
0

Primeiro baixe o ffvideo usando pip

pip download ffvideo
tar -xf FFVideo-0.0.13.tar.gz

cd FFVideo-0.0.13
python setup.py install
    
por satya 20.06.2018 / 13:52

Tags