求助,编译ffmpeg自带的例子出现如下错误
ffmpeg吧
全部回复
仅看楼主
level 3
In file included from ./include/libavutil/mem.h:33:0,
from ./include/libavutil/common.h:464,
from ./include/libavutil/avutil.h:288,
from ./include/libavutil/imgutils.h:30,
from demuxing_decoding.c:36:
demuxing_decoding.c: In function ‘int decode_packet(int*, int)’:
./include/libavutil/error.h:120:95: error: taking address of temporary array
av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
^
demuxing_decoding.c:79:66: note: in expansion of macro ‘av_err2str’
fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret));
^
demuxing_decoding.c:96:58: error: invalid conversion from ‘int’ to ‘AVPixelFormat’ [-fpermissive]
av_get_pix_fmt_name(frame->format));
^
In file included from ./include/libavutil/imgutils.h:31:0,
from demuxing_decoding.c:36:
./include/libavutil/pixdesc.h:232:13: error: initializing argument 1 of ‘const char* av_get_pix_fmt_name(AVPixelFormat)’ [-fpermissive]
const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
^
In file included from demuxing_decoding.c:38:0:
./include/libavutil/timestamp.h:76:94: error: taking address of temporary array
#define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
^
demuxing_decoding.c:103:20: note: in expansion of macro ‘av_ts2timestr’
av_ts2timestr(frame->pts, &video_dec_ctx->time_base));
^
In file included from ./include/libavutil/mem.h:33:0,
from ./include/libavutil/common.h:464,
from ./include/libavutil/avutil.h:288,
from ./include/libavutil/imgutils.h:30,
from demuxing_decoding.c:36:
./include/libavutil/error.h:120:95: error: taking address of temporary array
av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
^
demuxing_decoding.c:118:66: note: in expansion of macro ‘av_err2str’
fprintf(stderr, "Error decoding audio frame (%s)\n", av_err2str(ret));
^
demuxing_decoding.c:128:97: error: invalid conversion from ‘int’ to ‘AVSampleFormat’ [-fpermissive]
size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format);
^
In file included from demuxing_decoding.c:37:0:
./include/libavutil/samplefmt.h:138:5: error: initializing argument 1 of ‘int av_get_bytes_per_sample(AVSampleFormat)’ [-fpermissive]
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
^
In file included from demuxing_decoding.c:38:0:
./include/libavutil/timestamp.h:76:94: error: taking address of temporary array
#define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
^
demuxing_decoding.c:132:20: note: in expansion of macro ‘av_ts2timestr’
av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
2016年03月21日 12点03分 1
level 3
我怀疑是这里除了错误。。,pkt是全局变量,av_read_frame是里面自定义的一个函数
/* read frames from the file */
while (av_read_frame(fmt_ctx, &pkt) >= 0) {
AVPacket orig_pkt = pkt;
do {
ret = decode_packet(&got_frame, 0);
if (ret < 0)
break;
pkt.data += ret;
pkt.size -= ret;
} while (pkt.size > 0);
av_packet_unref(&orig_pkt);
}
2016年03月21日 14点03分 3
level 3
啊,,顺序有点乱,编译通过了,但是停不下的转换,之后是二楼的怀疑。。
2016年03月21日 14点03分 4
level 3
这个就是那个自带的demuxing_decoding.c的例子。
2016年03月21日 14点03分 5
level 1
问题解决了吗?你用的什么系统编译的?我编译一次性通过啊
2016年03月25日 03点03分 6
Ubuntu啊?用的g++?勉强运行了但是分出来的视频用不了。
2016年03月26日 11点03分
@匆匆除草剂 直接执行里面的make自动编译
2016年03月28日 01点03分
回复
ShaoSunrise
:嗯,好的👌
2016年03月28日 15点03分
1