[FFmpeg-cvslog] Reimplement stream probe try #2

Baptiste Coudurier baptiste.coudurier at gmail.com
Mon Apr 4 23:44:44 CEST 2011


Hi,

On 04/04/2011 12:53 PM, Michael Niedermayer wrote:
> On Mon, Apr 04, 2011 at 11:06:23AM -0700, Baptiste Coudurier wrote:
>> On 4/3/11 9:20 AM, Michael Niedermayer wrote:
>>> [...]
>>>
>>> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
>>> index 803acb3..71e8d73 100644
>>> --- a/libavformat/mpegts.c
>>> +++ b/libavformat/mpegts.c
>>> @@ -704,10 +704,10 @@ static int mpegts_push_data(MpegTSFilter *filter,
>>>                          code != 0x1ff && code != 0x1f2 && /* program_stream_directory, DSMCC_stream */
>>>                          code != 0x1f8) {                  /* ITU-T Rec. H.222.1 type E stream */
>>>                          pes->state = MPEGTS_PESHEADER;
>>> -                        if (pes->st->codec->codec_id == CODEC_ID_NONE) {
>>> +                        if (!pes->st->request_probe) {
>>>                              av_dlog(pes->stream, "pid=%x stream_type=%x probing\n",
>>>                                      pes->pid, pes->stream_type);
>>> -                            pes->st->codec->codec_id = CODEC_ID_PROBE;
>>> +                            pes->st->request_probe= 1;
>>>                          }
>>
>> Humm, the check against CODEC_ID_NONE must not be changed, why was it ?
> 
> Its a bit complicated
> The problems where mainly due to end detection
> there are 3+ thresholds that can lead to stream probe abortion
> the per stream packet buffer size, the per context bytes in the buffer
> the end of the file as well as the end of the stream and possibly
> more
> Now probing before the end used a threshold to ignore uncertain
> detections and only at the end the best independant of its score should
> be choosen but this failed in at least some end scenarios.
> 
> so now codec_id is always set to the best codec found but we continue
> probing until the thresholds hit or we have a good enough match.
> The advantage is no matter how or where we end codec_id is set to
> the best match, this though means it cant be set to CODEC_ID_PROBE.
> which leads then to the need of request_probe

I'm not talking about that.
probing must be activated only is codec_id == CODEC_ID_NONE, you removed
that.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org


More information about the ffmpeg-cvslog mailing list