简体   繁体   English

加速x264编码

[英]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. 我正在使用x264来编码从iphone相机捕获的原始数据..但编码速度非常慢。任何人都可以帮助我加快编码速度。

I have used following settings to build x264 lib: 我使用以下设置来构建x264 lib:

//for armv6 //对于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 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 //对于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 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. 但我不认为iPhone能够以非常高的速度使用x264对视频进行编码。 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. 我从未为iPhone开发任何东西,但通常这些嵌入式系统都有一个硬件编码器,可以使用API​​为您的应用程序提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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