From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 29888454F9 for ; Thu, 2 Mar 2023 19:16:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 12F8E68B3CE; Thu, 2 Mar 2023 21:16:27 +0200 (EET) Received: from canta.com.ar (mail.canta.com.ar [162.217.64.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F06C868A340 for ; Thu, 2 Mar 2023 21:16:20 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=canta.com.ar; s=mail; h=Content-Transfer-Encoding:Content-Type:Message-ID: Subject:To:From:Date:MIME-Version:Sender:Reply-To:Cc: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=bB8wUB1KP+x5cFb0mzttQvUv8x3pzoJcD9N2QIZsMu8=; b=03kFmWucA7YC8r3PpkBJEG1Uuu VSIb8uBtcIqmXyeZQpa8AIgEOEof+fVGl6cCmdr6T/VpFoI3CQSh4iI/2CtFrIJJt8jOG2odrm4dd 10zjb6hpnqs1pNIYfk945XzoOEirBtcedEy/IzbPVe35IrD66C+/Kx36nwjkp5ZumvoQ=; Received: from [127.0.0.1] (helo=canta.com.ar) by canta.com.ar with esmtp (Exim 4.92.3) (envelope-from ) id 1pXoPa-0007it-UH for ffmpeg-devel@ffmpeg.org; Thu, 02 Mar 2023 16:16:18 -0300 MIME-Version: 1.0 Date: Thu, 02 Mar 2023 16:16:18 -0300 From: =?UTF-8?Q?Daniel_Cantar=C3=ADn?= To: ffmpeg-devel@ffmpeg.org Message-ID: X-Sender: canta@canta.com.ar Subject: [FFmpeg-devel] Question: about "igndts" flag, and how to handle DTS output problems. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: I'm having trouble with DTS values in a single dvbsub stream while receiving LIVE MPEGTS with muxed video, audio, subs, and other data (like scte35) over multicast UDP. I'm doing transcoding tasks, and then output that to another MPEGTS stream that feeds other services. This are the problems I'm facing: ``` (...) [mpegts @ 0x5591147cf280] Non-monotonous DTS in output stream 0:3; previous: 5729374, current: 5292077; changing to 5729375. This may result in incorrect timestamps in the output file. [mpegts @ 0x5591147cf280] Non-monotonous DTS in output stream 0:3; previous: 5729375, current: 5293810; changing to 5729376. This may result in incorrect timestamps in the output file. [mpegts @ 0x5591147cf280] Non-monotonous DTS in output stream 0:3; previous: 5729376, current: 5300564; changing to 5729377. This may result in incorrect timestamps in the output file. [mpegts @ 0x5591147cf280] Non-monotonous DTS in output stream 0:3; previous: 5729377, current: 5302255; changing to 5729378. This may result in incorrect timestamps in the output file. (...) ``` This has the effect that, later in my work's pipeline, subtitles give trouble with players. I would like to avoid this ffmpeg DTS correction ("with the error", if you prefer that interpretation), and thus I tested lots of options without success, including the `+igndts` flag. It actually doesn't seem to do anything. So I went to check what it actually does, and found this. ``` user@computer:/path/to/ffmpeg/repo$ grep -rn "AVFMT_FLAG_IGNDTS" . 2>/dev/null ./libavformat/options_table.h:48:{"igndts", "ignore dts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNDTS }, INT_MIN, INT_MAX, D, "fflags"}, ./libavformat/avformat.h:1228:#define AVFMT_FLAG_IGNDTS 0x0008 ///< Ignore DTS on frames that contain both DTS & PTS ./libavformat/demux.c:963: if ((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE) user@computer:/path/to/ffmpeg/repo$ ``` It seems it's only used on demux (input), and not at mux time (output). So I went to check what's going on with that "Non-monotonous" thing, and found that `fftools/ffmpeg_mux.c` has a code in line 108 where it checks for DTS values without any consideration for skipping such check. With this in mind, I would like to ask a some questions here about my situation, which I'm unsure if it's worthy of a ticket. 1. Is there a way to ignore this DTS issue at mux time and just output whatever DTS is on the packet? Sounds like "igndts" would be useful at output too, by just adding it to that line 108 check. But perhaps there are other way to achieve it. 2. Do you know of some way I could fix this my own way without this ffmpeg mux auto-fix? I would do some setpts filter magic if I could, but as this is a subtitle stream I have no way to use filters on it. And being live streams is really troublesome to apply fixes: I'm trying several other tools as proxies right now. 3. I see another code before that 108 line. It involves `s->oformat->flags & AVFMT_TS_NONSTRICT`. But I'm not sure of how to toggle AVFMT_TS_NONSTRICT from command line to see its effects. Is it perhaps "-strict experimental"? Thanks, Daniel. _______________________________________________ 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".