From: "Daniel Cantarín" <canta@canta.com.ar> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] Question: about "igndts" flag, and how to handle DTS output problems. Date: Thu, 02 Mar 2023 16:16:18 -0300 Message-ID: <e959535f37d52d61f7b8148168b4bbfa@canta.com.ar> (raw) 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".
reply other threads:[~2023-03-02 19:16 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=e959535f37d52d61f7b8148168b4bbfa@canta.com.ar \ --to=canta@canta.com.ar \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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