Commit dbde0ad6 authored by Simon Morlat's avatar Simon Morlat
Browse files

tune settings for android

parent 77d509f8
......@@ -231,6 +231,12 @@ static void enc_mjpeg_init(MSFilter *f){
static void prepare(EncState *s){
AVCodecContext *c=&s->av_context;
#ifdef ANDROID
const int max_br_vbv=128000;
#else
const int max_br_vbv=256000;
#endif
avcodec_get_context_defaults(c);
if (s->codec==CODEC_ID_MJPEG)
{
......@@ -256,7 +262,9 @@ static void prepare(EncState *s){
}
c->bit_rate_tolerance=s->fps>1?(float)c->bit_rate/(s->fps-1):c->bit_rate;
if (s->codec!=CODEC_ID_SNOW && s->maxbr<256000){
/* ffmpeg vbv rate control consumes too much cpu above a certain target bitrate.
We don't use it above max_br_vbv */
if (s->codec!=CODEC_ID_SNOW && s->maxbr<max_br_vbv){
/*snow does not like 1st pass rate control*/
c->rc_max_rate=c->bit_rate;
c->rc_min_rate=0;
......@@ -867,10 +875,7 @@ static int enc_set_br(MSFilter *f, void *arg){
s->fps=5;
s->qmin=5;
}
#ifdef ANDROID
/* we have to limit the fps on android due to limited CPU */
if (s->fps>7) s->fps=7;
#endif
if (s->av_context.codec!=NULL){
/*apply new settings dynamically*/
ms_filter_lock(f);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment