From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id AB6184EE46 for ; Tue, 17 Feb 2026 17:29:42 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'SDM6I8J+SLTUrapUEilMVANDvYXzHlzITKOxlbovMUU=', expected b'bVqvKkiirKe96me3M/qNGU63AlPVlhBipxRou8UyP/A=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1771349371; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=SDM6I8J+SLTUrapUEilMVANDvYXzHlzITKOxlbovMUU=; b=TWHFTBkhKMiqRVKXxEGF572KY0y4ImilBNrOkyLwSOtmbO4PMmKftCgGeoQrTys7nYmQd 7DDHNS8SxykOCeVmh4MUBglfNM+of+RGy8bePbvab2X5GIgsb8qZZMKw5LXVtuMKLMJRh6l vT1krX1BNuWQUnxvB6Tgnh1pslhoequNewsgQckn/dcbHe8gumnojAae2ZmW5+c3LZMKUh+ oW0xmiWn2HQwfrquff/jq6pO+nHH3enXkzhvOUvz+dtn1MPJDyasqP136V/OFdXFUaXGw4z kKJTeHjL5oouSuPkfHum7HjRCo8Ey1ibC9IrtRQ03Q0x5KcpuJSUHlYHvE5w== Received: from [172.18.0.3] (unknown [172.18.0.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id A1E7C691167; Tue, 17 Feb 2026 19:29:31 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1771349357; b=b96iJGMyJWwYg1rryaiYU1ydv17AdZpznb8xtVIwslbCW2arjEypqbcLfpiJ4k9k4XrGw Wb028WEtLGwZkaiogrnhLs/kyjJsPgGuONS1Ab+514RJyjvl7q9SqK5Y/ELlnRIntYueLLn 41Mc+wfY51FB60IexOpKH9yTCIrG6AnCxMA+xT/QOA9ImpzGq3m1PlAxFx7+kosSCraQjH2 Ah+BTnIW3qR+zH5p96dfjZgcf1HWbLnUgRnCJRIL4nFtNg6SiH2zmEvNen87aJBYeqXQORA Uc+XXtSXP7Ysj+aJ8lJ3WJ6WUBHAX7S5jBoxCPek2CcnNw8jPIgRdlUBM6tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1771349357; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=MsauEYGOgNXEl/YkgFsJXJCubZEnhn86lmJK0cdRUM0=; b=ANrtcTo3Uq61YriNRBYSX4h6TvElY9ve0SQHZavsXSN90immaRsgN42SDzB6n1iTepUtB Dvq9y8WvDJoBKua2XRXr2WAkWTrNy9cGE2C19MdRpMzm/ZgyLM9XeCDnz4IArx7/wYH6VEp CmNcHCkdj/JrhPUia97yzAxAkecgzeVpHDRCguYmBIlgH0acsAHP//H6FSnpRxSliYsFodR EsBwlBUTmG+a/kkpmISW9bnME4KkwMDvDfw/c804dWkXaPLvwyd7xOuQzJR0cGp8RlSFsb3 agBgi8ne1bzu7O6g7bZGZQtF3JQ8F+UkaqRh5uclI4flSuzfyWrqSzUF5y9A== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1771349349; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=bVqvKkiirKe96me3M/qNGU63AlPVlhBipxRou8UyP/A=; b=WVWiZuLILnwRKQBztXivR3WQen5BZjWUvSqbHizetqfjP7mz4ELJtn0EBQJOA0UbTYOUE S9Kpo3L5JKHihRKEtDLTb/8dlrCXW37fxx8xxYrOuGT/WxVe9JkIbToZGX5X07s87doG0UL AS4OoBN+PHe0nL3O/uz+hCUO0hNq4i6Vgd0D+F3GECXUnua+YXqBDftxYTBBoVcu6CSRGsN /i8jhXRGlKpokAsHMCmbJxfPLIxApwO5IGIOa/bn05CpKZ2XDb2galLO4K/kNCqLOuFy48S EfilJVJ2V3QzuJKh9QtSp45aect6pJQV4XVfupynEEN4jFLwCcnJUOIvovLQ== Received: from c8d966988b92 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 40D81691130 for ; Tue, 17 Feb 2026 19:29:09 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 Feb 2026 17:29:08 -0000 Message-ID: <177134934939.25.1931974684882116716@29965ddac10e> Message-ID-Hash: ITR75HSLK6X3U3BUDEQUC5XXESFR5DEH X-Message-ID-Hash: ITR75HSLK6X3U3BUDEQUC5XXESFR5DEH X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] fftools/ffmpeg_sched: report progress using max dts instead of trailing_dts() (PR #21775) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: ngaullier via ffmpeg-devel Cc: ngaullier Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21775 opened by ngaullier URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21775 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21775.patch Here is a straightforward mpegts sample with teletext subtitles declared in the PMT but no data (only stuffing and signaling: nothing at decoder output), so it exhibits the N/A reporting issue: https://0x0.st/PMyL.ts Simple cmdline (to be used with -re or -stats_period) ffmpeg -txt_format text -i PMyL.ts -c:s srt -f null - ---- This is to reapply 18217bb0f5fb4ad9d93ea02edab078111cd83910. Its commit msg is still meaningful: "Using the max instead of the min avoids the progress stopping with gaps in sparse streams (subtitles)." Also on a very similar issue: currently, a single stream with no data makes ffmpeg reports N/A for both time and speed. Fix this by ignoring missing dtses. Fix regressions since d119ae2fd82a494d9430ff4d4fc262961a68c598. Signed-off-by: Nicolas Gaullier >>From dca5622564a147091a281b8751b7e48890d70d02 Mon Sep 17 00:00:00 2001 From: Nicolas Gaullier Date: Tue, 17 Feb 2026 12:07:51 +0100 Subject: [PATCH] fftools/ffmpeg_sched: report progress using max dts instead of trailing_dts() This is to reapply 18217bb0f5fb4ad9d93ea02edab078111cd83910. Its commit msg is still meaningful: "Using the max instead of the min avoids the progress stopping with gaps in sparse streams (subtitles)." Also on a very similar issue: currently, a single stream with no data makes ffmpeg reports N/A for both time and speed. Fix this by ignoring missing dtses. Fix regressions since d119ae2fd82a494d9430ff4d4fc262961a68c598. Signed-off-by: Nicolas Gaullier --- fftools/ffmpeg_sched.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg_sched.c b/fftools/ffmpeg_sched.c index 517ff1ea85..dc5800d094 100644 --- a/fftools/ffmpeg_sched.c +++ b/fftools/ffmpeg_sched.c @@ -435,7 +435,7 @@ static void task_init(Scheduler *sch, SchTask *task, enum SchedulerNodeType type task->func_arg = func_arg; } -static int64_t trailing_dts(const Scheduler *sch, int count_finished) +static int64_t trailing_dts(const Scheduler *sch) { int64_t min_dts = INT64_MAX; @@ -445,7 +445,7 @@ static int64_t trailing_dts(const Scheduler *sch, int count_finished) for (unsigned j = 0; j < mux->nb_streams; j++) { const SchMuxStream *ms = &mux->streams[j]; - if (ms->source_finished && !count_finished) + if (ms->source_finished) continue; if (ms->last_dts == AV_NOPTS_VALUE) return AV_NOPTS_VALUE; @@ -457,6 +457,26 @@ static int64_t trailing_dts(const Scheduler *sch, int count_finished) return min_dts == INT64_MAX ? AV_NOPTS_VALUE : min_dts; } +static int64_t progressing_dts(const Scheduler *sch, int count_finished) +{ + int64_t max_dts = INT64_MIN; + + for (unsigned i = 0; i < sch->nb_mux; i++) { + const SchMux *mux = &sch->mux[i]; + + for (unsigned j = 0; j < mux->nb_streams; j++) { + const SchMuxStream *ms = &mux->streams[j]; + + if (ms->source_finished && !count_finished) + continue; + if (ms->last_dts != AV_NOPTS_VALUE) + max_dts = FFMAX(max_dts, ms->last_dts); + } + } + + return max_dts == INT64_MIN ? AV_NOPTS_VALUE : max_dts; +} + void sch_remove_filtergraph(Scheduler *sch, int idx) { SchFilterGraph *fg = &sch->filters[idx]; @@ -1399,9 +1419,9 @@ static void schedule_update_locked(Scheduler *sch) if (atomic_load(&sch->terminate)) return; - dts = trailing_dts(sch, 0); + dts = trailing_dts(sch); - atomic_store(&sch->last_dts, dts); + atomic_store(&sch->last_dts, progressing_dts(sch, 0)); // initialize our internal state for (unsigned type = 0; type < 2; type++) @@ -2768,7 +2788,7 @@ int sch_stop(Scheduler *sch, int64_t *finish_ts) } if (finish_ts) - *finish_ts = trailing_dts(sch, 1); + *finish_ts = progressing_dts(sch, 1); sch->state = SCH_STATE_STOPPED; -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org