* [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration @ 2023-04-19 19:52 Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 02/25] fftools/ffmpeg_filter: drop unused AUTO_INSERT_FILTER_INPUT() Anton Khirnov ` (23 more replies) 0 siblings, 24 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_filter.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index a9302a95f0..72020c8f3a 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -325,7 +325,6 @@ typedef struct FilterGraph { const char *graph_desc; AVFilterGraph *graph; - int reconfiguration; // true when the filtergraph contains only meta filters // that do not modify the frame data int is_meta; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 1d88d2e3b1..52a5d19351 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1239,8 +1239,6 @@ int configure_filtergraph(FilterGraph *fg) goto fail; } - fg->reconfiguration = 1; - for (i = 0; i < fg->nb_inputs; i++) { AVFrame *tmp; while (av_fifo_read(fg->inputs[i]->frame_queue, &tmp, 1) >= 0) { -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 02/25] fftools/ffmpeg_filter: drop unused AUTO_INSERT_FILTER_INPUT() 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 03/25] lavfi/avf_concat: rescale frame durations Anton Khirnov ` (22 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg_filter.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 52a5d19351..ea182089b1 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1035,27 +1035,6 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter, return ret; last_filter = ifilter->filter; -#define AUTO_INSERT_FILTER_INPUT(opt_name, filter_name, arg) do { \ - AVFilterContext *filt_ctx; \ - \ - av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \ - "similarly to -af " filter_name "=%s.\n", arg); \ - \ - snprintf(name, sizeof(name), "graph_%d_%s_in_%d_%d", \ - fg->index, filter_name, ist->file_index, ist->st->index); \ - ret = avfilter_graph_create_filter(&filt_ctx, \ - avfilter_get_by_name(filter_name), \ - name, arg, NULL, fg->graph); \ - if (ret < 0) \ - return ret; \ - \ - ret = avfilter_link(last_filter, 0, filt_ctx, 0); \ - if (ret < 0) \ - return ret; \ - \ - last_filter = filt_ctx; \ -} while (0) - snprintf(name, sizeof(name), "trim for input stream %d:%d", ist->file_index, ist->st->index); if (copy_ts) { -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 03/25] lavfi/avf_concat: rescale frame durations 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 02/25] fftools/ffmpeg_filter: drop unused AUTO_INSERT_FILTER_INPUT() Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available Anton Khirnov ` (21 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- libavfilter/avf_concat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c index c85c17b51f..af758c5292 100644 --- a/libavfilter/avf_concat.c +++ b/libavfilter/avf_concat.c @@ -179,6 +179,7 @@ static int push_frame(AVFilterContext *ctx, unsigned in_no, AVFrame *buf) struct concat_in *in = &cat->in[in_no]; buf->pts = av_rescale_q(buf->pts, inlink->time_base, outlink->time_base); + buf->duration = av_rescale_q(buf->duration, inlink->time_base, outlink->time_base); in->pts = buf->pts; in->nb_frames++; /* add duration to input PTS */ -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 02/25] fftools/ffmpeg_filter: drop unused AUTO_INSERT_FILTER_INPUT() Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 03/25] lavfi/avf_concat: rescale frame durations Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 20:42 ` James Almer 2023-04-24 10:22 ` Nicolas George 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 05/25] fftools/ffmpeg_enc: rename next_picture to frame Anton Khirnov ` (20 subsequent siblings) 23 siblings, 2 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel Previously they would only be used with trivial filtergraphs, because filters did not handle frame durations. That is no longer true - most filters process frame durations properly (there may still be some that don't - this change will help finding and fixing them). Improves output video frame durations in a number of FATE tests. --- fftools/ffmpeg_enc.c | 19 +++----- tests/ref/fate/filter-concat-vfr | 66 +++++++++++++------------- tests/ref/fate/gif-disposal-restore | 2 +- tests/ref/fate/gif-gray | 72 ++++++++++++++--------------- tests/ref/fate/quickdraw | 2 +- 5 files changed, 77 insertions(+), 84 deletions(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index e3dc858bc3..9aaec277f1 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -1005,24 +1005,17 @@ static void do_video_out(OutputFile *of, AVRational frame_rate; int64_t nb_frames, nb_frames_prev, i; double duration = 0; - InputStream *ist = ost->ist; AVFilterContext *filter = ost->filter->filter; - frame_rate = av_buffersink_get_frame_rate(filter); - if (frame_rate.num > 0 && frame_rate.den > 0) - duration = 1/(av_q2d(frame_rate) * av_q2d(enc->time_base)); + if (next_picture) + duration = lrintf(next_picture->duration * av_q2d(next_picture->time_base) / av_q2d(enc->time_base)); - if(ist && ist->st->start_time != AV_NOPTS_VALUE && ist->first_dts != AV_NOPTS_VALUE && ost->frame_rate.num) + if (duration <= 0 && ost->frame_rate.num) duration = FFMIN(duration, 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base))); - if (!ost->filters_script && - !ost->filters && - (nb_filtergraphs == 0 || !filtergraphs[0]->graph_desc) && - next_picture && - ist && - lrintf(next_picture->duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) { - duration = lrintf(next_picture->duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)); - } + frame_rate = av_buffersink_get_frame_rate(filter); + if (duration <= 0 && frame_rate.num > 0 && frame_rate.den > 0) + duration = 1/(av_q2d(frame_rate) * av_q2d(enc->time_base)); if (!next_picture) { //end, flushing diff --git a/tests/ref/fate/filter-concat-vfr b/tests/ref/fate/filter-concat-vfr index 7c5e12e093..66e9007da8 100644 --- a/tests/ref/fate/filter-concat-vfr +++ b/tests/ref/fate/filter-concat-vfr @@ -8,7 +8,7 @@ #codec_id 1: pcm_s16le #sample_rate 1: 44100 #channel_layout_name 1: mono -0, 0, 0, 0, 230400, 0x88c4d19a +0, 0, 0, 199999, 230400, 0x88c4d19a 1, 0, 0, 1024, 2048, 0xb3f10192 1, 1024, 1024, 1024, 2048, 0xb340fe4e 1, 2048, 2048, 1024, 2048, 0x0a5f0111 @@ -18,7 +18,7 @@ 1, 6144, 6144, 1024, 2048, 0x70a8fa17 1, 7168, 7168, 1024, 2048, 0x0dad072a 1, 8192, 8192, 1024, 2048, 0x5e810c51 -0, 200000, 200000, 0, 230400, 0x0d77c977 +0, 200000, 200000, 200000, 230400, 0x0d77c977 1, 9216, 9216, 1024, 2048, 0xbe5bf462 1, 10240, 10240, 1024, 2048, 0xbcd9faeb 1, 11264, 11264, 1024, 2048, 0x0d5bfe9c @@ -28,7 +28,7 @@ 1, 15360, 15360, 1024, 2048, 0x11a9fa03 1, 16384, 16384, 1024, 2048, 0x9a920378 1, 17408, 17408, 1024, 2048, 0x901b0525 -0, 400000, 400000, 0, 230400, 0x242629d7 +0, 400000, 400000, 200000, 230400, 0x242629d7 1, 18432, 18432, 1024, 2048, 0x74b2003f 1, 19456, 19456, 1024, 2048, 0xa20ef3ed 1, 20480, 20480, 1024, 2048, 0x44cef9de @@ -37,7 +37,7 @@ 1, 23552, 23552, 1024, 2048, 0xcab6f9e5 1, 24576, 24576, 1024, 2048, 0x67f8f608 1, 25600, 25600, 1024, 2048, 0x8d7f03fa -0, 600000, 600000, 0, 230400, 0x62cdc018 +0, 600000, 600000, 200000, 230400, 0x62cdc018 1, 26624, 26624, 1024, 2048, 0x3e1e0566 1, 27648, 27648, 1024, 2048, 0x2cfe0308 1, 28672, 28672, 1024, 2048, 0x1ceaf702 @@ -47,7 +47,7 @@ 1, 32768, 32768, 1024, 2048, 0x3e5afa28 1, 33792, 33792, 1024, 2048, 0x053ff47a 1, 34816, 34816, 1024, 2048, 0x0d28fed9 -0, 800000, 800000, 0, 230400, 0x248ad058 +0, 800000, 800000, 200000, 230400, 0x248ad058 1, 35840, 35840, 1024, 2048, 0x279805cc 1, 36864, 36864, 1024, 2048, 0xb16a0a12 1, 37888, 37888, 1024, 2048, 0xb45af340 @@ -57,72 +57,72 @@ 1, 41984, 41984, 1024, 2048, 0x503800ce 1, 43008, 43008, 1024, 2048, 0xa3bbf4af 1, 44032, 44032, 68, 136, 0xc8d751c7 -0, 1000000, 1000000, 0, 230400, 0x223d134f +0, 1000000, 1000000, 200000, 230400, 0x223d134f 1, 44100, 44100, 9600, 19200, 0x00000000 -0, 1200000, 1200000, 0, 230400, 0xbf1c3d34 +0, 1200000, 1200000, 200000, 230400, 0xbf1c3d34 1, 53700, 53700, 9600, 19200, 0x00000000 -0, 1400000, 1400000, 0, 230400, 0xae0efe96 +0, 1400000, 1400000, 200000, 230400, 0xae0efe96 1, 63300, 63300, 9600, 19200, 0x00000000 -0, 1600000, 1600000, 0, 230400, 0x0cd624d1 +0, 1600000, 1600000, 200000, 230400, 0x0cd624d1 1, 72900, 72900, 9600, 19200, 0x00000000 -0, 1800000, 1800000, 0, 230400, 0x6dedf2c0 +0, 1800000, 1800000, 200000, 230400, 0x6dedf2c0 1, 82500, 82500, 5700, 11400, 0x00000000 -0, 2000000, 2000000, 0, 230400, 0x88c4d19a +0, 2000000, 2000000, 66667, 230400, 0x88c4d19a 1, 88200, 88200, 1024, 2048, 0x283efb3a 1, 89224, 89224, 1024, 2048, 0x7692fb8f 1, 90248, 90248, 1024, 2048, 0xbaaafcc0 -0, 2066667, 2066667, 0, 230400, 0x5bbc2f63 +0, 2066667, 2066667, 66667, 230400, 0x5bbc2f63 1, 91272, 91272, 1024, 2048, 0xadc8017e 1, 92296, 92296, 1024, 2048, 0x4f4dffdc 1, 93320, 93320, 1024, 2048, 0x7ffbff48 -0, 2133333, 2133333, 0, 230400, 0x3becbfad +0, 2133333, 2133333, 66667, 230400, 0x3becbfad 1, 94344, 94344, 1024, 2048, 0x2f990719 1, 95368, 95368, 1024, 2048, 0xe2caf65c 1, 96392, 96392, 1024, 2048, 0x825208e4 -0, 2200000, 2200000, 0, 230400, 0x0d77c977 +0, 2200000, 2200000, 66667, 230400, 0x0d77c977 1, 97416, 97416, 1024, 2048, 0xf563f13b 1, 98440, 98440, 1024, 2048, 0x855d03e9 1, 99464, 99464, 1024, 2048, 0x0ba9fa4b -0, 2266667, 2266667, 0, 230400, 0x436cf4b2 +0, 2266667, 2266667, 66667, 230400, 0x436cf4b2 1, 100488, 100488, 1024, 2048, 0x83e1fb92 1, 101512, 101512, 1024, 2048, 0x1162f965 1, 102536, 102536, 1024, 2048, 0x0cfef73d -0, 2333333, 2333333, 0, 230400, 0x39210f27 +0, 2333333, 2333333, 66667, 230400, 0x39210f27 1, 103560, 103560, 1024, 2048, 0x5688ff75 1, 104584, 104584, 1024, 2048, 0xf6c0ede9 1, 105608, 105608, 1024, 2048, 0xfdb20602 -0, 2400000, 2400000, 0, 230400, 0x242629d7 +0, 2400000, 2400000, 66667, 230400, 0x242629d7 1, 106632, 106632, 1024, 2048, 0x40c5f17b 1, 107656, 107656, 1024, 2048, 0x559600b1 1, 108680, 108680, 1024, 2048, 0xccc3f930 -0, 2466667, 2466667, 0, 230400, 0x771c2293 +0, 2466667, 2466667, 66667, 230400, 0x771c2293 1, 109704, 109704, 1024, 2048, 0xdc800045 1, 110728, 110728, 1024, 2048, 0xdce4fb3e -0, 2533333, 2533333, 0, 230400, 0xec2af9a9 +0, 2533333, 2533333, 66667, 230400, 0xec2af9a9 1, 111752, 111752, 1024, 2048, 0x1e5efba9 1, 112776, 112776, 1024, 2048, 0x8c2e0832 1, 113800, 113800, 1024, 2048, 0x5c42f66d -0, 2600000, 2600000, 0, 230400, 0x62cdc018 +0, 2600000, 2600000, 66667, 230400, 0x62cdc018 1, 114824, 114824, 1024, 2048, 0x08e20b1e 1, 115848, 115848, 1024, 2048, 0x4cf7f903 1, 116872, 116872, 1024, 2048, 0xe6b90794 -0, 2666667, 2666667, 0, 230400, 0xf02c8693 +0, 2666667, 2666667, 66667, 230400, 0xf02c8693 1, 117896, 117896, 1024, 2048, 0x5956f8e6 1, 118920, 118920, 1024, 2048, 0x6632ff16 1, 119944, 119944, 1024, 2048, 0x46c8fe11 -0, 2733333, 2733333, 0, 230400, 0x14436efb +0, 2733333, 2733333, 66667, 230400, 0x14436efb 1, 120968, 120968, 1024, 2048, 0x7431f732 1, 121992, 121992, 1024, 2048, 0xa258049f 1, 123016, 123016, 1024, 2048, 0xdb71f00e -0, 2800000, 2800000, 0, 230400, 0x248ad058 +0, 2800000, 2800000, 66667, 230400, 0x248ad058 1, 124040, 124040, 1024, 2048, 0xa89b0359 1, 125064, 125064, 1024, 2048, 0xe0aff0f2 1, 126088, 126088, 1024, 2048, 0xc33e0085 -0, 2866667, 2866667, 0, 230400, 0xe87f6c52 +0, 2866667, 2866667, 66667, 230400, 0xe87f6c52 1, 127112, 127112, 1024, 2048, 0x9d09f379 1, 128136, 128136, 1024, 2048, 0x8c78fd06 1, 129160, 129160, 1024, 2048, 0x532bfbdd -0, 2933333, 2933333, 0, 230400, 0x6a0c196b +0, 2933333, 2933333, 66667, 230400, 0x6a0c196b 1, 130184, 130184, 1024, 2048, 0xfc36f5cd 1, 131208, 131208, 1024, 2048, 0x2e8f0699 1, 132232, 132232, 1024, 2048, 0x52382578 @@ -169,52 +169,52 @@ 1, 174216, 174216, 1024, 2048, 0xf86ff855 1, 175240, 175240, 1024, 2048, 0x6934061b 1, 176264, 176264, 136, 272, 0x4a458a45 -0, 4000000, 4000000, 0, 230400, 0x88c4d19a +0, 4000000, 4000000, 125000, 230400, 0x88c4d19a 1, 176400, 176400, 1024, 2048, 0xdb0cfe95 1, 177424, 177424, 1024, 2048, 0xcff3fdf1 1, 178448, 178448, 1024, 2048, 0x070cf585 1, 179472, 179472, 1024, 2048, 0xe9b8007f 1, 180496, 180496, 1024, 2048, 0xc51ffd64 1, 181520, 181520, 1024, 2048, 0xede2fbf9 -0, 4125000, 4125000, 0, 230400, 0x05c1b733 +0, 4125000, 4125000, 125000, 230400, 0x05c1b733 1, 182544, 182544, 1024, 2048, 0x51510410 1, 183568, 183568, 1024, 2048, 0x198af498 1, 184592, 184592, 1024, 2048, 0xae3603a2 1, 185616, 185616, 1024, 2048, 0x6200f7a1 1, 186640, 186640, 1024, 2048, 0xe6e3fe32 -0, 4250000, 4250000, 0, 230400, 0x0446ec19 +0, 4250000, 4250000, 125000, 230400, 0x0446ec19 1, 187664, 187664, 1024, 2048, 0xb2e2fd77 1, 188688, 188688, 1024, 2048, 0x063dff2f 1, 189712, 189712, 1024, 2048, 0xa89ffe21 1, 190736, 190736, 1024, 2048, 0x9e6ffa6d 1, 191760, 191760, 1024, 2048, 0x028b004e 1, 192784, 192784, 1024, 2048, 0x57edfa23 -0, 4375000, 4375000, 0, 230400, 0x0f9b1744 +0, 4375000, 4375000, 125000, 230400, 0x0f9b1744 1, 193808, 193808, 1024, 2048, 0x6d8efe1f 1, 194832, 194832, 1024, 2048, 0x774bfe54 1, 195856, 195856, 1024, 2048, 0xa931fcfb 1, 196880, 196880, 1024, 2048, 0x3505004b 1, 197904, 197904, 1024, 2048, 0x5001f576 -0, 4500000, 4500000, 0, 230400, 0x30cf070a +0, 4500000, 4500000, 125000, 230400, 0x30cf070a 1, 198928, 198928, 1024, 2048, 0x78ea049b 1, 199952, 199952, 1024, 2048, 0xd45bf733 1, 200976, 200976, 1024, 2048, 0x6395fead 1, 202000, 202000, 1024, 2048, 0xc126015e 1, 203024, 203024, 1024, 2048, 0xbecff8aa -0, 4625000, 4625000, 0, 230400, 0x9175aaa9 +0, 4625000, 4625000, 125000, 230400, 0x9175aaa9 1, 204048, 204048, 1024, 2048, 0x0fea06c3 1, 205072, 205072, 1024, 2048, 0xdea6f351 1, 206096, 206096, 1024, 2048, 0x35b808f0 1, 207120, 207120, 1024, 2048, 0x5487ee73 1, 208144, 208144, 1024, 2048, 0xac69050e 1, 209168, 209168, 1024, 2048, 0xcc5ffb00 -0, 4750000, 4750000, 0, 230400, 0x597f5628 +0, 4750000, 4750000, 125000, 230400, 0x597f5628 1, 210192, 210192, 1024, 2048, 0x328c00cb 1, 211216, 211216, 1024, 2048, 0xa707fd82 1, 212240, 212240, 1024, 2048, 0xe442f73d 1, 213264, 213264, 1024, 2048, 0x545c0418 1, 214288, 214288, 1024, 2048, 0x744ff3f7 -0, 4875000, 4875000, 0, 230400, 0x38a45a85 +0, 4875000, 4875000, 125000, 230400, 0x38a45a85 1, 215312, 215312, 1024, 2048, 0x01aa04fd 1, 216336, 216336, 1024, 2048, 0xa885f7cd 1, 217360, 217360, 1024, 2048, 0xcfca04f4 diff --git a/tests/ref/fate/gif-disposal-restore b/tests/ref/fate/gif-disposal-restore index b1282f61de..aca80c5e6d 100644 --- a/tests/ref/fate/gif-disposal-restore +++ b/tests/ref/fate/gif-disposal-restore @@ -4,5 +4,5 @@ #dimensions 0: 468x60 #sar 0: 0/1 0, 0, 0, 1, 112320, 0xb8afe429 -0, 1, 1, 1, 112320, 0xae588a4b +0, 1, 1, 2, 112320, 0xae588a4b 0, 3, 3, 1, 112320, 0xccdd27b7 diff --git a/tests/ref/fate/gif-gray b/tests/ref/fate/gif-gray index 18705d01fe..aa3969212d 100644 --- a/tests/ref/fate/gif-gray +++ b/tests/ref/fate/gif-gray @@ -3,39 +3,39 @@ #codec_id 0: rawvideo #dimensions 0: 480x360 #sar 0: 0/1 -0, 0, 0, 1, 691200, 0xef6c0f3d -0, 5, 5, 1, 691200, 0xc18b32de -0, 7, 7, 1, 691200, 0x2395a3d7 -0, 9, 9, 1, 691200, 0x81dc3cf2 -0, 11, 11, 1, 691200, 0xabe2390e -0, 13, 13, 1, 691200, 0xb2955c2a -0, 15, 15, 1, 691200, 0x868d9ca2 -0, 17, 17, 1, 691200, 0x3016c2b6 -0, 19, 19, 1, 691200, 0x4501cffa -0, 21, 21, 1, 691200, 0x8661d79e -0, 25, 25, 1, 691200, 0xbc96d02e -0, 27, 27, 1, 691200, 0x5f90bf5e -0, 29, 29, 1, 691200, 0xf18da09a -0, 31, 31, 1, 691200, 0x540467ce -0, 33, 33, 1, 691200, 0x60d24012 -0, 35, 35, 1, 691200, 0x24323d36 -0, 37, 37, 1, 691200, 0x9e07c84b -0, 39, 39, 1, 691200, 0xc18b32de -0, 41, 41, 1, 691200, 0xef6c0f3d -0, 46, 46, 1, 691200, 0xc9461045 -0, 48, 48, 1, 691200, 0x23ed4b99 -0, 50, 50, 1, 691200, 0x7e351d69 -0, 52, 52, 1, 691200, 0x0513e0aa -0, 54, 54, 1, 691200, 0x28a4b6f2 -0, 56, 56, 1, 691200, 0xce10a94e -0, 58, 58, 1, 691200, 0x63929d4e -0, 60, 60, 1, 691200, 0xd26c9bb6 -0, 62, 62, 1, 691200, 0xb2a29842 -0, 66, 66, 1, 691200, 0x9fd69a16 -0, 68, 68, 1, 691200, 0x10f99e46 -0, 70, 70, 1, 691200, 0xea95a9fa -0, 72, 72, 1, 691200, 0x97dbb9d6 -0, 74, 74, 1, 691200, 0xf4e9e2d6 -0, 76, 76, 1, 691200, 0x46b1230d -0, 78, 78, 1, 691200, 0xb4a54ccd -0, 80, 80, 1, 691200, 0x40cc103d +0, 0, 0, 4, 691200, 0xef6c0f3d +0, 5, 5, 2, 691200, 0xc18b32de +0, 7, 7, 2, 691200, 0x2395a3d7 +0, 9, 9, 2, 691200, 0x81dc3cf2 +0, 11, 11, 2, 691200, 0xabe2390e +0, 13, 13, 2, 691200, 0xb2955c2a +0, 15, 15, 2, 691200, 0x868d9ca2 +0, 17, 17, 2, 691200, 0x3016c2b6 +0, 19, 19, 2, 691200, 0x4501cffa +0, 21, 21, 4, 691200, 0x8661d79e +0, 25, 25, 2, 691200, 0xbc96d02e +0, 27, 27, 2, 691200, 0x5f90bf5e +0, 29, 29, 2, 691200, 0xf18da09a +0, 31, 31, 2, 691200, 0x540467ce +0, 33, 33, 2, 691200, 0x60d24012 +0, 35, 35, 2, 691200, 0x24323d36 +0, 37, 37, 2, 691200, 0x9e07c84b +0, 39, 39, 2, 691200, 0xc18b32de +0, 41, 41, 5, 691200, 0xef6c0f3d +0, 46, 46, 2, 691200, 0xc9461045 +0, 48, 48, 2, 691200, 0x23ed4b99 +0, 50, 50, 2, 691200, 0x7e351d69 +0, 52, 52, 2, 691200, 0x0513e0aa +0, 54, 54, 2, 691200, 0x28a4b6f2 +0, 56, 56, 2, 691200, 0xce10a94e +0, 58, 58, 2, 691200, 0x63929d4e +0, 60, 60, 2, 691200, 0xd26c9bb6 +0, 62, 62, 4, 691200, 0xb2a29842 +0, 66, 66, 2, 691200, 0x9fd69a16 +0, 68, 68, 2, 691200, 0x10f99e46 +0, 70, 70, 2, 691200, 0xea95a9fa +0, 72, 72, 2, 691200, 0x97dbb9d6 +0, 74, 74, 2, 691200, 0xf4e9e2d6 +0, 76, 76, 2, 691200, 0x46b1230d +0, 78, 78, 2, 691200, 0xb4a54ccd +0, 80, 80, 2, 691200, 0x40cc103d diff --git a/tests/ref/fate/quickdraw b/tests/ref/fate/quickdraw index 5746929502..44610498c8 100644 --- a/tests/ref/fate/quickdraw +++ b/tests/ref/fate/quickdraw @@ -9,7 +9,7 @@ 0, 3, 3, 1, 921600, 0xc0e68764 0, 4, 4, 1, 921600, 0xc0e68764 0, 5, 5, 1, 921600, 0xc0e68764 -0, 7, 7, 1, 921600, 0x01a16629 +0, 7, 7, 2, 921600, 0x01a16629 0, 9, 9, 1, 921600, 0x01a16629 0, 10, 10, 1, 921600, 0x01a16629 0, 11, 11, 1, 921600, 0x01a16629 -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available Anton Khirnov @ 2023-04-19 20:42 ` James Almer 2023-04-19 21:12 ` Anton Khirnov 2023-04-24 10:22 ` Nicolas George 1 sibling, 1 reply; 44+ messages in thread From: James Almer @ 2023-04-19 20:42 UTC (permalink / raw) To: ffmpeg-devel On 4/19/2023 4:52 PM, Anton Khirnov wrote: > diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c > index e3dc858bc3..9aaec277f1 100644 > --- a/fftools/ffmpeg_enc.c > +++ b/fftools/ffmpeg_enc.c > @@ -1005,24 +1005,17 @@ static void do_video_out(OutputFile *of, > AVRational frame_rate; > int64_t nb_frames, nb_frames_prev, i; > double duration = 0; > - InputStream *ist = ost->ist; > AVFilterContext *filter = ost->filter->filter; > > - frame_rate = av_buffersink_get_frame_rate(filter); > - if (frame_rate.num > 0 && frame_rate.den > 0) > - duration = 1/(av_q2d(frame_rate) * av_q2d(enc->time_base)); > + if (next_picture) > + duration = lrintf(next_picture->duration * av_q2d(next_picture->time_base) / av_q2d(enc->time_base)); llrint(). You're passing it a double argument, and long int is 32 bits on Windows. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available 2023-04-19 20:42 ` James Almer @ 2023-04-19 21:12 ` Anton Khirnov 0 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 21:12 UTC (permalink / raw) To: FFmpeg development discussions and patches Quoting James Almer (2023-04-19 22:42:24) > On 4/19/2023 4:52 PM, Anton Khirnov wrote: > > diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c > > index e3dc858bc3..9aaec277f1 100644 > > --- a/fftools/ffmpeg_enc.c > > +++ b/fftools/ffmpeg_enc.c > > @@ -1005,24 +1005,17 @@ static void do_video_out(OutputFile *of, > > AVRational frame_rate; > > int64_t nb_frames, nb_frames_prev, i; > > double duration = 0; > > - InputStream *ist = ost->ist; > > AVFilterContext *filter = ost->filter->filter; > > > > - frame_rate = av_buffersink_get_frame_rate(filter); > > - if (frame_rate.num > 0 && frame_rate.den > 0) > > - duration = 1/(av_q2d(frame_rate) * av_q2d(enc->time_base)); > > + if (next_picture) > > + duration = lrintf(next_picture->duration * av_q2d(next_picture->time_base) / av_q2d(enc->time_base)); > > llrint(). You're passing it a double argument, and long int is 32 bits > on Windows. I'm just reusing the code as it was before, except for reducing the conditions and using the frame timebase instead of the stream one. Given how fragile this all is, I'd rather not do too many changes at once. The whole rounding step is rather questionable, since the integer result is assigned to a double. But I'd say that belongs in a separate patch. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available Anton Khirnov 2023-04-19 20:42 ` James Almer @ 2023-04-24 10:22 ` Nicolas George 1 sibling, 0 replies; 44+ messages in thread From: Nicolas George @ 2023-04-24 10:22 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 736 bytes --] Anton Khirnov (12023-04-19): > Previously they would only be used with trivial filtergraphs, because > filters did not handle frame durations. That is no longer true - most > filters process frame durations properly (there may still be some that > don't - this change will help finding and fixing them). > > Improves output video frame durations in a number of FATE tests. I do not object to this patch nor the one to concat, but I want to state once again: The authoritative source of information about frame durations in libavfilter, be it internally for the caller, is the timestamp of the next frame, or the timestamp of EOF for the last frame. Filtered frame durations are only a hint. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 05/25] fftools/ffmpeg_enc: rename next_picture to frame 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (2 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 06/25] fftools/ffmpeg_enc: move handling final frames to video_sync_process() Anton Khirnov ` (19 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel The name is misleading, because it is not a picture in the sense of MPEG terminology (which define "picture" as "frame or field"), but always a full frame. 'next' is also redundant and/or misleading, because it is the _current_ frame to be encoded. --- fftools/ffmpeg_enc.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 9aaec277f1..e63da2ec97 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -873,14 +873,14 @@ early_exit: * desired target framerate (if any). */ static void video_sync_process(OutputFile *of, OutputStream *ost, - AVFrame *next_picture, double duration, + AVFrame *frame, double duration, int64_t *nb_frames, int64_t *nb_frames_prev) { Encoder *e = ost->enc; double delta0, delta; - double sync_ipts = adjust_frame_pts_to_encoder_tb(of, ost, next_picture); - /* delta0 is the "drift" between the input frame (next_picture) and + double sync_ipts = adjust_frame_pts_to_encoder_tb(of, ost, frame); + /* delta0 is the "drift" between the input frame and * where it would fall in the output. */ delta0 = sync_ipts - e->next_pts; delta = delta0 + duration; @@ -923,18 +923,18 @@ static void video_sync_process(OutputFile *of, OutputStream *ost, if (delta0 > 1.1) *nb_frames_prev = llrintf(delta0 - 0.6); } - next_picture->duration = 1; + frame->duration = 1; break; case VSYNC_VFR: if (delta <= -0.6) *nb_frames = 0; else if (delta > 0.6) e->next_pts = llrint(sync_ipts); - next_picture->duration = duration; + frame->duration = duration; break; case VSYNC_DROP: case VSYNC_PASSTHROUGH: - next_picture->duration = duration; + frame->duration = duration; e->next_pts = llrint(sync_ipts); break; default: @@ -994,10 +994,8 @@ force_keyframe: return AV_PICTURE_TYPE_I; } -/* May modify/reset next_picture */ -static void do_video_out(OutputFile *of, - OutputStream *ost, - AVFrame *next_picture) +/* May modify/reset frame */ +static void do_video_out(OutputFile *of, OutputStream *ost, AVFrame *frame) { int ret; Encoder *e = ost->enc; @@ -1007,8 +1005,8 @@ static void do_video_out(OutputFile *of, double duration = 0; AVFilterContext *filter = ost->filter->filter; - if (next_picture) - duration = lrintf(next_picture->duration * av_q2d(next_picture->time_base) / av_q2d(enc->time_base)); + if (frame) + duration = lrintf(frame->duration * av_q2d(frame->time_base) / av_q2d(enc->time_base)); if (duration <= 0 && ost->frame_rate.num) duration = FFMIN(duration, 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base))); @@ -1017,13 +1015,13 @@ static void do_video_out(OutputFile *of, if (duration <= 0 && frame_rate.num > 0 && frame_rate.den > 0) duration = 1/(av_q2d(frame_rate) * av_q2d(enc->time_base)); - if (!next_picture) { + if (!frame) { //end, flushing nb_frames_prev = nb_frames = mid_pred(e->frames_prev_hist[0], e->frames_prev_hist[1], e->frames_prev_hist[2]); } else { - video_sync_process(of, ost, next_picture, duration, + video_sync_process(of, ost, frame, duration, &nb_frames, &nb_frames_prev); } @@ -1051,8 +1049,8 @@ static void do_video_out(OutputFile *of, dup_warning *= 10; } } - ost->last_dropped = nb_frames == nb_frames_prev && next_picture; - ost->kf.dropped_keyframe = ost->last_dropped && next_picture && next_picture->key_frame; + ost->last_dropped = nb_frames == nb_frames_prev && frame; + ost->kf.dropped_keyframe = ost->last_dropped && frame && frame->key_frame; /* duplicates frame if needed */ for (i = 0; i < nb_frames; i++) { @@ -1061,7 +1059,7 @@ static void do_video_out(OutputFile *of, if (i < nb_frames_prev && e->last_frame->buf[0]) { in_picture = e->last_frame; } else - in_picture = next_picture; + in_picture = frame; if (!in_picture) return; @@ -1085,8 +1083,8 @@ static void do_video_out(OutputFile *of, } av_frame_unref(e->last_frame); - if (next_picture) - av_frame_move_ref(e->last_frame, next_picture); + if (frame) + av_frame_move_ref(e->last_frame, frame); } void enc_frame(OutputStream *ost, AVFrame *frame) -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 06/25] fftools/ffmpeg_enc: move handling final frames to video_sync_process() 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (3 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 05/25] fftools/ffmpeg_enc: rename next_picture to frame Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 07/25] fftools/ffmpeg: stop using InputStream.pts in ts_discontinuity_detect() Anton Khirnov ` (18 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel This code properly belongs there. --- fftools/ffmpeg_enc.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index e63da2ec97..859c7fdeee 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -877,9 +877,16 @@ static void video_sync_process(OutputFile *of, OutputStream *ost, int64_t *nb_frames, int64_t *nb_frames_prev) { Encoder *e = ost->enc; - double delta0, delta; + double delta0, delta, sync_ipts; - double sync_ipts = adjust_frame_pts_to_encoder_tb(of, ost, frame); + if (!frame) { + *nb_frames_prev = *nb_frames = mid_pred(e->frames_prev_hist[0], + e->frames_prev_hist[1], + e->frames_prev_hist[2]); + goto finish; + } + + sync_ipts = adjust_frame_pts_to_encoder_tb(of, ost, frame); /* delta0 is the "drift" between the input frame and * where it would fall in the output. */ delta0 = sync_ipts - e->next_pts; @@ -940,6 +947,12 @@ static void video_sync_process(OutputFile *of, OutputStream *ost, default: av_assert0(0); } + +finish: + memmove(e->frames_prev_hist + 1, + e->frames_prev_hist, + sizeof(e->frames_prev_hist[0]) * (FF_ARRAY_ELEMS(e->frames_prev_hist) - 1)); + e->frames_prev_hist[0] = *nb_frames_prev; } static enum AVPictureType forced_kf_apply(void *logctx, KeyframeForceCtx *kf, @@ -1015,20 +1028,8 @@ static void do_video_out(OutputFile *of, OutputStream *ost, AVFrame *frame) if (duration <= 0 && frame_rate.num > 0 && frame_rate.den > 0) duration = 1/(av_q2d(frame_rate) * av_q2d(enc->time_base)); - if (!frame) { - //end, flushing - nb_frames_prev = nb_frames = mid_pred(e->frames_prev_hist[0], - e->frames_prev_hist[1], - e->frames_prev_hist[2]); - } else { - video_sync_process(of, ost, frame, duration, - &nb_frames, &nb_frames_prev); - } - - memmove(e->frames_prev_hist + 1, - e->frames_prev_hist, - sizeof(e->frames_prev_hist[0]) * (FF_ARRAY_ELEMS(e->frames_prev_hist) - 1)); - e->frames_prev_hist[0] = nb_frames_prev; + video_sync_process(of, ost, frame, duration, + &nb_frames, &nb_frames_prev); if (nb_frames_prev == 0 && ost->last_dropped) { nb_frames_drop++; -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 07/25] fftools/ffmpeg: stop using InputStream.pts in ts_discontinuity_detect() 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (4 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 06/25] fftools/ffmpeg_enc: move handling final frames to video_sync_process() Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 08/25] fftools/ffmpeg: stop setting InputStream.pts for streamcopy Anton Khirnov ` (17 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel ts_discontinuity_detect() is applied right after demuxing, while InputStream.pts is a post-decoding timestamp, which may be delayed with respect to demuxing by an arbitrary amount (e.g. depending on the thread count when frame threading is used). --- fftools/ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index a7e856e9e2..cc087ea7de 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2121,7 +2121,7 @@ static void ts_discontinuity_detect(InputFile *ifile, InputStream *ist, int64_t delta = pkt_dts - ist->next_dts; if (fmt_is_discont) { if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE || - pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) { + pkt_dts + AV_TIME_BASE/10 < ist->dts) { ifile->ts_offset_discont -= delta; av_log(NULL, AV_LOG_WARNING, "timestamp discontinuity for stream #%d:%d " -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 08/25] fftools/ffmpeg: stop setting InputStream.pts for streamcopy 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (5 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 07/25] fftools/ffmpeg: stop using InputStream.pts in ts_discontinuity_detect() Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 09/25] fftools/ffmpeg: replace stream timebase with packet one where appropriate Anton Khirnov ` (16 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel It is not used in that case anymore. Forgotten in d56652fdc8e1315309516be320a7250854550fa5. --- fftools/ffmpeg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index cc087ea7de..f2e9832003 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1743,7 +1743,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo } break; } - ist->pts = ist->dts; } else if (!ist->decoding_needed) eof_reached = 1; -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 09/25] fftools/ffmpeg: replace stream timebase with packet one where appropriate 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (6 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 08/25] fftools/ffmpeg: stop setting InputStream.pts for streamcopy Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 10/25] fftools/ffmpeg_mux_init: consolidate handling -filter for audio/video Anton Khirnov ` (15 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index f2e9832003..e6ee3ce557 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1146,7 +1146,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output, decoded_frame_tb = ist->st->time_base; } else if (pkt && pkt->pts != AV_NOPTS_VALUE) { decoded_frame->pts = pkt->pts; - decoded_frame_tb = ist->st->time_base; + decoded_frame_tb = pkt->time_base; }else { decoded_frame->pts = ist->dts; decoded_frame_tb = AV_TIME_BASE_Q; @@ -1583,7 +1583,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo ist->pts = 0; if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) { ist->first_dts = - ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); + ist->dts += av_rescale_q(pkt->pts, pkt->time_base, AV_TIME_BASE_Q); } ist->saw_first_ts = 1; } @@ -1601,7 +1601,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo } if (pkt && pkt->dts != AV_NOPTS_VALUE) { - ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); + ist->next_dts = ist->dts = av_rescale_q(pkt->dts, pkt->time_base, AV_TIME_BASE_Q); if (par->codec_type != AVMEDIA_TYPE_VIDEO) ist->pts = ist->dts; } @@ -1627,7 +1627,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo &decode_failed); if (!repeating || !pkt || got_output) { if (pkt && pkt->duration) { - duration_dts = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); + duration_dts = av_rescale_q(pkt->duration, pkt->time_base, AV_TIME_BASE_Q); } else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) { int ticks = ist->last_pkt_repeat_pict >= 0 ? ist->last_pkt_repeat_pict + 1 : @@ -1722,7 +1722,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo ist->next_dts += ((int64_t)AV_TIME_BASE * par->frame_size) / par->sample_rate; } else { - ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); + ist->next_dts += av_rescale_q(pkt->duration, pkt->time_base, AV_TIME_BASE_Q); } break; case AVMEDIA_TYPE_VIDEO: @@ -1732,7 +1732,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo int64_t next_dts = av_rescale_q(ist->next_dts, time_base_q, av_inv_q(ist->framerate)); ist->next_dts = av_rescale_q(next_dts + 1, av_inv_q(ist->framerate), time_base_q); } else if (pkt->duration) { - ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); + ist->next_dts += av_rescale_q(pkt->duration, pkt->time_base, AV_TIME_BASE_Q); } else if(ist->dec_ctx->framerate.num != 0) { int ticks = ist->last_pkt_repeat_pict >= 0 ? ist->last_pkt_repeat_pict + 1 : @@ -2104,13 +2104,13 @@ static void ts_discontinuity_detect(InputFile *ifile, InputStream *ist, { const int fmt_is_discont = ifile->ctx->iformat->flags & AVFMT_TS_DISCONT; int disable_discontinuity_correction = copy_ts; - int64_t pkt_dts = av_rescale_q_rnd(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q, + int64_t pkt_dts = av_rescale_q_rnd(pkt->dts, pkt->time_base, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); if (copy_ts && ist->next_dts != AV_NOPTS_VALUE && fmt_is_discont && ist->st->pts_wrap_bits < 60) { int64_t wrap_dts = av_rescale_q_rnd(pkt->dts + (1LL<<ist->st->pts_wrap_bits), - ist->st->time_base, AV_TIME_BASE_Q, + pkt->time_base, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); if (FFABS(wrap_dts - ist->next_dts) < FFABS(pkt_dts - ist->next_dts)/10) disable_discontinuity_correction = 0; @@ -2128,9 +2128,9 @@ static void ts_discontinuity_detect(InputFile *ifile, InputStream *ist, ist->file_index, ist->st->index, ist->st->id, av_get_media_type_string(ist->par->codec_type), delta, ifile->ts_offset_discont); - pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); + pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, pkt->time_base); if (pkt->pts != AV_NOPTS_VALUE) - pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); + pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, pkt->time_base); } } else { if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) { @@ -2138,7 +2138,7 @@ static void ts_discontinuity_detect(InputFile *ifile, InputStream *ist, pkt->dts = AV_NOPTS_VALUE; } if (pkt->pts != AV_NOPTS_VALUE){ - int64_t pkt_pts = av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); + int64_t pkt_pts = av_rescale_q(pkt->pts, pkt->time_base, AV_TIME_BASE_Q); delta = pkt_pts - ist->next_dts; if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) { av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n", pkt->pts, ist->next_dts, pkt->stream_index); @@ -2154,20 +2154,20 @@ static void ts_discontinuity_detect(InputFile *ifile, InputStream *ist, av_log(NULL, AV_LOG_DEBUG, "Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", delta, ifile->ts_offset_discont); - pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); + pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, pkt->time_base); if (pkt->pts != AV_NOPTS_VALUE) - pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); + pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, pkt->time_base); } } - ifile->last_ts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); + ifile->last_ts = av_rescale_q(pkt->dts, pkt->time_base, AV_TIME_BASE_Q); } static void ts_discontinuity_process(InputFile *ifile, InputStream *ist, AVPacket *pkt) { int64_t offset = av_rescale_q(ifile->ts_offset_discont, AV_TIME_BASE_Q, - ist->st->time_base); + pkt->time_base); // apply previously-detected timestamp-discontinuity offset // (to all streams, not just audio/video) @@ -2275,9 +2275,9 @@ static int process_input(int file_index) av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n", ifile->index, pkt->stream_index, av_get_media_type_string(ist->par->codec_type), - av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->st->time_base), - av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->st->time_base), - av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ist->st->time_base), + av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &pkt->time_base), + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &pkt->time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &pkt->time_base), av_ts2str(input_files[ist->file_index]->ts_offset), av_ts2timestr(input_files[ist->file_index]->ts_offset, &AV_TIME_BASE_Q)); } -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 10/25] fftools/ffmpeg_mux_init: consolidate handling -filter for audio/video 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (7 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 09/25] fftools/ffmpeg: replace stream timebase with packet one where appropriate Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 11/25] fftools/ffmpeg_mux_init: move check for mixing simple/complex filters Anton Khirnov ` (14 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg_mux_init.c | 68 +++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 89c0ac90ea..7c35d6b582 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -420,33 +420,36 @@ static MuxStream *mux_stream_alloc(Muxer *mux, enum AVMediaType type) return ms; } -static char *get_ost_filters(const OptionsContext *o, AVFormatContext *oc, - OutputStream *ost) +static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc, + OutputStream *ost) { + MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, ost->st); + MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, ost->st); + + if (!ost->enc) { + if (ost->filters_script || ost->filters) { + av_log(ost, AV_LOG_ERROR, + "%s '%s' was specified, but codec copy was selected. " + "Filtering and streamcopy cannot be used together.\n", + ost->filters ? "Filtergraph" : "Filtergraph script", + ost->filters ? ost->filters : ost->filters_script); + return AVERROR(ENOSYS); + } + return 0; + } + if (ost->filters_script && ost->filters) { av_log(ost, AV_LOG_ERROR, "Both -filter and -filter_script set\n"); exit_program(1); } if (ost->filters_script) - return file_read(ost->filters_script); + ost->avfilter = file_read(ost->filters_script); else if (ost->filters) - return av_strdup(ost->filters); - - return av_strdup(ost->type == AVMEDIA_TYPE_VIDEO ? "null" : "anull"); -} - -static void check_streamcopy_filters(const OptionsContext *o, AVFormatContext *oc, - OutputStream *ost, enum AVMediaType type) -{ - if (ost->filters_script || ost->filters) { - av_log(ost, AV_LOG_ERROR, - "%s '%s' was defined, but codec copy was selected.\n" - "Filtering and streamcopy cannot be used together.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script); - exit_program(1); - } + ost->avfilter = av_strdup(ost->filters); + else + ost->avfilter = av_strdup(ost->type == AVMEDIA_TYPE_VIDEO ? "null" : "anull"); + return ost->avfilter ? 0 : AVERROR(ENOMEM); } static void parse_matrix_coeffs(void *logctx, uint16_t *dest, const char *str) @@ -504,9 +507,6 @@ static void new_stream_video(Muxer *mux, const OptionsContext *o, ost->frame_aspect_ratio = q; } - MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st); - MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st); - if (ost->enc_ctx) { AVCodecContext *video_enc = ost->enc_ctx; const char *p = NULL, *fps_mode = NULL; @@ -692,12 +692,7 @@ static void new_stream_video(Muxer *mux, const OptionsContext *o, } } ost->is_cfr = (ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR); - - ost->avfilter = get_ost_filters(o, oc, ost); - if (!ost->avfilter) - exit_program(1); - } else - check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_VIDEO); + } } static void new_stream_audio(Muxer *mux, const OptionsContext *o, @@ -708,10 +703,6 @@ static void new_stream_audio(Muxer *mux, const OptionsContext *o, st = ost->st; - - MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st); - MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st); - if (ost->enc_ctx) { AVCodecContext *audio_enc = ost->enc_ctx; int channels = 0; @@ -757,10 +748,6 @@ static void new_stream_audio(Muxer *mux, const OptionsContext *o, MATCH_PER_STREAM_OPT(apad, str, ost->apad, oc, st); ost->apad = av_strdup(ost->apad); - ost->avfilter = get_ost_filters(o, oc, ost); - if (!ost->avfilter) - exit_program(1); - #if FFMPEG_OPT_MAP_CHANNEL /* check for channel mapping for this audio stream */ for (int n = 0; n < o->nb_audio_channel_maps; n++) { @@ -791,8 +778,7 @@ static void new_stream_audio(Muxer *mux, const OptionsContext *o, } } #endif - } else - check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_AUDIO); + } } static void new_stream_data(Muxer *mux, const OptionsContext *o, @@ -1223,6 +1209,12 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, default: new_stream_unknown (mux, o, ost); break; } + if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO) { + ret = ost_get_filters(o, oc, ost); + if (ret < 0) + exit_program(1); + } + if (ost->ist) { if (ost->enc && (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) { -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 11/25] fftools/ffmpeg_mux_init: move check for mixing simple/complex filters 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (8 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 10/25] fftools/ffmpeg_mux_init: consolidate handling -filter for audio/video Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 12/25] fftools/ffmpeg_mux_init: drop OutputStream.filters[_script] Anton Khirnov ` (13 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel Do it in ost_get_filters() together with other similar checks. Will be useful in following commits. Also, improve the log message. --- fftools/ffmpeg_mux_init.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 7c35d6b582..c82556a706 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -438,6 +438,19 @@ static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc, return 0; } + if (!ost->ist) { + if (ost->filters_script || ost->filters) { + av_log(ost, AV_LOG_ERROR, + "%s '%s' was specified for a stream fed from a complex " + "filtergraph. Simple and complex filtering cannot be used " + "together for the same stream.\n", + ost->filters ? "Filtergraph" : "Filtergraph script", + ost->filters ? ost->filters : ost->filters_script); + return AVERROR(EINVAL); + } + return 0; + } + if (ost->filters_script && ost->filters) { av_log(ost, AV_LOG_ERROR, "Both -filter and -filter_script set\n"); exit_program(1); @@ -1263,18 +1276,6 @@ static void init_output_filter(OutputFilter *ofilter, const OptionsContext *o, exit_program(1); } - if (ost->avfilter && (ost->filters || ost->filters_script)) { - const char *opt = ost->filters ? "-vf/-af/-filter" : "-filter_script"; - av_log(ost, AV_LOG_ERROR, - "%s '%s' was specified through the %s option " - "for output stream %d:%d, which is fed from a complex filtergraph.\n" - "%s and -filter_complex cannot be used together for the same stream.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script, - opt, ost->file_index, ost->index, opt); - exit_program(1); - } - avfilter_inout_free(&ofilter->out_tmp); } -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 12/25] fftools/ffmpeg_mux_init: drop OutputStream.filters[_script] 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (9 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 11/25] fftools/ffmpeg_mux_init: move check for mixing simple/complex filters Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 13/25] fftools/ffmpeg: remove unused function arguments Anton Khirnov ` (12 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel They are not needed outside of ost_get_filters(), so make them stack variables there. --- fftools/ffmpeg.h | 2 -- fftools/ffmpeg_mux_init.c | 28 +++++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 72020c8f3a..c9d499efdd 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -639,8 +639,6 @@ typedef struct OutputStream { OutputFilter *filter; char *avfilter; - char *filters; ///< filtergraph associated to the -filter option - char *filters_script; ///< filtergraph script associated to the -filter_script option AVDictionary *encoder_opts; AVDictionary *sws_dict; diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index c82556a706..da3dccd6d7 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -423,43 +423,45 @@ static MuxStream *mux_stream_alloc(Muxer *mux, enum AVMediaType type) static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc, OutputStream *ost) { - MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, ost->st); - MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, ost->st); + const char *filters = NULL, *filters_script = NULL; + + MATCH_PER_STREAM_OPT(filter_scripts, str, filters_script, oc, ost->st); + MATCH_PER_STREAM_OPT(filters, str, filters, oc, ost->st); if (!ost->enc) { - if (ost->filters_script || ost->filters) { + if (filters_script || filters) { av_log(ost, AV_LOG_ERROR, "%s '%s' was specified, but codec copy was selected. " "Filtering and streamcopy cannot be used together.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script); + filters ? "Filtergraph" : "Filtergraph script", + filters ? filters : filters_script); return AVERROR(ENOSYS); } return 0; } if (!ost->ist) { - if (ost->filters_script || ost->filters) { + if (filters_script || filters) { av_log(ost, AV_LOG_ERROR, "%s '%s' was specified for a stream fed from a complex " "filtergraph. Simple and complex filtering cannot be used " "together for the same stream.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script); + filters ? "Filtergraph" : "Filtergraph script", + filters ? filters : filters_script); return AVERROR(EINVAL); } return 0; } - if (ost->filters_script && ost->filters) { + if (filters_script && filters) { av_log(ost, AV_LOG_ERROR, "Both -filter and -filter_script set\n"); exit_program(1); } - if (ost->filters_script) - ost->avfilter = file_read(ost->filters_script); - else if (ost->filters) - ost->avfilter = av_strdup(ost->filters); + if (filters_script) + ost->avfilter = file_read(filters_script); + else if (filters) + ost->avfilter = av_strdup(filters); else ost->avfilter = av_strdup(ost->type == AVMEDIA_TYPE_VIDEO ? "null" : "anull"); return ost->avfilter ? 0 : AVERROR(ENOMEM); -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 13/25] fftools/ffmpeg: remove unused function arguments 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (10 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 12/25] fftools/ffmpeg_mux_init: drop OutputStream.filters[_script] Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 14/25] fftools/ffmpeg_mux_init: drop useless new_stream_{data, unknown} Anton Khirnov ` (11 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg_mux.c | 4 ++-- fftools/ffmpeg_mux_init.c | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index a2e8873ad2..368a7000a9 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -255,7 +255,7 @@ finish: return ret == AVERROR_EOF ? 0 : ret; } -static int queue_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt) +static int queue_packet(OutputStream *ost, AVPacket *pkt) { MuxStream *ms = ms_from_ost(ost); AVPacket *tmp_pkt = NULL; @@ -305,7 +305,7 @@ static int submit_packet(Muxer *mux, AVPacket *pkt, OutputStream *ost) return thread_submit_packet(mux, ost, pkt); } else { /* the muxer is not initialized yet, buffer the packet */ - ret = queue_packet(mux, ost, pkt); + ret = queue_packet(ost, pkt); if (ret < 0) { if (pkt) av_packet_unref(pkt); diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index da3dccd6d7..59d9a12c1a 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -839,8 +839,7 @@ static void new_stream_subtitle(Muxer *mux, const OptionsContext *o, } } -static int streamcopy_init(const Muxer *mux, const OptionsContext *o, - OutputStream *ost) +static int streamcopy_init(const Muxer *mux, OutputStream *ost) { MuxStream *ms = ms_from_ost(ost); @@ -1244,7 +1243,7 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, } if (ost->ist && !ost->enc) { - ret = streamcopy_init(mux, o, ost); + ret = streamcopy_init(mux, ost); if (ret < 0) exit_program(1); } @@ -1946,7 +1945,7 @@ static int copy_chapters(InputFile *ifile, OutputFile *ofile, AVFormatContext *o static int copy_metadata(Muxer *mux, AVFormatContext *ic, const char *outspec, const char *inspec, int *metadata_global_manual, int *metadata_streams_manual, - int *metadata_chapters_manual, const OptionsContext *o) + int *metadata_chapters_manual) { AVFormatContext *oc = mux->fc; AVDictionary **meta_in = NULL; @@ -2050,7 +2049,7 @@ static void copy_meta(Muxer *mux, const OptionsContext *o) in_file_index >= 0 ? input_files[in_file_index]->ctx : NULL, o->metadata_map[i].specifier, *p ? p + 1 : p, &metadata_global_manual, &metadata_streams_manual, - &metadata_chapters_manual, o); + &metadata_chapters_manual); } /* copy chapters */ -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 14/25] fftools/ffmpeg_mux_init: drop useless new_stream_{data, unknown} 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (11 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 13/25] fftools/ffmpeg: remove unused function arguments Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 15/25] fftools/ffmpeg: reindent after previous commit Anton Khirnov ` (10 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel Their only function is checking that encoding was not specified for data/unknown-type streams, but the check is broken because enc_ctx will not be created in ost_add() unless a valid encoder can be found. Add an actually working check for all types for which encoding is not supported in choose_encoder(). --- fftools/ffmpeg_mux_init.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 59d9a12c1a..28254cb49b 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -113,8 +113,21 @@ static int choose_encoder(const OptionsContext *o, AVFormatContext *s, *enc = NULL; - if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO || type == AVMEDIA_TYPE_SUBTITLE) { - MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, ost->st); + MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, ost->st); + + if (type != AVMEDIA_TYPE_VIDEO && + type != AVMEDIA_TYPE_AUDIO && + type != AVMEDIA_TYPE_SUBTITLE) { + if (codec_name && strcmp(codec_name, "copy")) { + const char *type_str = av_get_media_type_string(type); + av_log(ost, AV_LOG_FATAL, + "Encoder '%s' specified, but only '-codec copy' supported " + "for %s streams\n", codec_name, type_str); + return AVERROR(ENOSYS); + } + return 0; + } + if (!codec_name) { ost->par_in->codec_id = av_guess_codec(s->oformat, NULL, s->url, NULL, ost->type); @@ -130,7 +143,6 @@ static int choose_encoder(const OptionsContext *o, AVFormatContext *s, *enc = find_codec_or_die(ost, codec_name, ost->type, 1); ost->par_in->codec_id = (*enc)->id; } - } return 0; } @@ -796,24 +808,6 @@ static void new_stream_audio(Muxer *mux, const OptionsContext *o, } } -static void new_stream_data(Muxer *mux, const OptionsContext *o, - OutputStream *ost) -{ - if (ost->enc_ctx) { - av_log(ost, AV_LOG_FATAL, "Data stream encoding not supported yet (only streamcopy)\n"); - exit_program(1); - } -} - -static void new_stream_unknown(Muxer *mux, const OptionsContext *o, - OutputStream *ost) -{ - if (ost->enc_ctx) { - av_log(ost, AV_LOG_FATAL, "Unknown stream encoding not supported yet (only streamcopy)\n"); - exit_program(1); - } -} - static void new_stream_attachment(Muxer *mux, const OptionsContext *o, OutputStream *ost) { @@ -1218,9 +1212,7 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, case AVMEDIA_TYPE_VIDEO: new_stream_video (mux, o, ost); break; case AVMEDIA_TYPE_AUDIO: new_stream_audio (mux, o, ost); break; case AVMEDIA_TYPE_SUBTITLE: new_stream_subtitle (mux, o, ost); break; - case AVMEDIA_TYPE_DATA: new_stream_data (mux, o, ost); break; case AVMEDIA_TYPE_ATTACHMENT: new_stream_attachment(mux, o, ost); break; - default: new_stream_unknown (mux, o, ost); break; } if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO) { -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 15/25] fftools/ffmpeg: reindent after previous commit 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (12 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 14/25] fftools/ffmpeg_mux_init: drop useless new_stream_{data, unknown} Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 16/25] fftools/ffmpeg_filter: add a function for creating a filtergraph Anton Khirnov ` (9 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg_mux_init.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 28254cb49b..ad5a451581 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -128,21 +128,20 @@ static int choose_encoder(const OptionsContext *o, AVFormatContext *s, return 0; } - if (!codec_name) { - ost->par_in->codec_id = av_guess_codec(s->oformat, NULL, s->url, - NULL, ost->type); - *enc = avcodec_find_encoder(ost->par_in->codec_id); - if (!*enc) { - av_log(ost, AV_LOG_FATAL, "Automatic encoder selection failed " - "Default encoder for format %s (codec %s) is " - "probably disabled. Please choose an encoder manually.\n", - s->oformat->name, avcodec_get_name(ost->par_in->codec_id)); - return AVERROR_ENCODER_NOT_FOUND; - } - } else if (strcmp(codec_name, "copy")) { - *enc = find_codec_or_die(ost, codec_name, ost->type, 1); - ost->par_in->codec_id = (*enc)->id; - } + if (!codec_name) { + ost->par_in->codec_id = av_guess_codec(s->oformat, NULL, s->url, NULL, ost->type); + *enc = avcodec_find_encoder(ost->par_in->codec_id); + if (!*enc) { + av_log(ost, AV_LOG_FATAL, "Automatic encoder selection failed " + "Default encoder for format %s (codec %s) is " + "probably disabled. Please choose an encoder manually.\n", + s->oformat->name, avcodec_get_name(ost->par_in->codec_id)); + return AVERROR_ENCODER_NOT_FOUND; + } + } else if (strcmp(codec_name, "copy")) { + *enc = find_codec_or_die(ost, codec_name, ost->type, 1); + ost->par_in->codec_id = (*enc)->id; + } return 0; } -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 16/25] fftools/ffmpeg_filter: add a function for creating a filtergraph 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (13 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 15/25] fftools/ffmpeg: reindent after previous commit Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 17/25] fftools/ffmpeg_mux_init: drop a redundant assignment Anton Khirnov ` (8 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel Code creating a new filtergraph is currently duplicated in 3 places. This commit unifies it and moves towards making filtergraphs more self-contained. --- fftools/ffmpeg.h | 8 ++++++++ fftools/ffmpeg_filter.c | 18 +++++++++++++----- fftools/ffmpeg_opt.c | 14 +++++--------- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index c9d499efdd..b181d433b0 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -803,6 +803,14 @@ int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame); int ifilter_parameters_from_codecpar(InputFilter *ifilter, AVCodecParameters *par); int ifilter_has_all_input_formats(FilterGraph *fg); +/** + * Create a new filtergraph in the global filtergraph list. + * + * @param graph_desc Graph description; an av_malloc()ed string, filtergraph + * takes ownership of it. + */ +FilterGraph *fg_create(char *graph_desc); + int ffmpeg_parse_options(int argc, char **argv); void enc_stats_write(OutputStream *ost, EncStats *es, diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index ea182089b1..7b3d9a490f 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -188,15 +188,26 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg) return ofilter; } +FilterGraph *fg_create(char *graph_desc) +{ + FilterGraph *fg; + + fg = ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); + fg->index = nb_filtergraphs - 1; + fg->graph_desc = graph_desc; + + return fg; +} + int init_simple_filtergraph(InputStream *ist, OutputStream *ost) { - FilterGraph *fg = av_mallocz(sizeof(*fg)); + FilterGraph *fg; OutputFilter *ofilter; InputFilter *ifilter; + fg = fg_create(NULL); if (!fg) report_and_exit(AVERROR(ENOMEM)); - fg->index = nb_filtergraphs; ofilter = ofilter_alloc(fg); ofilter->ost = ost; @@ -212,9 +223,6 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost) if (!ifilter->frame_queue) report_and_exit(AVERROR(ENOMEM)); - GROW_ARRAY(filtergraphs, nb_filtergraphs); - filtergraphs[nb_filtergraphs - 1] = fg; - ist_filter_add(ist, ifilter, 1); return 0; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index aa9aa0e9b4..408ef121b7 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1106,26 +1106,22 @@ static int opt_audio_qscale(void *optctx, const char *opt, const char *arg) static int opt_filter_complex(void *optctx, const char *opt, const char *arg) { - FilterGraph *fg = ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); - - fg->index = nb_filtergraphs - 1; - fg->graph_desc = av_strdup(arg); - if (!fg->graph_desc) + char *graph_desc = av_strdup(arg); + if (!graph_desc) return AVERROR(ENOMEM); + fg_create(graph_desc); + return 0; } static int opt_filter_complex_script(void *optctx, const char *opt, const char *arg) { - FilterGraph *fg; char *graph_desc = file_read(arg); if (!graph_desc) return AVERROR(EINVAL); - fg = ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); - fg->index = nb_filtergraphs - 1; - fg->graph_desc = graph_desc; + fg_create(graph_desc); return 0; } -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 17/25] fftools/ffmpeg_mux_init: drop a redundant assignment 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (14 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 16/25] fftools/ffmpeg_filter: add a function for creating a filtergraph Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 18/25] fftools/ffmpeg: simplify init_output_filter() Anton Khirnov ` (7 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel OutputFilter.format is initialized in ofilter_alloc(). --- fftools/ffmpeg_mux_init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index ad5a451581..1a63908074 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1259,7 +1259,6 @@ static void init_output_filter(OutputFilter *ofilter, const OptionsContext *o, ost->filter = ofilter; ofilter->ost = ost; - ofilter->format = -1; if (!ost->enc_ctx) { av_log(ost, AV_LOG_ERROR, "Streamcopy requested for output stream fed " -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 18/25] fftools/ffmpeg: simplify init_output_filter() 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (15 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 17/25] fftools/ffmpeg_mux_init: drop a redundant assignment Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 19/25] fftools/ffmpeg_mux_init: rename init_output_filter() to ost_add_from_filter() Anton Khirnov ` (6 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg_mux_init.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 1a63908074..db1f9fa9a6 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1245,16 +1245,7 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, static void init_output_filter(OutputFilter *ofilter, const OptionsContext *o, Muxer *mux) { - OutputStream *ost; - - switch (ofilter->type) { - case AVMEDIA_TYPE_VIDEO: ost = ost_add(mux, o, AVMEDIA_TYPE_VIDEO, NULL); break; - case AVMEDIA_TYPE_AUDIO: ost = ost_add(mux, o, AVMEDIA_TYPE_AUDIO, NULL); break; - default: - av_log(mux, AV_LOG_FATAL, "Only video and audio filters are supported " - "currently.\n"); - exit_program(1); - } + OutputStream *ost = ost_add(mux, o, ofilter->type, NULL); ost->filter = ofilter; -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 19/25] fftools/ffmpeg_mux_init: rename init_output_filter() to ost_add_from_filter() 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (16 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 18/25] fftools/ffmpeg: simplify init_output_filter() Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 20/25] fftools/ffmpeg: move filtering functions to ffmpeg_filter Anton Khirnov ` (5 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel The previous name is misleading, because the function does not actually initialize any filters - it creates a new output stream and binds a filtergraph output to it. --- fftools/ffmpeg_mux_init.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index db1f9fa9a6..7a2db9f0e8 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1242,7 +1242,8 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, return ost; } -static void init_output_filter(OutputFilter *ofilter, const OptionsContext *o, +// add a new output stream fed by the provided filtergraph output +static void ost_add_from_filter(OutputFilter *ofilter, const OptionsContext *o, Muxer *mux) { OutputStream *ost = ost_add(mux, o, ofilter->type, NULL); @@ -1438,7 +1439,7 @@ loop_end: "in any defined filter graph, or was already used elsewhere.\n", map->linklabel); exit_program(1); } - init_output_filter(ofilter, o, mux); + ost_add_from_filter(ofilter, o, mux); } else { ist = input_files[map->file_index]->streams[map->stream_index]; if (ist->user_set_discard == AVDISCARD_ALL) { @@ -1537,7 +1538,7 @@ static void create_streams(Muxer *mux, const OptionsContext *o) case AVMEDIA_TYPE_AUDIO: auto_disable_a = 1; break; case AVMEDIA_TYPE_SUBTITLE: auto_disable_s = 1; break; } - init_output_filter(ofilter, o, mux); + ost_add_from_filter(ofilter, o, mux); } } -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 20/25] fftools/ffmpeg: move filtering functions to ffmpeg_filter 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (17 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 19/25] fftools/ffmpeg_mux_init: rename init_output_filter() to ost_add_from_filter() Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 21/25] fftools/ffmpeg: move freeing a filtergraph into a separate function Anton Khirnov ` (4 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg.c | 216 +--------------------------------------- fftools/ffmpeg.h | 20 ++++ fftools/ffmpeg_filter.c | 202 +++++++++++++++++++++++++++++++++++++ 3 files changed, 223 insertions(+), 215 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e6ee3ce557..248c22a4ff 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -651,66 +651,6 @@ void close_output_stream(OutputStream *ost) sq_send(of->sq_encode, ost->sq_idx_encode, SQFRAME(NULL)); } -/** - * Get and encode new output from any of the filtergraphs, without causing - * activity. - * - * @return 0 for success, <0 for severe errors - */ -static int reap_filters(int flush) -{ - AVFrame *filtered_frame = NULL; - - /* Reap all buffers present in the buffer sinks */ - for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { - AVFilterContext *filter; - int ret = 0; - - if (!ost->filter || !ost->filter->graph->graph) - continue; - filter = ost->filter->filter; - - filtered_frame = ost->filtered_frame; - - while (1) { - ret = av_buffersink_get_frame_flags(filter, filtered_frame, - AV_BUFFERSINK_FLAG_NO_REQUEST); - if (ret < 0) { - if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) { - av_log(NULL, AV_LOG_WARNING, - "Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret)); - } else if (flush && ret == AVERROR_EOF) { - if (av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO) - enc_frame(ost, NULL); - } - break; - } - if (ost->finished) { - av_frame_unref(filtered_frame); - continue; - } - - if (filtered_frame->pts != AV_NOPTS_VALUE) { - AVRational tb = av_buffersink_get_time_base(filter); - ost->filter->last_pts = av_rescale_q(filtered_frame->pts, tb, - AV_TIME_BASE_Q); - filtered_frame->time_base = tb; - - if (debug_ts) - av_log(NULL, AV_LOG_INFO, "filter_raw -> pts:%s pts_time:%s time_base:%d/%d\n", - av_ts2str(filtered_frame->pts), - av_ts2timestr(filtered_frame->pts, &tb), - tb.num, tb.den); - } - - enc_frame(ost, filtered_frame); - av_frame_unref(filtered_frame); - } - } - - return 0; -} - static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time) { AVBPrint buf, buf_script; @@ -944,112 +884,6 @@ int ifilter_has_all_input_formats(FilterGraph *fg) return 1; } -static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference) -{ - FilterGraph *fg = ifilter->graph; - AVFrameSideData *sd; - int need_reinit, ret; - int buffersrc_flags = AV_BUFFERSRC_FLAG_PUSH; - - if (keep_reference) - buffersrc_flags |= AV_BUFFERSRC_FLAG_KEEP_REF; - - /* determine if the parameters for this input changed */ - need_reinit = ifilter->format != frame->format; - - switch (ifilter->ist->par->codec_type) { - case AVMEDIA_TYPE_AUDIO: - need_reinit |= ifilter->sample_rate != frame->sample_rate || - av_channel_layout_compare(&ifilter->ch_layout, &frame->ch_layout); - break; - case AVMEDIA_TYPE_VIDEO: - need_reinit |= ifilter->width != frame->width || - ifilter->height != frame->height; - break; - } - - if (!ifilter->ist->reinit_filters && fg->graph) - need_reinit = 0; - - if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx || - (ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data)) - need_reinit = 1; - - if (sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX)) { - if (!ifilter->displaymatrix || memcmp(sd->data, ifilter->displaymatrix, sizeof(int32_t) * 9)) - need_reinit = 1; - } else if (ifilter->displaymatrix) - need_reinit = 1; - - if (need_reinit) { - ret = ifilter_parameters_from_frame(ifilter, frame); - if (ret < 0) - return ret; - } - - /* (re)init the graph if possible, otherwise buffer the frame and return */ - if (need_reinit || !fg->graph) { - if (!ifilter_has_all_input_formats(fg)) { - AVFrame *tmp = av_frame_clone(frame); - if (!tmp) - return AVERROR(ENOMEM); - - ret = av_fifo_write(ifilter->frame_queue, &tmp, 1); - if (ret < 0) - av_frame_free(&tmp); - - return ret; - } - - ret = reap_filters(1); - if (ret < 0 && ret != AVERROR_EOF) { - av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret)); - return ret; - } - - ret = configure_filtergraph(fg); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error reinitializing filters!\n"); - return ret; - } - } - - ret = av_buffersrc_add_frame_flags(ifilter->filter, frame, buffersrc_flags); - if (ret < 0) { - if (ret != AVERROR_EOF) - av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret)); - return ret; - } - - return 0; -} - -static int ifilter_send_eof(InputFilter *ifilter, int64_t pts) -{ - int ret; - - ifilter->eof = 1; - - if (ifilter->filter) { - ret = av_buffersrc_close(ifilter->filter, pts, AV_BUFFERSRC_FLAG_PUSH); - if (ret < 0) - return ret; - } else { - // the filtergraph was never configured - if (ifilter->format < 0) { - ret = ifilter_parameters_from_codecpar(ifilter, ifilter->ist->par); - if (ret < 0) - return ret; - } - if (ifilter->format < 0 && (ifilter->type == AVMEDIA_TYPE_AUDIO || ifilter->type == AVMEDIA_TYPE_VIDEO)) { - av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input stream %d:%d after EOF\n", ifilter->ist->file_index, ifilter->ist->st->index); - return AVERROR_INVALIDDATA; - } - } - - return 0; -} - // This does not quite work like avcodec_decode_audio4/avcodec_decode_video2. // There is the following difference: if you got a frame, you must call // it again with pkt=NULL. pkt==NULL is treated differently from pkt->size==0 @@ -2292,54 +2126,6 @@ discard_packet: return 0; } -/** - * Perform a step of transcoding for the specified filter graph. - * - * @param[in] graph filter graph to consider - * @param[out] best_ist input stream where a frame would allow to continue - * @return 0 for success, <0 for error - */ -static int transcode_from_filter(FilterGraph *graph, InputStream **best_ist) -{ - int i, ret; - int nb_requests, nb_requests_max = 0; - InputFilter *ifilter; - InputStream *ist; - - *best_ist = NULL; - ret = avfilter_graph_request_oldest(graph->graph); - if (ret >= 0) - return reap_filters(0); - - if (ret == AVERROR_EOF) { - ret = reap_filters(1); - for (i = 0; i < graph->nb_outputs; i++) - close_output_stream(graph->outputs[i]->ost); - return ret; - } - if (ret != AVERROR(EAGAIN)) - return ret; - - for (i = 0; i < graph->nb_inputs; i++) { - ifilter = graph->inputs[i]; - ist = ifilter->ist; - if (input_files[ist->file_index]->eagain || - input_files[ist->file_index]->eof_reached) - continue; - nb_requests = av_buffersrc_get_nb_failed_requests(ifilter->filter); - if (nb_requests > nb_requests_max) { - nb_requests_max = nb_requests; - *best_ist = ist; - } - } - - if (!*best_ist) - for (i = 0; i < graph->nb_outputs; i++) - graph->outputs[i]->ost->unavailable = 1; - - return 0; -} - /** * Run a single step of transcoding. * @@ -2373,7 +2159,7 @@ static int transcode_step(void) } if (ost->filter && ost->filter->graph->graph) { - if ((ret = transcode_from_filter(ost->filter->graph, &ist)) < 0) + if ((ret = fg_transcode_step(ost->filter->graph, &ist)) < 0) return ret; if (!ist) return 0; diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index b181d433b0..07c1fc7ed6 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -799,6 +799,9 @@ int init_complex_filtergraph(FilterGraph *fg); void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub); +int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference); +int ifilter_send_eof(InputFilter *ifilter, int64_t pts); + int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame); int ifilter_parameters_from_codecpar(InputFilter *ifilter, AVCodecParameters *par); int ifilter_has_all_input_formats(FilterGraph *fg); @@ -811,6 +814,23 @@ int ifilter_has_all_input_formats(FilterGraph *fg); */ FilterGraph *fg_create(char *graph_desc); +/** + * Perform a step of transcoding for the specified filter graph. + * + * @param[in] graph filter graph to consider + * @param[out] best_ist input stream where a frame would allow to continue + * @return 0 for success, <0 for error + */ +int fg_transcode_step(FilterGraph *graph, InputStream **best_ist); + +/** + * Get and encode new output from any of the filtergraphs, without causing + * activity. + * + * @return 0 for success, <0 for severe errors + */ +int reap_filters(int flush); + int ffmpeg_parse_options(int argc, char **argv); void enc_stats_write(OutputStream *ost, EncStats *es, diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 7b3d9a490f..c39cf43774 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -36,6 +36,7 @@ #include "libavutil/pixfmt.h" #include "libavutil/imgutils.h" #include "libavutil/samplefmt.h" +#include "libavutil/timestamp.h" // FIXME: YUV420P etc. are actually supported with full color range, // yet the latter information isn't available here. @@ -1300,3 +1301,204 @@ int filtergraph_is_simple(FilterGraph *fg) { return !fg->graph_desc; } + +int reap_filters(int flush) +{ + AVFrame *filtered_frame = NULL; + + /* Reap all buffers present in the buffer sinks */ + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + AVFilterContext *filter; + int ret = 0; + + if (!ost->filter || !ost->filter->graph->graph) + continue; + filter = ost->filter->filter; + + filtered_frame = ost->filtered_frame; + + while (1) { + ret = av_buffersink_get_frame_flags(filter, filtered_frame, + AV_BUFFERSINK_FLAG_NO_REQUEST); + if (ret < 0) { + if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) { + av_log(NULL, AV_LOG_WARNING, + "Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret)); + } else if (flush && ret == AVERROR_EOF) { + if (av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO) + enc_frame(ost, NULL); + } + break; + } + if (ost->finished) { + av_frame_unref(filtered_frame); + continue; + } + + if (filtered_frame->pts != AV_NOPTS_VALUE) { + AVRational tb = av_buffersink_get_time_base(filter); + ost->filter->last_pts = av_rescale_q(filtered_frame->pts, tb, + AV_TIME_BASE_Q); + filtered_frame->time_base = tb; + + if (debug_ts) + av_log(NULL, AV_LOG_INFO, "filter_raw -> pts:%s pts_time:%s time_base:%d/%d\n", + av_ts2str(filtered_frame->pts), + av_ts2timestr(filtered_frame->pts, &tb), + tb.num, tb.den); + } + + enc_frame(ost, filtered_frame); + av_frame_unref(filtered_frame); + } + } + + return 0; +} + +int ifilter_send_eof(InputFilter *ifilter, int64_t pts) +{ + int ret; + + ifilter->eof = 1; + + if (ifilter->filter) { + ret = av_buffersrc_close(ifilter->filter, pts, AV_BUFFERSRC_FLAG_PUSH); + if (ret < 0) + return ret; + } else { + // the filtergraph was never configured + if (ifilter->format < 0) { + ret = ifilter_parameters_from_codecpar(ifilter, ifilter->ist->par); + if (ret < 0) + return ret; + } + if (ifilter->format < 0 && (ifilter->type == AVMEDIA_TYPE_AUDIO || ifilter->type == AVMEDIA_TYPE_VIDEO)) { + av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input stream %d:%d after EOF\n", ifilter->ist->file_index, ifilter->ist->st->index); + return AVERROR_INVALIDDATA; + } + } + + return 0; +} + +int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference) +{ + FilterGraph *fg = ifilter->graph; + AVFrameSideData *sd; + int need_reinit, ret; + int buffersrc_flags = AV_BUFFERSRC_FLAG_PUSH; + + if (keep_reference) + buffersrc_flags |= AV_BUFFERSRC_FLAG_KEEP_REF; + + /* determine if the parameters for this input changed */ + need_reinit = ifilter->format != frame->format; + + switch (ifilter->ist->par->codec_type) { + case AVMEDIA_TYPE_AUDIO: + need_reinit |= ifilter->sample_rate != frame->sample_rate || + av_channel_layout_compare(&ifilter->ch_layout, &frame->ch_layout); + break; + case AVMEDIA_TYPE_VIDEO: + need_reinit |= ifilter->width != frame->width || + ifilter->height != frame->height; + break; + } + + if (!ifilter->ist->reinit_filters && fg->graph) + need_reinit = 0; + + if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx || + (ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data)) + need_reinit = 1; + + if (sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX)) { + if (!ifilter->displaymatrix || memcmp(sd->data, ifilter->displaymatrix, sizeof(int32_t) * 9)) + need_reinit = 1; + } else if (ifilter->displaymatrix) + need_reinit = 1; + + if (need_reinit) { + ret = ifilter_parameters_from_frame(ifilter, frame); + if (ret < 0) + return ret; + } + + /* (re)init the graph if possible, otherwise buffer the frame and return */ + if (need_reinit || !fg->graph) { + if (!ifilter_has_all_input_formats(fg)) { + AVFrame *tmp = av_frame_clone(frame); + if (!tmp) + return AVERROR(ENOMEM); + + ret = av_fifo_write(ifilter->frame_queue, &tmp, 1); + if (ret < 0) + av_frame_free(&tmp); + + return ret; + } + + ret = reap_filters(1); + if (ret < 0 && ret != AVERROR_EOF) { + av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret)); + return ret; + } + + ret = configure_filtergraph(fg); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error reinitializing filters!\n"); + return ret; + } + } + + ret = av_buffersrc_add_frame_flags(ifilter->filter, frame, buffersrc_flags); + if (ret < 0) { + if (ret != AVERROR_EOF) + av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret)); + return ret; + } + + return 0; +} + +int fg_transcode_step(FilterGraph *graph, InputStream **best_ist) +{ + int i, ret; + int nb_requests, nb_requests_max = 0; + InputFilter *ifilter; + InputStream *ist; + + *best_ist = NULL; + ret = avfilter_graph_request_oldest(graph->graph); + if (ret >= 0) + return reap_filters(0); + + if (ret == AVERROR_EOF) { + ret = reap_filters(1); + for (i = 0; i < graph->nb_outputs; i++) + close_output_stream(graph->outputs[i]->ost); + return ret; + } + if (ret != AVERROR(EAGAIN)) + return ret; + + for (i = 0; i < graph->nb_inputs; i++) { + ifilter = graph->inputs[i]; + ist = ifilter->ist; + if (input_files[ist->file_index]->eagain || + input_files[ist->file_index]->eof_reached) + continue; + nb_requests = av_buffersrc_get_nb_failed_requests(ifilter->filter); + if (nb_requests > nb_requests_max) { + nb_requests_max = nb_requests; + *best_ist = ist; + } + } + + if (!*best_ist) + for (i = 0; i < graph->nb_outputs; i++) + graph->outputs[i]->ost->unavailable = 1; + + return 0; +} -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 21/25] fftools/ffmpeg: move freeing a filtergraph into a separate function 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (18 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 20/25] fftools/ffmpeg: move filtering functions to ffmpeg_filter Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 22/25] fftools/ffmpeg_filter: reindent after previous commit Anton Khirnov ` (3 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg.c | 42 +++------------------------------------ fftools/ffmpeg.h | 2 ++ fftools/ffmpeg_filter.c | 44 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 39 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 248c22a4ff..2bf3ba5c74 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -487,51 +487,15 @@ const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }; static void ffmpeg_cleanup(int ret) { - int i, j; + int i; if (do_benchmark) { int maxrss = getmaxrss() / 1024; av_log(NULL, AV_LOG_INFO, "bench: maxrss=%ikB\n", maxrss); } - for (i = 0; i < nb_filtergraphs; i++) { - FilterGraph *fg = filtergraphs[i]; - avfilter_graph_free(&fg->graph); - for (j = 0; j < fg->nb_inputs; j++) { - InputFilter *ifilter = fg->inputs[j]; - struct InputStream *ist = ifilter->ist; - - if (ifilter->frame_queue) { - AVFrame *frame; - while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0) - av_frame_free(&frame); - av_fifo_freep2(&ifilter->frame_queue); - } - av_freep(&ifilter->displaymatrix); - if (ist->sub2video.sub_queue) { - AVSubtitle sub; - while (av_fifo_read(ist->sub2video.sub_queue, &sub, 1) >= 0) - avsubtitle_free(&sub); - av_fifo_freep2(&ist->sub2video.sub_queue); - } - av_buffer_unref(&ifilter->hw_frames_ctx); - av_freep(&ifilter->name); - av_freep(&fg->inputs[j]); - } - av_freep(&fg->inputs); - for (j = 0; j < fg->nb_outputs; j++) { - OutputFilter *ofilter = fg->outputs[j]; - - avfilter_inout_free(&ofilter->out_tmp); - av_freep(&ofilter->name); - av_channel_layout_uninit(&ofilter->ch_layout); - av_freep(&fg->outputs[j]); - } - av_freep(&fg->outputs); - av_freep(&fg->graph_desc); - - av_freep(&filtergraphs[i]); - } + for (i = 0; i < nb_filtergraphs; i++) + fg_free(&filtergraphs[i]); av_freep(&filtergraphs); /* close files */ diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 07c1fc7ed6..95591f4bba 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -814,6 +814,8 @@ int ifilter_has_all_input_formats(FilterGraph *fg); */ FilterGraph *fg_create(char *graph_desc); +void fg_free(FilterGraph **pfg); + /** * Perform a step of transcoding for the specified filter graph. * diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index c39cf43774..cfd93a0f9d 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -189,6 +189,50 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg) return ofilter; } +void fg_free(FilterGraph **pfg) +{ + FilterGraph *fg = *pfg; + + if (!fg) + return; + + avfilter_graph_free(&fg->graph); + for (int j = 0; j < fg->nb_inputs; j++) { + InputFilter *ifilter = fg->inputs[j]; + struct InputStream *ist = ifilter->ist; + + if (ifilter->frame_queue) { + AVFrame *frame; + while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0) + av_frame_free(&frame); + av_fifo_freep2(&ifilter->frame_queue); + } + av_freep(&ifilter->displaymatrix); + if (ist->sub2video.sub_queue) { + AVSubtitle sub; + while (av_fifo_read(ist->sub2video.sub_queue, &sub, 1) >= 0) + avsubtitle_free(&sub); + av_fifo_freep2(&ist->sub2video.sub_queue); + } + av_buffer_unref(&ifilter->hw_frames_ctx); + av_freep(&ifilter->name); + av_freep(&fg->inputs[j]); + } + av_freep(&fg->inputs); + for (int j = 0; j < fg->nb_outputs; j++) { + OutputFilter *ofilter = fg->outputs[j]; + + avfilter_inout_free(&ofilter->out_tmp); + av_freep(&ofilter->name); + av_channel_layout_uninit(&ofilter->ch_layout); + av_freep(&fg->outputs[j]); + } + av_freep(&fg->outputs); + av_freep(&fg->graph_desc); + + av_freep(pfg); +} + FilterGraph *fg_create(char *graph_desc) { FilterGraph *fg; -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 22/25] fftools/ffmpeg_filter: reindent after previous commit 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (19 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 21/25] fftools/ffmpeg: move freeing a filtergraph into a separate function Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov ` (2 subsequent siblings) 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel --- fftools/ffmpeg_filter.c | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index cfd93a0f9d..b26160b375 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -196,39 +196,39 @@ void fg_free(FilterGraph **pfg) if (!fg) return; - avfilter_graph_free(&fg->graph); - for (int j = 0; j < fg->nb_inputs; j++) { - InputFilter *ifilter = fg->inputs[j]; - struct InputStream *ist = ifilter->ist; - - if (ifilter->frame_queue) { - AVFrame *frame; - while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0) - av_frame_free(&frame); - av_fifo_freep2(&ifilter->frame_queue); - } - av_freep(&ifilter->displaymatrix); - if (ist->sub2video.sub_queue) { - AVSubtitle sub; - while (av_fifo_read(ist->sub2video.sub_queue, &sub, 1) >= 0) - avsubtitle_free(&sub); - av_fifo_freep2(&ist->sub2video.sub_queue); - } - av_buffer_unref(&ifilter->hw_frames_ctx); - av_freep(&ifilter->name); - av_freep(&fg->inputs[j]); + avfilter_graph_free(&fg->graph); + for (int j = 0; j < fg->nb_inputs; j++) { + InputFilter *ifilter = fg->inputs[j]; + struct InputStream *ist = ifilter->ist; + + if (ifilter->frame_queue) { + AVFrame *frame; + while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0) + av_frame_free(&frame); + av_fifo_freep2(&ifilter->frame_queue); } - av_freep(&fg->inputs); - for (int j = 0; j < fg->nb_outputs; j++) { - OutputFilter *ofilter = fg->outputs[j]; - - avfilter_inout_free(&ofilter->out_tmp); - av_freep(&ofilter->name); - av_channel_layout_uninit(&ofilter->ch_layout); - av_freep(&fg->outputs[j]); + av_freep(&ifilter->displaymatrix); + if (ist->sub2video.sub_queue) { + AVSubtitle sub; + while (av_fifo_read(ist->sub2video.sub_queue, &sub, 1) >= 0) + avsubtitle_free(&sub); + av_fifo_freep2(&ist->sub2video.sub_queue); } - av_freep(&fg->outputs); - av_freep(&fg->graph_desc); + av_buffer_unref(&ifilter->hw_frames_ctx); + av_freep(&ifilter->name); + av_freep(&fg->inputs[j]); + } + av_freep(&fg->inputs); + for (int j = 0; j < fg->nb_outputs; j++) { + OutputFilter *ofilter = fg->outputs[j]; + + avfilter_inout_free(&ofilter->out_tmp); + av_freep(&ofilter->name); + av_channel_layout_uninit(&ofilter->ch_layout); + av_freep(&fg->outputs[j]); + } + av_freep(&fg->outputs); + av_freep(&fg->graph_desc); av_freep(pfg); } -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (20 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 22/25] fftools/ffmpeg_filter: reindent after previous commit Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-24 10:20 ` Nicolas George 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 24/25] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 25/25] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static Anton Khirnov 23 siblings, 1 reply; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel Start by moving OutputStream.filtered_frame to it, which really belong to the filtergraph rather than the output stream. --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_filter.c | 31 ++++++++++++++++++++++++++----- fftools/ffmpeg_mux.c | 1 - fftools/ffmpeg_mux_init.c | 4 ---- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 95591f4bba..71f348da01 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -603,7 +603,6 @@ typedef struct OutputStream { Encoder *enc; AVCodecContext *enc_ctx; - AVFrame *filtered_frame; AVPacket *pkt; int64_t last_dropped; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index b26160b375..edfefc9d45 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -38,6 +38,18 @@ #include "libavutil/samplefmt.h" #include "libavutil/timestamp.h" +typedef struct FilterGraphPriv { + FilterGraph fg; + + // frame for temporarily holding output from the filtergraph + AVFrame *frame; +} FilterGraphPriv; + +static FilterGraphPriv *fgp_from_fg(FilterGraph *fg) +{ + return (FilterGraphPriv*)fg; +} + // FIXME: YUV420P etc. are actually supported with full color range, // yet the latter information isn't available here. static const enum AVPixelFormat *get_compliance_normal_pix_fmts(const AVCodec *codec, const enum AVPixelFormat default_formats[]) @@ -192,9 +204,11 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg) void fg_free(FilterGraph **pfg) { FilterGraph *fg = *pfg; + FilterGraphPriv *fgp; if (!fg) return; + fgp = fgp_from_fg(fg); avfilter_graph_free(&fg->graph); for (int j = 0; j < fg->nb_inputs; j++) { @@ -230,17 +244,23 @@ void fg_free(FilterGraph **pfg) av_freep(&fg->outputs); av_freep(&fg->graph_desc); + av_frame_free(&fgp->frame); + av_freep(pfg); } FilterGraph *fg_create(char *graph_desc) { - FilterGraph *fg; + FilterGraphPriv *fgp = allocate_array_elem(&filtergraphs, sizeof(*fgp), &nb_filtergraphs); + FilterGraph *fg = &fgp->fg; - fg = ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); fg->index = nb_filtergraphs - 1; fg->graph_desc = graph_desc; + fgp->frame = av_frame_alloc(); + if (!fgp->frame) + report_and_exit(AVERROR(ENOMEM)); + return fg; } @@ -1348,18 +1368,19 @@ int filtergraph_is_simple(FilterGraph *fg) int reap_filters(int flush) { - AVFrame *filtered_frame = NULL; - /* Reap all buffers present in the buffer sinks */ for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + FilterGraphPriv *fgp; + AVFrame *filtered_frame; AVFilterContext *filter; int ret = 0; if (!ost->filter || !ost->filter->graph->graph) continue; filter = ost->filter->filter; + fgp = fgp_from_fg(ost->filter->graph); - filtered_frame = ost->filtered_frame; + filtered_frame = fgp->frame; while (1) { ret = av_buffersink_get_frame_flags(filter, filtered_frame, diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 368a7000a9..2a9db199c1 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -839,7 +839,6 @@ static void ost_free(OutputStream **post) av_bsf_free(&ms->bsf_ctx); - av_frame_free(&ost->filtered_frame); av_packet_free(&ost->pkt); av_dict_free(&ost->encoder_opts); diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 7a2db9f0e8..2c0e2faf4a 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1026,10 +1026,6 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o, av_strlcat(ms->log_name, "/copy", sizeof(ms->log_name)); } - ost->filtered_frame = av_frame_alloc(); - if (!ost->filtered_frame) - report_and_exit(AVERROR(ENOMEM)); - ost->pkt = av_packet_alloc(); if (!ost->pkt) report_and_exit(AVERROR(ENOMEM)); -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov @ 2023-04-24 10:20 ` Nicolas George 2023-04-24 11:17 ` Anton Khirnov 0 siblings, 1 reply; 44+ messages in thread From: Nicolas George @ 2023-04-24 10:20 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 349 bytes --] Anton Khirnov (12023-04-19): > Start by moving OutputStream.filtered_frame to it, which really belong > to the filtergraph rather than the output stream. What is the point of this? fftools/ffmpeg_filter: is not part of a library, concepts of public/private do not apply, just put everything you need in FilterGraph. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 10:20 ` Nicolas George @ 2023-04-24 11:17 ` Anton Khirnov 2023-04-24 11:19 ` Nicolas George 0 siblings, 1 reply; 44+ messages in thread From: Anton Khirnov @ 2023-04-24 11:17 UTC (permalink / raw) To: FFmpeg development discussions and patches Quoting Nicolas George (2023-04-24 12:20:00) > Anton Khirnov (12023-04-19): > > Start by moving OutputStream.filtered_frame to it, which really belong > > to the filtergraph rather than the output stream. > > What is the point of this? fftools/ffmpeg_filter: is not part of a > library, concepts of public/private do not apply, just put everything > you need in FilterGraph. Separating internal state from public interfaces is a fundamental notion of object-oriented programming and is completely orthogonal to that object being a part of a library or not. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 11:17 ` Anton Khirnov @ 2023-04-24 11:19 ` Nicolas George 2023-04-24 11:57 ` Anton Khirnov 0 siblings, 1 reply; 44+ messages in thread From: Nicolas George @ 2023-04-24 11:19 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 399 bytes --] Anton Khirnov (12023-04-24): > Separating internal state from public interfaces is a fundamental notion > of object-oriented programming and is completely orthogonal to that > object being a part of a library or not. Using object-oriented programming to its fullest when it is not needed is a fundamental notion of mediocre programming. This patch only adds noise. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 11:19 ` Nicolas George @ 2023-04-24 11:57 ` Anton Khirnov 2023-04-24 11:59 ` Nicolas George 0 siblings, 1 reply; 44+ messages in thread From: Anton Khirnov @ 2023-04-24 11:57 UTC (permalink / raw) To: FFmpeg development discussions and patches Quoting Nicolas George (2023-04-24 13:19:49) > Anton Khirnov (12023-04-24): > > Separating internal state from public interfaces is a fundamental notion > > of object-oriented programming and is completely orthogonal to that > > object being a part of a library or not. > > Using object-oriented programming to its fullest when it is not needed > is a fundamental notion of mediocre programming. This patch only adds > noise. We'll have to disagree about this then. I belive lack of proper structure is currently the biggest problem in ffmpeg CLI. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 11:57 ` Anton Khirnov @ 2023-04-24 11:59 ` Nicolas George 2023-04-24 12:07 ` Anton Khirnov 0 siblings, 1 reply; 44+ messages in thread From: Nicolas George @ 2023-04-24 11:59 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 356 bytes --] Anton Khirnov (12023-04-24): > We'll have to disagree about this then. I belive lack of proper > structure is currently the biggest problem in ffmpeg CLI. I do not disagree on this. But this patch does not help, it just makes the code locally less readable. If it is to be useful at all, it is at least severely premature. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 11:59 ` Nicolas George @ 2023-04-24 12:07 ` Anton Khirnov 2023-04-24 12:13 ` Nicolas George 0 siblings, 1 reply; 44+ messages in thread From: Anton Khirnov @ 2023-04-24 12:07 UTC (permalink / raw) To: FFmpeg development discussions and patches Quoting Nicolas George (2023-04-24 13:59:43) > Anton Khirnov (12023-04-24): > > We'll have to disagree about this then. I belive lack of proper > > structure is currently the biggest problem in ffmpeg CLI. > > I do not disagree on this. But this patch does not help, it just makes > the code locally less readable. If it is to be useful at all, it is at > least severely premature. What exactly is less readable? One variable gets its scope reduced, that is a win in my book. And obviously I'm not stopping there, other things will be moved to this private struct in future patches, I just prefer to avoid giant patchsets when possible. Also note that exactly the same pattern is used in ffmpeg_demux, ffmpeg_mux, and ffmpeg_enc (and soon in ffmpeg_dec). -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 12:07 ` Anton Khirnov @ 2023-04-24 12:13 ` Nicolas George 2023-04-24 12:30 ` Anton Khirnov 0 siblings, 1 reply; 44+ messages in thread From: Nicolas George @ 2023-04-24 12:13 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 1059 bytes --] Anton Khirnov (12023-04-24): > What exactly is less readable? One variable gets its scope reduced, that > is a win in my book. Having to remember if a field is in structure x or structure y s a net loss that you do not see only because you just wrote the code and have everything freshly in mind. > And obviously I'm not stopping there, other things > will be moved to this private struct in future patches, Then move them into FilterGraph itself. If at some point later it makes sense to separate this structure to make the code clearer, we can do it at that time. If it happens, I predict the split will not be along the same “public”/“private” distinction you are trying to make right now. > I just prefer to > avoid giant patchsets when possible. Yes, please do, giant patchsets are rude. > Also note that exactly the same pattern is used in ffmpeg_demux, > ffmpeg_mux, and ffmpeg_enc (and soon in ffmpeg_dec). If I had noticed it at the time, I would have objected the same way. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 12:13 ` Nicolas George @ 2023-04-24 12:30 ` Anton Khirnov 2023-04-24 18:31 ` Nicolas George 0 siblings, 1 reply; 44+ messages in thread From: Anton Khirnov @ 2023-04-24 12:30 UTC (permalink / raw) To: FFmpeg development discussions and patches Quoting Nicolas George (2023-04-24 14:13:45) > Anton Khirnov (12023-04-24): > > What exactly is less readable? One variable gets its scope reduced, that > > is a win in my book. > > Having to remember if a field is in structure x or structure y s a net > loss that you do not see only because you just wrote the code and have > everything freshly in mind. So when I wanted to make changes to libavfilter recently, you claimed your familiarity with the code makes you more qualified to judge readability. Now my familiarity with the code makes me LESS qualified. Curious. We've also been moving private state to private data for many years now and none of your conjectured concerns materialized, to the contrary code became easier to maintain. > > And obviously I'm not stopping there, other things > > will be moved to this private struct in future patches, > > Then move them into FilterGraph itself. If at some point later it makes > sense to separate this structure to make the code clearer, we can do it > at that time. If it happens, I predict the split will not be along the > same “public”/“private” distinction you are trying to make right now. Now that would be pure noise. I already know FilterGraph will have private data, I intend to move more things into it in the very next patchset. > > Also note that exactly the same pattern is used in ffmpeg_demux, > > ffmpeg_mux, and ffmpeg_enc (and soon in ffmpeg_dec). > > If I had noticed it at the time, I would have objected the same way. I have no idea what are you even objecting to. What is even controversial about not exposing state that does not need to be exposed? -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 12:30 ` Anton Khirnov @ 2023-04-24 18:31 ` Nicolas George 2023-04-24 18:33 ` Paul B Mahol 2023-04-24 19:17 ` Anton Khirnov 0 siblings, 2 replies; 44+ messages in thread From: Nicolas George @ 2023-04-24 18:31 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 1481 bytes --] Anton Khirnov (12023-04-24): > So when I wanted to make changes to libavfilter recently, you claimed > your familiarity with the code makes you more qualified to judge > readability. Now my familiarity with the code makes me LESS qualified. > Curious. There is a difference between long-term knowledge of a large part of the code and a short-term acquaintance with a limited slice of the code, I hope you realize. > We've also been moving private state to private data for many years now > and none of your conjectured concerns materialized, to the contrary code > became easier to maintain. Untrue. For example, every instance of FFFormatContext in the code gives places where the code has become that much more annoying to maintain. Maybe the same code has become more maintainable at the same time due to other changes, but the fact remains that these changes make it harder to work on the code. > Now that would be pure noise. The only noise here is all the fgp_from_fg() you want to liter over the code and the extra variables it requires. > I have no idea what are you even objecting to. What is even > controversial about not exposing state that does not need to be exposed? I have explained time and again: I oppose to any change that requires us to remember or check which structure a given field belongs to when it is not already obvious by its semantic. And again, there is nothing exposed to hide here. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 18:31 ` Nicolas George @ 2023-04-24 18:33 ` Paul B Mahol 2023-04-24 18:37 ` James Almer 2023-04-24 19:17 ` Anton Khirnov 1 sibling, 1 reply; 44+ messages in thread From: Paul B Mahol @ 2023-04-24 18:33 UTC (permalink / raw) To: FFmpeg development discussions and patches On Mon, Apr 24, 2023 at 8:32 PM Nicolas George <george@nsup.org> wrote: > Anton Khirnov (12023-04-24): > > So when I wanted to make changes to libavfilter recently, you claimed > > your familiarity with the code makes you more qualified to judge > > readability. Now my familiarity with the code makes me LESS qualified. > > Curious. > > There is a difference between long-term knowledge of a large part of the > code and a short-term acquaintance with a limited slice of the code, I > hope you realize. > > > We've also been moving private state to private data for many years now > > and none of your conjectured concerns materialized, to the contrary code > > became easier to maintain. > > Untrue. For example, every instance of FFFormatContext in the code gives > places where the code has become that much more annoying to maintain. > Maybe the same code has become more maintainable at the same time due to > other changes, but the fact remains that these changes make it harder to > work on the code. > > > Now that would be pure noise. > > The only noise here is all the fgp_from_fg() you want to liter over the > code and the extra variables it requires. > > > I have no idea what are you even objecting to. What is even > > controversial about not exposing state that does not need to be exposed? > > I have explained time and again: I oppose to any change that requires us > to remember or check which structure a given field belongs to when it is > not already obvious by its semantic. > > And again, there is nothing exposed to hide here. > Why should anybody here listen to your entries here? When was last time you contributed anything marginally useful? > > -- > Nicolas George > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 18:33 ` Paul B Mahol @ 2023-04-24 18:37 ` James Almer 2023-04-24 18:41 ` Paul B Mahol 0 siblings, 1 reply; 44+ messages in thread From: James Almer @ 2023-04-24 18:37 UTC (permalink / raw) To: ffmpeg-devel On 4/24/2023 3:33 PM, Paul B Mahol wrote: > On Mon, Apr 24, 2023 at 8:32 PM Nicolas George <george@nsup.org> wrote: > >> Anton Khirnov (12023-04-24): >>> So when I wanted to make changes to libavfilter recently, you claimed >>> your familiarity with the code makes you more qualified to judge >>> readability. Now my familiarity with the code makes me LESS qualified. >>> Curious. >> >> There is a difference between long-term knowledge of a large part of the >> code and a short-term acquaintance with a limited slice of the code, I >> hope you realize. >> >>> We've also been moving private state to private data for many years now >>> and none of your conjectured concerns materialized, to the contrary code >>> became easier to maintain. >> >> Untrue. For example, every instance of FFFormatContext in the code gives >> places where the code has become that much more annoying to maintain. >> Maybe the same code has become more maintainable at the same time due to >> other changes, but the fact remains that these changes make it harder to >> work on the code. >> >>> Now that would be pure noise. >> >> The only noise here is all the fgp_from_fg() you want to liter over the >> code and the extra variables it requires. >> >>> I have no idea what are you even objecting to. What is even >>> controversial about not exposing state that does not need to be exposed? >> >> I have explained time and again: I oppose to any change that requires us >> to remember or check which structure a given field belongs to when it is >> not already obvious by its semantic. >> >> And again, there is nothing exposed to hide here. >> > > Why should anybody here listen to your entries here? > When was last time you contributed anything marginally useful? Lets limit things to technical arguments, please. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 18:37 ` James Almer @ 2023-04-24 18:41 ` Paul B Mahol 0 siblings, 0 replies; 44+ messages in thread From: Paul B Mahol @ 2023-04-24 18:41 UTC (permalink / raw) To: FFmpeg development discussions and patches On Mon, Apr 24, 2023 at 8:37 PM James Almer <jamrial@gmail.com> wrote: > On 4/24/2023 3:33 PM, Paul B Mahol wrote: > > On Mon, Apr 24, 2023 at 8:32 PM Nicolas George <george@nsup.org> wrote: > > > >> Anton Khirnov (12023-04-24): > >>> So when I wanted to make changes to libavfilter recently, you claimed > >>> your familiarity with the code makes you more qualified to judge > >>> readability. Now my familiarity with the code makes me LESS qualified. > >>> Curious. > >> > >> There is a difference between long-term knowledge of a large part of the > >> code and a short-term acquaintance with a limited slice of the code, I > >> hope you realize. > >> > >>> We've also been moving private state to private data for many years now > >>> and none of your conjectured concerns materialized, to the contrary > code > >>> became easier to maintain. > >> > >> Untrue. For example, every instance of FFFormatContext in the code gives > >> places where the code has become that much more annoying to maintain. > >> Maybe the same code has become more maintainable at the same time due to > >> other changes, but the fact remains that these changes make it harder to > >> work on the code. > >> > >>> Now that would be pure noise. > >> > >> The only noise here is all the fgp_from_fg() you want to liter over the > >> code and the extra variables it requires. > >> > >>> I have no idea what are you even objecting to. What is even > >>> controversial about not exposing state that does not need to be > exposed? > >> > >> I have explained time and again: I oppose to any change that requires us > >> to remember or check which structure a given field belongs to when it is > >> not already obvious by its semantic. > >> > >> And again, there is nothing exposed to hide here. > >> > > > > Why should anybody here listen to your entries here? > > When was last time you contributed anything marginally useful? > > Lets limit things to technical arguments, please. > Nicolas want one monumental structure like old AVCodecContext and still current MPV structure. There is nothing technical in this discussion, from start, at all. > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 18:31 ` Nicolas George 2023-04-24 18:33 ` Paul B Mahol @ 2023-04-24 19:17 ` Anton Khirnov 2023-04-24 19:24 ` Nicolas George 1 sibling, 1 reply; 44+ messages in thread From: Anton Khirnov @ 2023-04-24 19:17 UTC (permalink / raw) To: FFmpeg development discussions and patches Quoting Nicolas George (2023-04-24 20:31:49) > Anton Khirnov (12023-04-24): > > So when I wanted to make changes to libavfilter recently, you claimed > > your familiarity with the code makes you more qualified to judge > > readability. Now my familiarity with the code makes me LESS qualified. > > Curious. > > There is a difference between long-term knowledge of a large part of the > code and a short-term acquaintance with a limited slice of the code, I > hope you realize. I have no idea what you mean by this. > > We've also been moving private state to private data for many years now > > and none of your conjectured concerns materialized, to the contrary code > > became easier to maintain. > > Untrue. For example, every instance of FFFormatContext in the code gives > places where the code has become that much more annoying to maintain. > Maybe the same code has become more maintainable at the same time due to > other changes, but the fact remains that these changes make it harder to > work on the code. > true > fact You keep using these words. I don't think they mean what you think they mean. The only fact here is that the quoted paragraph is YOUR PERSONAL OPINION, which ZERO other developers expressed support for. On the other hand, the approach under discussion has explicit support from multiple highly active developers. > > Now that would be pure noise. > > The only noise here is all the fgp_from_fg() you want to liter over the > code and the extra variables it requires. > > > I have no idea what are you even objecting to. What is even > > controversial about not exposing state that does not need to be exposed? > > I have explained time and again: I oppose to any change that requires us > to remember or check which structure a given field belongs to when it is > not already obvious by its semantic. You are too late, many such changes have already been pushed in the last several years. Nobody except you opposes them and the likelihood of reversing them is extremely low. This whole thread is a pointless waste of time that could be spend doing something actually useful. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 19:17 ` Anton Khirnov @ 2023-04-24 19:24 ` Nicolas George 2023-04-24 19:41 ` Anton Khirnov 0 siblings, 1 reply; 44+ messages in thread From: Nicolas George @ 2023-04-24 19:24 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 1179 bytes --] Anton Khirnov (12023-04-24): > I have no idea what you mean by this. Try a little harder. > You keep using these words. I don't think they mean what you think they > mean. Yeah, Princess Bride references are a real boost to weak arguments. > The only fact here is that the quoted paragraph is YOUR PERSONAL > OPINION, which ZERO other developers expressed support for. Or maybe I am the only one not fed up of arguing with walls. Will you dispute that each split of a structure is extra code in many places? Will you discuss that having to remember which structure a field belongs to is an extra effort? > On the other hand, the approach under discussion has explicit support > from multiple highly active developers. I have not seen this specific aspect of the issue discussed. > You are too late, many such changes have already been pushed in the last > several years. Nobody except you opposes them and the likelihood of > reversing them is extremely low. This whole thread is a pointless waste > of time that could be spend doing something actually useful. It is never too late to stop making things worse. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 19:24 ` Nicolas George @ 2023-04-24 19:41 ` Anton Khirnov 2023-04-24 20:33 ` Nicolas George 0 siblings, 1 reply; 44+ messages in thread From: Anton Khirnov @ 2023-04-24 19:41 UTC (permalink / raw) To: FFmpeg development discussions and patches Quoting Nicolas George (2023-04-24 21:24:20) > Anton Khirnov (12023-04-24): > > I have no idea what you mean by this. > > Try a little harder. No actual explanation then. So I suppose what you mean is that different rules apply to you and everyone else. > > The only fact here is that the quoted paragraph is YOUR PERSONAL > > OPINION, which ZERO other developers expressed support for. > > Or maybe I am the only one not fed up of arguing with walls. There is zero evidence of any active developer agreeing with you on this. Feel welcome to prove me wrong. > Will you dispute that each split of a structure is extra code in many > places? I will, the overhead code required is trivial compared to the code being wrapped. > Will you discuss that having to remember which structure a field belongs > to is an extra effort? I will, not having to consider whether a field is accessed from other parts of the code significantly reduces the mental load required. That is the whole point of information hiding. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data 2023-04-24 19:41 ` Anton Khirnov @ 2023-04-24 20:33 ` Nicolas George 0 siblings, 0 replies; 44+ messages in thread From: Nicolas George @ 2023-04-24 20:33 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 971 bytes --] Anton Khirnov (12023-04-24): > No actual explanation then. So I suppose what you mean is that different > rules apply to you and everyone else. No. I have said what I mean, I will not let you distort it to suit your needs. > I will, the overhead code required is trivial compared to the code being > wrapped. So there is overhead code. Thank you. > > Will you discuss that having to remember which structure a field belongs > > to is an extra effort? > I will, not having to consider whether a field is accessed from other parts > of the code significantly reduces the mental load required. That is the > whole point of information hiding. I see you have not actually refuted my point, so I consider it acted too. So, we have established this patch incurs a cost. Now you need to prove it brings a benefit. Not a hypothetical benefit like “whole point of information hiding”, but an actual immediate benefit. -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 24/25] fftools/ffmpeg: deprecate -adrift_threshold 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (21 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 25/25] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static Anton Khirnov 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel This option has had no effect since -async was removed in 3d86a13b47b726e49c2d780c5f723c290e8a36b4 --- doc/ffmpeg.texi | 6 ------ fftools/ffmpeg.h | 2 +- fftools/ffmpeg_opt.c | 14 ++++++++++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index cb8aa13df2..23bc03e11a 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -1748,12 +1748,6 @@ The default is -1.1. One possible usecase is to avoid framedrops in case of noisy timestamps or to increase frame drop precision in case of exact timestamps. -@item -adrift_threshold @var{time} -Set the minimum difference between timestamps and audio data (in seconds) to trigger -adding/dropping samples to make it match the timestamps. This option effectively is -a threshold to select between hard (add/drop) and soft (squeeze/stretch) compensation. -@code{-async} must be set to a positive value. - @item -apad @var{parameters} (@emph{output,per-stream}) Pad the output audio stream(s). This is the same as applying @code{-af apad}. Argument is a string of filter parameters composed the same as with the @code{apad} filter. diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 71f348da01..e3530d1699 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -55,6 +55,7 @@ #define FFMPEG_OPT_MAP_SYNC 1 #define FFMPEG_ROTATION_METADATA 1 #define FFMPEG_OPT_QPHIST 1 +#define FFMPEG_OPT_ADRIFT_THRESHOLD 1 enum VideoSyncMethod { VSYNC_AUTO = -1, @@ -727,7 +728,6 @@ extern int nb_filtergraphs; extern char *vstats_filename; extern char *sdp_filename; -extern float audio_drift_threshold; extern float dts_delta_threshold; extern float dts_error_threshold; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 408ef121b7..24208fa068 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1347,6 +1347,14 @@ static int opt_qphist(void *optctx, const char *opt, const char *arg) } #endif +#if FFMPEG_OPT_ADRIFT_THRESHOLD +static int opt_adrift_threshold(void *optctx, const char *opt, const char *arg) +{ + av_log(NULL, AV_LOG_WARNING, "Option -%s is deprecated and has no effect\n", opt); + return 0; +} +#endif + #define OFFSET(x) offsetof(OptionsContext, x) const OptionDef options[] = { /* main options */ @@ -1453,8 +1461,10 @@ const OptionDef options[] = { "set video sync method globally; deprecated, use -fps_mode", "" }, { "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &frame_drop_threshold }, "frame drop threshold", "" }, - { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &audio_drift_threshold }, - "audio drift threshold", "threshold" }, +#if FFMPEG_OPT_ADRIFT_THRESHOLD + { "adrift_threshold", HAS_ARG | OPT_EXPERT, { .func_arg = opt_adrift_threshold }, + "deprecated, does nothing", "threshold" }, +#endif { "copyts", OPT_BOOL | OPT_EXPERT, { ©_ts }, "copy timestamps" }, { "start_at_zero", OPT_BOOL | OPT_EXPERT, { &start_at_zero }, -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
* [FFmpeg-devel] [PATCH 25/25] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov ` (22 preceding siblings ...) 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 24/25] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov @ 2023-04-19 19:52 ` Anton Khirnov 23 siblings, 0 replies; 44+ messages in thread From: Anton Khirnov @ 2023-04-19 19:52 UTC (permalink / raw) To: ffmpeg-devel It is no longer used outside of this file. --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_filter.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index e3530d1699..43073f9a3c 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -801,7 +801,6 @@ void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub); int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference); int ifilter_send_eof(InputFilter *ifilter, int64_t pts); -int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame); int ifilter_parameters_from_codecpar(InputFilter *ifilter, AVCodecParameters *par); int ifilter_has_all_input_formats(FilterGraph *fg); diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index edfefc9d45..4b7b34b05d 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1329,7 +1329,7 @@ fail: return ret; } -int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame) +static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame) { AVFrameSideData *sd; int ret; -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 44+ messages in thread
end of thread, other threads:[~2023-04-24 23:31 UTC | newest] Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-04-19 19:52 [FFmpeg-devel] [PATCH 01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 02/25] fftools/ffmpeg_filter: drop unused AUTO_INSERT_FILTER_INPUT() Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 03/25] lavfi/avf_concat: rescale frame durations Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_enc: always use video frame durations when available Anton Khirnov 2023-04-19 20:42 ` James Almer 2023-04-19 21:12 ` Anton Khirnov 2023-04-24 10:22 ` Nicolas George 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 05/25] fftools/ffmpeg_enc: rename next_picture to frame Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 06/25] fftools/ffmpeg_enc: move handling final frames to video_sync_process() Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 07/25] fftools/ffmpeg: stop using InputStream.pts in ts_discontinuity_detect() Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 08/25] fftools/ffmpeg: stop setting InputStream.pts for streamcopy Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 09/25] fftools/ffmpeg: replace stream timebase with packet one where appropriate Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 10/25] fftools/ffmpeg_mux_init: consolidate handling -filter for audio/video Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 11/25] fftools/ffmpeg_mux_init: move check for mixing simple/complex filters Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 12/25] fftools/ffmpeg_mux_init: drop OutputStream.filters[_script] Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 13/25] fftools/ffmpeg: remove unused function arguments Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 14/25] fftools/ffmpeg_mux_init: drop useless new_stream_{data, unknown} Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 15/25] fftools/ffmpeg: reindent after previous commit Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 16/25] fftools/ffmpeg_filter: add a function for creating a filtergraph Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 17/25] fftools/ffmpeg_mux_init: drop a redundant assignment Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 18/25] fftools/ffmpeg: simplify init_output_filter() Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 19/25] fftools/ffmpeg_mux_init: rename init_output_filter() to ost_add_from_filter() Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 20/25] fftools/ffmpeg: move filtering functions to ffmpeg_filter Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 21/25] fftools/ffmpeg: move freeing a filtergraph into a separate function Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 22/25] fftools/ffmpeg_filter: reindent after previous commit Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 23/25] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov 2023-04-24 10:20 ` Nicolas George 2023-04-24 11:17 ` Anton Khirnov 2023-04-24 11:19 ` Nicolas George 2023-04-24 11:57 ` Anton Khirnov 2023-04-24 11:59 ` Nicolas George 2023-04-24 12:07 ` Anton Khirnov 2023-04-24 12:13 ` Nicolas George 2023-04-24 12:30 ` Anton Khirnov 2023-04-24 18:31 ` Nicolas George 2023-04-24 18:33 ` Paul B Mahol 2023-04-24 18:37 ` James Almer 2023-04-24 18:41 ` Paul B Mahol 2023-04-24 19:17 ` Anton Khirnov 2023-04-24 19:24 ` Nicolas George 2023-04-24 19:41 ` Anton Khirnov 2023-04-24 20:33 ` Nicolas George 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 24/25] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov 2023-04-19 19:52 ` [FFmpeg-devel] [PATCH 25/25] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static Anton Khirnov
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git