[FFmpeg-devel] [PATCH] Detect DTS in wav (issue70) + about?ac3-in-wav

Michael Niedermayer michaelni
Fri Jul 23 22:53:08 CEST 2010


On Fri, Jul 23, 2010 at 10:42:53PM +0300, Anssi Hannula wrote:
> Michael Niedermayer kirjoitti perjantai, 23. hein?kuuta 2010 21:29:38:
> > On Fri, Jul 23, 2010 at 06:40:30AM +0300, Anssi Hannula wrote:
> > > Anssi Hannula kirjoitti torstai, 22. hein?kuuta 2010 06:15:17:
> > > > Hi!
> > > > 
> > > > Attached are patches that fix issue70 (detection of DTS in wav).
> > > > 
> > > > Two new fields are added to AVStream that allow demuxers to set a
> > > > fallback codec to a stream, which gets used if no codec is probed in a
> > > > defined number of bytes.
> > > > Please comment if you think this should be done in some better way :)
> > > > 
> > > > I made the wav demuxer do the probing only for PCM_S16LE, as all my
> > > > dts/ac3- in-wav samples are like that. If people are aware of other
> > > > kind of files, it could be changed to cover more/all PCM codecs if
> > > > necessary.
> > > > 
> > > > 
> > > > This works fine for DTS (issue70)
> > > 
> > > The first patch added a warning (mixed code and declarations), attached
> > > is a fixed one. The second patch was ok.
> > 
> > i dont think this code will work reliable like this as the chances are
> > pretty high that mp3 or ac3 will be detected in random data with a very
> > low score
> 
> That won't happen, since set_codec_from_probe_data() gets called with score 
> AVPROBE_SCORE_MAX / 4 (i.e. any score <= AVPROBE_SCORE_MAX / 4 is ignored), 
> except in the very last iteration (st->probe_packet == 0), which we do not 
> actually reach due to s->probe_fallback_bytes.

that is if probe_packets is "larger" than probe_fallback_bytes
this feels quite hackish and it depends on how many bytes there
are per packet

I think it should be fallback_codec_id and fallback_score or maybe even
a pcm probe(), which is not impossible to do (0th order compressability
before and after dct)


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100723/72807f10/attachment.pgp>



More information about the ffmpeg-devel mailing list