我们目前正在尝试升级我们程序使用的 ffmpeg 版本。跳跃很大,因为我们目前使用的是 ffmpeg 0.8,最新版本是 1.2。
在这些测试中,我使用了我在这里找到的(让我说)令人惊叹的包。
首先,我尝试下载和构建 ffmpeg 1.2,当然我收到了很多警告和错误,关于函数和变量已弃用或不再存在。
为了平滑过渡,我尝试构建 ffmpeg 1.0,这是与 0.8 最接近的更高版本。我得到了下面列出的警告和错误列表。
我的问题如下:是否存在任何指南来帮助这些过渡,在新版本中转换旧的 ffmpeg 范例/函数调用?由于我们正在谈论很多我没有编写的代码并且我不想逐行分析,如果可以将旧函数调用一对一转换为新函数调用,变量相同。
这是警告和错误列表(我已经清理了它,所以每个错误/警告只有一个条目)
warning: 'AVStream* av_new_stream(AVFormatContext*, int)' is deprecated (declared at /ffmpeg/include/libavformat/avformat.h:1646) [-Wdeprecated-declarations]
warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:3569) [-Wdeprecated-declarations]
error: 'avcodec_init' was not declared in this scope
warning: 'int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const AVFrame*)' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:4272) [-Wdeprecated-declarations]
warning: 'AVCodecContext* avcodec_alloc_context()' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:3423) [-Wdeprecated-declarations]
warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)' is deprecated (declared at /ffmpeg/include/libavcodec/avcodec.h:3852) [-Wdeprecated-declarations]
warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /ffmpeg/include/libavformat/avformat.h:1622) [-Wdeprecated-declarations]
error: 'av_open_input_file' was not declared in this scope
warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /ffmpeg/include/libavformat/avformat.h:1446) [-Wdeprecated-declarations]
error: 'av_set_parameters' was not declared in this scope
error: 'AVFormatContext' has no member named 'file_size'
error: 'URL_WRONLY' was not declared in this scope
error: 'url_fopen' was not declared in this scope
error: 'url_fclose' was not declared in this scope
error: 'SAMPLE_FMT_U8' was not declared in this scope
error: 'SAMPLE_FMT_S16' was not declared in this scope
error: 'SAMPLE_FMT_S32' was not declared in this scope
error: 'SAMPLE_FMT_FLT' was not declared in this scope
error: 'FF_I_TYPE' was not declared in this scope
编辑:
我正在看这些...
http://ffmpeg.org/doxygen/0.8/deprecated.html
http://ffmpeg.org/doxygen/0.9/deprecated.html
http://ffmpeg.org/doxygen/ 1.0/deprecated.html
http://ffmpeg.org/doxygen/1.1/deprecated.html
http://ffmpeg.org/doxygen/1.2/deprecated.html
http://ffmpeg.org/doxygen/trunk/deprecated.html