2012-07-12 134 views
3

我正在利用x264編碼從iPhone攝像頭捕獲的原始數據..但編碼速度非常慢。任何人都可以幫助我加快編碼速度。加速x264編碼

我用下面的設置來建立X264 LIB:

//對ARMv6

CC = /開發/平臺/ iPhoneOS.platform /開發人員的/ usr/bin中/海灣合作委員會的./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目錄/系統/ --extra-LDFLAGS = ' - 拱的ARMv7' --enable-PIC

我使用的默認預設這樣的:

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

,並設置一些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); 

回答

0

如果使用默認預設爲:

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

可能你會在速度一定的增益。但我不認爲iPhone能夠以極高的速度用x264編碼視頻。我從來沒有爲iPhone開發過任何東西,但通常這些嵌入式系統都有一個硬件編碼器,可以通過API使用您的應用程序。