X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/814d4c4c94c761c42b40004cc36d2f3bb1303da7..eaff36c973af2807606b5277343fc9e237add24f:/ffmpeg_filter.c diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index ce2ffc0..10b2f5f 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -423,11 +423,17 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, if (codec->width || codec->height) { char args[255]; AVFilterContext *filter; + AVDictionaryEntry *e = NULL; - snprintf(args, sizeof(args), "%d:%d:0x%X", + snprintf(args, sizeof(args), "%d:%d", codec->width, - codec->height, - (unsigned)ost->sws_flags); + codec->height); + + while ((e = av_dict_get(ost->sws_dict, "", e, + AV_DICT_IGNORE_SUFFIX))) { + av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value); + } + snprintf(name, sizeof(name), "scaler for output stream %d:%d", ost->file_index, ost->index); if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"), @@ -538,7 +544,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter, av_get_default_channel_layout(ost->audio_channels_mapped)); for (i = 0; i < ost->audio_channels_mapped; i++) if (ost->audio_channels_map[i] != -1) - av_bprintf(&pan_buf, ":c%d=c%d", i, ost->audio_channels_map[i]); + av_bprintf(&pan_buf, "|c%d=c%d", i, ost->audio_channels_map[i]); AUTO_INSERT_FILTER("-map_channel", "pan", pan_buf.str); av_bprint_finalize(&pan_buf, NULL); @@ -676,8 +682,8 @@ static int sub2video_prepare(InputStream *ist) } av_log(avf, AV_LOG_INFO, "sub2video: using %dx%d canvas\n", w, h); } - ist->sub2video.w = ist->dec_ctx->width = ist->resample_width = w; - ist->sub2video.h = ist->dec_ctx->height = ist->resample_height = h; + ist->sub2video.w = ist->resample_width = w; + ist->sub2video.h = ist->resample_height = h; /* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the palettes for all rectangles are identical or compatible */ @@ -961,7 +967,13 @@ int configure_filtergraph(FilterGraph *fg) char args[512]; AVDictionaryEntry *e = NULL; - snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags); + args[0] = 0; + while ((e = av_dict_get(ost->sws_dict, "", e, + AV_DICT_IGNORE_SUFFIX))) { + av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value); + } + if (strlen(args)) + args[strlen(args)-1] = 0; fg->graph->scale_sws_opts = av_strdup(args); args[0] = 0;