Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Marton Balint <cus@passwd.hu>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2] avformat/mpegts: set data broadcast streams as such
Date: Tue, 19 Apr 2022 22:06:00 +0200 (CEST)
Message-ID: <2cb9d798-8dfb-5f5b-96e1-143e9b74d6ed@passwd.hu> (raw)
In-Reply-To: <CAEu79SYew+SDSdK3dJO-0=2GvA3otHfW89xfH9D5skc0aFn7VQ@mail.gmail.com>



On Tue, 19 Apr 2022, Jan Ekström wrote:

> On Tue, Apr 19, 2022 at 1:13 PM Jan Ekström <jeebjp@gmail.com> wrote:
>>
>> On Tue, Apr 19, 2022 at 3:00 AM Marton Balint <cus@passwd.hu> wrote:
>> >
>> >
>> >
>> > On Thu, 14 Apr 2022, Jan Ekström wrote:
>> >
>> > > On Mon, Apr 11, 2022 at 1:50 PM Jan Ekström <jeebjp@gmail.com> wrote:
>> > >>
>> > >> From: Jan Ekström <jan.ekstrom@24i.com>
>> > >>
>> > >> Additionally, they should not be probed, as this is essentially
>> > >> various types of binary data.
>> > >>
>> > >> Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
>> > >> ---
>> > >
>> > > Ping.
>> > >
>> > > Basically this checks if we have an unknown stream with a private
>> > > stream type still at the end of the per-stream loop in PMT parsing,
>> > > and then cancels the stop of parsing that usually occurs as a PMT is
>> > > hit. Instead the logic will continue parsing further. When an SDT is
>> > > then found and a PMT for that program has already been received, it
>> > > will then stop header reading at that point.
>> >
>> > But why does it matter when the initial parsing is stopped? I mean it
>> > stops at the first PMT right now, nobody expects it to find all the
>> > programs and all the streams or all the stream codecs/parameters.
>> >
>> > I am saying, that ideally, the ts->stop_parse magic should not be needed
>> > to be changed to fix your issue and when an SDT is detected with the
>> > broadcast descriptor that should stop any existing data stream parsing. Do
>> > you know why it does not work like that?
>> >
>>
>> If the codec is unknown after header parsing, the general parsing
>> logic is utilized to probe which codec is possibly in that unknown
>> stream, and thus more data is read from that stream, which can cause
>> further delays.
>>
>> If the codec is known as data, it leads to no such result.
>>
>> Basically, the idea is to figure out whether a stream is a data stream
>> or not during header parsing, if possible.
>>
>
> Just double-checked and the difference is whether
> max_stream_analyze_duration gets utilized in
> libavformat/demux.c::avformat_find_stream_info .
>
> If a stream is marked as unknown, it will get checked for longer. If
> it is marked as a known "codec" it gets through quicker.

The part of the patch which parses the SDT and sets the codec is fine. 
But the fact that you have to set the codec during mpegts_read_header 
to make it stop parsing definitely looks like some bug in some code 
somewhere. It should be enough to set the codec sometime later in 
mpegts_read_packet() (which is called during avformat_find_stream_info())

Or to make it even more strange: comment out handle_packets() in 
mpegts_read_header. And it will work just fine. So if nothing is parsed 
in mpegts_read_header then it works. If something is parsed, then it does 
not. Kind of unexpected...

Regards,
Marton

>
> There is a longer sample from an example stream under:
> https://megumin.fushizen.eu/samples/2022-02-04-radio_with_data_stream/
> with the files
> 13699753.{ts,aux}
>
> You can then
> `multicat -U ./13699753.ts "239.255.1.1:6001@127.0.0.1/ifaddr=127.0.0.1"`
> and that should bind & connect and start pushing out UDP multicast via
> localhost, using the aux file as timing.
>
> Then you can with f.ex. ffprobe do
> `/usr/bin/time -v ffprobe -v verbose -localaddr 127.0.0.1
> udp://239.255.1.1:6001`
> and compare the probe times with and without SDT being parsed during
> the header read :) .
>
> Jan
> _______________________________________________
> 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".

  reply	other threads:[~2022-04-19 20:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 10:50 Jan Ekström
2022-04-11 13:31 ` Jan Ekström
2022-04-14  6:59 ` Jan Ekström
2022-04-19  0:00   ` Marton Balint
2022-04-19 10:13     ` Jan Ekström
2022-04-19 14:08       ` Jan Ekström
2022-04-19 20:06         ` Marton Balint [this message]
2022-04-25 10:36           ` Jan Ekström
2022-04-25 11:33             ` Jan Ekström
2022-04-25 12:19               ` Jan Ekström
2022-04-25 14:45                 ` Jan Ekström

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=2cb9d798-8dfb-5f5b-96e1-143e9b74d6ed@passwd.hu \
    --to=cus@passwd.hu \
    --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