加速x264编码
我正在使用x264编码从iPhone相机捕获的原始数据..但编码是非常缓慢的。任何人都可以帮助我加快编码速度。
我使用以下设置来构建x264库:
//为armv6
CC = / Developer / Platforms / iPhoneOS.platform / Developer / usr / bin / gcc ./configure --host = arm-apple-darwin --sysroot = / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS4.3 .sdk --prefix ='dist'--extra-cflags =' - arch armv6'--extra-ldflags = -L / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS4.3.sdk / usr / lib / system / --extra-ldflags =' - arch armv6'--enable-pic --disable-asm
//为armv7
CC = / Developer / Platforms / iPhoneOS.platform / Developer / usr / bin / gcc ./configure --host = arm-apple-darwin --sysroot = / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS4.3 .sdk --prefix ='dist'--extra-cflags =' - arch armv7'--extra-ldflags = -L / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS4.3.sdk / usr / lib / system / --extra-ldflags =' - arch armv7' - 启用图片
我正在使用像这样的默认预设:
x264_param_default_preset(param, "slow", "zerolatency");
并设置几个参数:
param->i_bframe = 0;
param->analyse.i_me_method = X264_ME_HEX;
param->analyse.i_subpel_refine = 2;
param->i_frame_reference = 1;
param->analyse.b_mixed_references = 0;
param->analyse.i_trellis = 0;
param->rc.b_mb_tree = 0;
param->analyse.i_weighted_pred = X264_WEIGHTP_NONE;
param->rc.i_bitrate = 180;
param->rc.i_qp_min = 20;
param->rc.i_qp_max = 26;
param->i_keyint_max = 15;
param->i_keyint_min = 15;
param->i_width = w;
param->i_height = h;
x264_param_apply_profile(param, "baseline");
x264_picture_alloc( &(enc->pic), X264_CSP_I420, param->i_width, param->i_height );
如果您使用默认预设:
x264_param_default_preset(param, "veryfast", "zerolatency");
可能你的速度会有所提高。 但我不认为iPhone能够以极高的速度用x264编码视频。 我从来没有为iPhone开发过任何东西,但通常这些嵌入式系统都有一个硬件编码器,可以通过API使用您的应用程序。
链接地址: http://www.djcxy.com/p/52453.html下一篇: error while loading project into device..about libsqlite3.0dylib file is missing