ffmpeg废弃的接口
来源:互联网 发布:tcp默认端口号 编辑:程序博客网 时间:2024/05/16 02:06
http://sgros.blogspot.co.il/2013/01/deprecated-functions-in-ffmpeg-library.html
Deprecated functions in ffmpeg library
Well, I have some code that uses some old FFMPEG library, and now, as I updated my laptop to Fedora 18, it turns out that those functions are gone for good. I found some resources about how to port old code (here,here and here), but since it wasn't what I needed I decided to write my own version. So, here we go.
url_open()
This function has been changed to avio_open. There is also url_close which is renamed toavio_close. This information I found here.
av_new_stream()
AVCODEC_MAX_AUDIO_FRAME_SIZE 已经被废弃了,好像没有替代者:
#if FF_API_OLD_DECODE_AUDIO
/* in bytes */
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
#endif
url_open()
This function has been changed to avio_open. There is also url_close which is renamed toavio_close. This information I found here.
av_new_stream()
This function is still supported as of FFMPEG 1.0.1 but it is marked as deprecated. It will be replaced with avformat_new_stream(). Suppose that the old code was:
AVStream *st = av_new_stream(oc, i);
the modified code should be:
AVStream *st = avformat_new_stream(oc, NULL);
st->id = i
Be careful to check first that st isn't NULL!
dump_format()
This function was renamed to av_dump_format().
av_write_header()
Replaced with avformat_write_header() that accepts two arguments instead of one. Pass NULL as the second argument to get identical behavior to the old function.
av_codec_open()
This one is replaced with av_codec_open2(). The replacement function accepts three arguments instead of two, but put NULL as a third argument to get the same behavior as the old function.
avcodec_encode_audio()
Replaced with avcodec_encode_audio2().
av_set_parameters()
I couldn't fine the replacement for this one. First, I've found that this function doesn't have replacement. But it was when it was still available in FFMPEG, even though deprecated. Then, they removed it, and thus it has to have replacement. In certain places I found that they only disabled it, on others that its parameters have to be passed to avformat_write_header. In the end, I gave up because I didn't need working version of that part of the code for now. Since in my case avformat_alloc_context() is called and thenav_set_parameters(), last what I looked at was to call avformat_alloc_output_context2()instead of avformat_alloc_context(). But the change is not trivial so I skipped it.
SampleFormat
This enum has been renamed AVSampleFormat.
URL_WRONLY
This constant has been replaced with AVIO_FLAG_WRITE.
SAMPLE_FMT_U8, SAMPLE_FMT_S16, SAMPLE_FMT_S32, etc.
Those are prefixed now with AV_, so use AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, etc.
参考 http://stackoverflow.com/questions/17443044/handling-ffmpeg-library-interface-change-when-upgrading-ffmpeg
However, it lacks a few of them, so I'll post all the changes that your output indicates are necessary to get through this compilation step:
avcodec_init -> avcodec_register_allav_open_input_file -> avformat_open_input
It's probably worth noting here that av_set_parameters was deprecated and completely scrapped, so you should specify parameters in the call to avformat_open_input now.
AVFormatContext.file_size -> avio_size()URL_WRONLY -> AVIO_FLAG_WRITEurl_fopen -> avio_openurl_fclose -> avio_closeSAMPLE_FMT_U8 -> AV_SAMPLE_FMT_U8SAMPLE_FMT_S16 -> AV_SAMPLE_FMT_S16SAMPLE_FMT_S32 -> AV_SAMPLE_FMT_S32SAMPLE_FMT_FLT -> AV_SAMPLE_FMT_FLTFF_I_TYPE -> AV_PICTURE_TYPE_I
AVCODEC_MAX_AUDIO_FRAME_SIZE 已经被废弃了,好像没有替代者:
#if FF_API_OLD_DECODE_AUDIO
/* in bytes */
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
#endif
0 0
- ffmpeg废弃的接口
- 废弃的CRT函数
- 被废弃的dispatch_get_current_queue
- 被废弃的dispatch_get_current_queue
- 被废弃的dispatch_get_current_queue
- 被废弃的dispatch_get_current_queue
- 被废弃的dispatch_get_current_queue
- dispatch_get_current_queue的废弃
- 被废弃的dispatch_get_current_queue
- 标记废弃的方法
- 废弃的配置文件
- 废弃的文章
- V2中已废弃或暂未支持的V1接口
- LibEvent中文帮助文档--第17章【废弃的DNS接口】
- 清除其他废弃的MV
- HTML5被废弃的标签
- 被废弃的汽车仪表盘
- havlenapetr-FFMpeg OnVideoSizeChangedListener接口的实现
- Linux python使用mysql数据库
- 时间复杂度的估算
- C++杂谈之关于文件操作的若干问题
- 块设备(一)
- [转]深入理解abstract class和interface
- ffmpeg废弃的接口
- Android 中的BroadCastReceiver
- NSNotificationCenter介绍
- 用回溯法(backtracking)解决平衡集合问题(一道微软公司面试题)
- [算法导论]第十章《栈和队列》
- hdu1016 Prime Ring Problem 素数环
- Java 算法题-01
- 智能手机控制电梯的可行性
- 土豪金的加密与解密