Message ID | e383a1e7-90f4-cf8e-2181-bf9ee896a274@vivanet.hu |
---|---|
State | New |
Headers | show |
Bodecs Bela (2018-03-14): > In case of some content, astreamselect filter remains in non active > state. > > please review this pacth. I am not sure this is the right fix of this. I am not sure either. framesync was not designed for audio. I would like to investigate: can you share the failing case? Regards,
2018.03.14. 20:29 keltezéssel, Nicolas George írta: > Bodecs Bela (2018-03-14): >> In case of some content, astreamselect filter remains in non active >> state. >> >> please review this pacth. I am not sure this is the right fix of this. > I am not sure either. framesync was not designed for audio. I would like > to investigate: can you share the failing case? > > Regards, > > ffmpeg -loglevel info -y \ -re -i a.mp4 \ -re -i b.mp4 \ -filter_complex "[0:a][1:a] astreamselect=inputs=2:map=1 [out_a]" \ -map "[out_a]" -vn \ -f framemd5 - a.mp4 and b.mp4 are available on these direct links: http://download.songo.hu/a.mp4 http://download.songo.hu/b.mp4 (they are 500k each) with my patch it works good. bb > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Bodecs Bela (2018-03-17):
> with my patch it works good.
Thanks for the details. After more careful examination, I confirm my
first impression: calling ff_filter_set_ready() from the framesync
callback would be wrong. But this filter already misuses internal APIs
(for example re-calling avfilter_config_links() after init) and contains
several easily spotted bugs.
Regards,
2018-03-18 13:57 GMT+01:00, Nicolas George <george@nsup.org>: > Bodecs Bela (2018-03-17): >> with my patch it works good. > > Thanks for the details. After more careful examination, I confirm my > first impression: calling ff_filter_set_ready() from the framesync > callback would be wrong. But this filter already misuses internal APIs > (for example re-calling avfilter_config_links() after init) and contains > several easily spotted bugs. Not knowing what this is all about, I believe you should elaborate a little. Carl Eugen
diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c index 923deb1..2aef3f4 100644 --- a/libavfilter/f_streamselect.c +++ b/libavfilter/f_streamselect.c @@ -25,6 +25,7 @@ #include "framesync.h" #include "internal.h" #include "video.h" +#include "filters.h" typedef struct StreamSelectContext { const AVClass *class; @@ -66,8 +67,10 @@ static int process_frame(FFFrameSync *fs) AVFrame *out; if (s->is_audio && s->last_pts[j] == in[j]->pts && - ctx->outputs[i]->frame_count_in > 0) + ctx->outputs[i]->frame_count_in > 0) { + ff_filter_set_ready(ctx->outputs[i]->src, 200); continue; + } out = av_frame_clone(in[j]); if (!out) return AVERROR(ENOMEM);