// copy timebase while removing common factors
ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
ost->st->codec->codec= ost->enc_ctx->codec;
- } else {
+ } else if (ost->stream_copy) {
ret = av_opt_set_dict(ost->st->codec, &ost->encoder_opts);
if (ret < 0) {
av_log(NULL, AV_LOG_FATAL,
abort();
}
} else {
- if (!ost->enc)
- ost->enc = avcodec_find_encoder(enc_ctx->codec_id);
- if (!ost->enc) {
- /* should only happen when a default codec is not present. */
- snprintf(error, sizeof(error), "Encoder (codec %s) not found for output stream #%d:%d",
- avcodec_get_name(ost->st->codec->codec_id), ost->file_index, ost->index);
- ret = AVERROR(EINVAL);
- goto dump_format;
- }
-
set_encoder_id(output_files[ost->file_index], ost);
#if CONFIG_LIBMFX
exit_program(1);
#endif
- if (!ost->filter &&
- (enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
- enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO)) {
- FilterGraph *fg;
- fg = init_simple_filtergraph(ist, ost);
+ if ((enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
+ enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO) &&
+ filtergraph_is_simple(ost->filter->graph)) {
+ FilterGraph *fg = ost->filter->graph;
if (configure_filtergraph(fg)) {
av_log(NULL, AV_LOG_FATAL, "Error opening filters!\n");
exit_program(1);
ist = input_streams[i];
for (j = 0; j < ist->nb_filters; j++) {
- if (ist->filters[j]->graph->graph_desc) {
+ if (!filtergraph_is_simple(ist->filters[j]->graph)) {
av_log(NULL, AV_LOG_INFO, " Stream #%d:%d (%s) -> %s",
ist->file_index, ist->st->index, ist->dec ? ist->dec->name : "?",
ist->filters[j]->name);
continue;
}
- if (ost->filter && ost->filter->graph->graph_desc) {
+ if (ost->filter && !filtergraph_is_simple(ost->filter->graph)) {
/* output from a complex graph */
av_log(NULL, AV_LOG_INFO, " %s", ost->filter->name);
if (nb_filtergraphs > 1)
int ret;
int64_t ti;
+ init_dynload();
+
register_exit(ffmpeg_cleanup);
setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */