Running python3.6 container with Docker
Trying "pip install ffvideo" and catching "error: command 'gcc' failed with exit status 1"
Can't really figure out where thr problem is
This is full error text:
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 /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-41uj66w6/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-wvqez2vw-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'ffvideo' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/ffvideo
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/ffmpeg -I/usr/local/include/python3.6m -c ffvideo/ffvideo.c -o build/temp.linux-x86_64-3.6/ffvideo/ffvideo.o
ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream___cinit__’:
ffvideo/ffvideo.c:1581:3: warning: ‘avcodec_alloc_frame’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3211) [-Wdeprecated-declarations]
__pyx_v_self->frame = avcodec_alloc_frame();
^
ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_2__init__’:
ffvideo/ffvideo.c:1946:56: error: ‘struct AVStream’ has no member named ‘r_frame_rate’
__pyx_v_self->framerate = av_q2d(__pyx_v_self->stream->r_frame_rate);
^
ffvideo/ffvideo.c:1957:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
__pyx_t_8 = (__pyx_v_self->stream->duration == AV_NOPTS_VALUE);
^
ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_8__decode_next_frame’:
ffvideo/ffvideo.c:2704:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
__pyx_t_1 = (__pyx_v_self->packet.pts == AV_NOPTS_VALUE);
^
ffvideo/ffvideo.c:2771:111: error: ‘struct AVStream’ has no member named ‘r_frame_rate’
__pyx_v_self->frame->display_picture_number = ((int)av_q2d(av_mul_q(av_mul_q(__pyx_t_6, __pyx_v_self->stream->r_frame_rate), __pyx_v_self->stream->time_base)));
^
ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_12current’:
ffvideo/ffvideo.c:2989:3: warning: ‘avcodec_alloc_frame’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3211) [-Wdeprecated-declarations]
__pyx_v_scaled_frame = avcodec_alloc_frame();
^
ffvideo/ffvideo.c:3033:3: warning: implicit declaration of function ‘PyBuffer_New’ [-Wimplicit-function-declaration]
__pyx_t_2 = PyBuffer_New(__pyx_v_buflen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^
ffvideo/ffvideo.c:3033:13: warning: assignment makes pointer from integer without a cast
__pyx_t_2 = PyBuffer_New(__pyx_v_buflen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^
ffvideo/ffvideo.c:3045:51: warning: passing argument 2 of ‘PyObject_AsCharBuffer’ from incompatible pointer type
__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 /usr/local/include/python3.6m/Python.h:123:0,
from ffvideo/ffvideo.c:4:
/usr/local/include/python3.6m/abstract.h:552:22: note: expected ‘const char **’ but argument is of type ‘char **’
PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
^
ffvideo/ffvideo.c:3086:44: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type
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/libswscale/swscale.h:223:5: note: expected ‘const uint8_t * const*’ but argument is of type ‘uint8_t **’
int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
^
ffvideo/ffvideo.c: In function ‘__pyx_pf_7ffvideo_11VideoStream_14get_frame_no’:
ffvideo/ffvideo.c:3243:61: error: ‘struct AVStream’ has no member named ‘r_frame_rate’
__pyx_v_gpts = av_rescale(__pyx_t_1, (__pyx_v_self->stream->r_frame_rate.den * AV_TIME_BASE), __pyx_v_self->stream->r_frame_rate.num);
^
ffvideo/ffvideo.c:3243:117: error: ‘struct AVStream’ has no member named ‘r_frame_rate’
__pyx_v_gpts = av_rescale(__pyx_t_1, (__pyx_v_self->stream->r_frame_rate.den * AV_TIME_BASE), __pyx_v_self->stream->r_frame_rate.num);
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-41uj66w6/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-wvqez2vw-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-41uj66w6/ffvideo/
This is part of Dockerfile
Installed packages - python-dev python3-dev apt-utils cython libavutil-dev libavcodec-dev libavformat-dev libswscale-dev
Any ideas what to do?
多亏了hoefling, r_frame_rate在Libav中早已消失,用法应改为avg_frame_rate
First download ffvideo
pip download ffvideo
tar -xf FFVideo-0.0.13.tar.gz
cd FFVideo-0.0.13
python setup.py install
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.