简体   繁体   中英

accelerate x264 encoding

i am making use of x264 to encode raw data captured from the iphone camera .. but the encoding is very slow .Can anyone help me accelerate the encoding speed.

I have used following settings to build x264 lib:

//for 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

//for 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' --enable-pic

I am using default preset like this:

x264_param_default_preset(param, "slow", "zerolatency");

and setting few perameters:

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 );

If you use the default preset as:

x264_param_default_preset(param, "veryfast", "zerolatency");

probably you will have some gain in the speed. Yet I don´t think that an iPhone would be able to encode video with x264 at a very high speed. I never developed anything for iPhone, but normally those embedded systems have a hardware encoder that may be available to your application using an API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM