ffmpeg源码分析四:transcode_step函数
来源:互联网 发布:php mysql utf8 乱码 编辑:程序博客网 时间:2024/06/03 17:38
该函数的主要功能是一步完整的转换工作,下面看看源代码:
static int transcode_step(void){ OutputStream *ost; InputStream *ist; int ret; //选择一个有效的输出流进行处理 ost = choose_output(); if (!ost) { if (got_eagain()) { reset_eagain(); av_usleep(10000); return 0; } av_log(NULL, AV_LOG_VERBOSE, "No more inputs to read from, finishing.\n"); return AVERROR_EOF; } //选择一个输入流 if (ost->filter) { if ((ret = transcode_from_filter(ost->filter->graph, &ist)) < 0) return ret; if (!ist) return 0; } else { av_assert0(ost->source_index >= 0); ist = input_streams[ost->source_index]; } //读取并处理每一个包 ret = process_input(ist->file_index); if (ret == AVERROR(EAGAIN)) { if (input_files[ist->file_index]->eagain) ost->unavailable = 1; return 0; } if (ret < 0) return ret == AVERROR_EOF ? 0 : ret; return reap_filters(); //根据滤波器做滤波处理,并把处理完的音视频输出到输出文件中}
解码流程是:process_input() -> output_packet() -> decode_audio()/decode_video()/transcode_subtitles()
而decode_audio() 是调用 avcodec_decode_audio4() 来完成工作的。decode_video() 则是通过调用 avcodec_decode_video2() 来完成的。
编码流程是:reap_filters() -> do_video_out() 或 do_audio_out() -> avcodec_encode_video2() 或 avcodec_encode_audio2()。
1 0
- ffmpeg源码分析四:transcode_step函数
- ffmpeg源码分析四:transcode_step函数 (转4)
- ffmpeg源码分析:transcode()函数
- ffmpeg源码分析:transcode_init()函数
- ffmpeg源码分析之四-----avformat_open_input()下
- 最新版ffmpeg源码分析二:transcode()函数
- 最新版ffmpeg源码分析三:transcode_init()函数
- 最新版ffmpeg源码分析二:transcode()函数
- 最新版ffmpeg源码分析三:transcode_init()函数
- 最新版ffmpeg源码分析二:transcode()函数
- 最新版ffmpeg源码分析二:transcode()函数
- ffmpeg源码分析三:transcode_init函数
- 最新版ffmpeg源码分析二:transcode()函数
- ffmpeg学习六:avcodec_open2函数源码分析
- ffmpeg学习七:avformat_find_stream_info函数源码分析
- ffmpeg源码分析二:main函数和transcode函数
- JNI实现源码分析【四 函数调用】
- ffmpeg源码分析
- 浏览器hack
- android 常见分辨率(mdpi、hdpi 、xhdpi、xxhdpi )及屏幕适配注意事项
- mini2440之--adc程序
- [BZOJ1059][ZJOI2007][二分图匹配]矩阵游戏
- C++ 顶层 const
- ffmpeg源码分析四:transcode_step函数
- GUI(图形用户界面)
- 新特征-有返回值的线程
- 青年要自觉践行社会主义核心价值观 与祖国和人民同行努力创造精彩人生
- ORA-08002 序列XXXX尚未在此进程中定义
- MSVC6下获取本地IP地址
- 新特征-原子量
- java中String的常用方法 1、length() 字符串的长度 例:char chars[]={'a','b'.'c'}; String s=new String(chars);
- 【JavaScript】验证码点击刷新、点击超链接,问是否删除、点击鼠标左键,修改文本框信息