int FFAudioStream::encode_activate()
{
if( writing >= 0 ) return writing;
+ if( !avctx->codec ) return writing = 0;
frame_sz = avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE ?
10000 : avctx->frame_size;
return FFStream::encode_activate();
estimated = 1;
}
}
- if( estimated )
+ static int notified = 0;
+ if( !notified && estimated ) {
+ notified = 1;
printf("FFMPEG::open_decoder: some stream times estimated\n");
+ }
ff_lock("FFMPEG::open_decoder");
int ret = 0, bad_time = 0;
sprintf(arg, "%d", asset->ff_audio_bitrate);
av_dict_set(&sopts, "b", arg, 0);
}
+ else if( asset->ff_audio_quality >= 0 ) {
+ ctx->global_quality = asset->ff_audio_quality * FF_QP2LAMBDA;
+ ctx->qmin = ctx->qmax = asset->ff_audio_quality;
+ ctx->mb_lmin = ctx->qmin * FF_QP2LAMBDA;
+ ctx->mb_lmax = ctx->qmax * FF_QP2LAMBDA;
+ ctx->flags |= CODEC_FLAG_QSCALE;
+ char arg[BCSTRLEN];
+ av_dict_set(&sopts, "flags", "+qscale", 0);
+ sprintf(arg, "%d", asset->ff_audio_quality);
+ av_dict_set(&sopts, "qscale", arg, 0);
+ sprintf(arg, "%d", ctx->global_quality);
+ av_dict_set(&sopts, "global_quality", arg, 0);
+ }
int aidx = ffaudio.size();
int fidx = aidx + ffvideo.size();
FFAudioStream *aud = new FFAudioStream(this, st, aidx, fidx);
break;
}
ctx->time_base = (AVRational) { frame_rate.den, frame_rate.num };
+ st->avg_frame_rate = frame_rate;
st->time_base = ctx->time_base;
vid->writing = -1;
vid->interlaced = asset->interlace_mode == ILACE_MODE_TOP_FIRST ||
return ffvideo[stream]->st->id;
}
+int FFMPEG::ff_video_mpeg_color_range(int stream)
+{
+ return ffvideo[stream]->st->codecpar->color_range == AVCOL_RANGE_MPEG ? 1 : 0;
+}
int FFMPEG::ff_cpus()
{