[FFmpeg-devel] 4:2:0 DV25 file wrongly identified as 4:1:1

Michael Niedermayer michaelni
Tue Sep 14 18:05:03 CEST 2010


On Fri, Sep 03, 2010 at 02:06:13PM +0200, Niobos wrote:
> Hi,
> 
> I'm trying to pin down an issue we're having decoding a DV25 stream. The
> problem seems to be that ffmpeg (libavcodec to be more precise) thinks
> the content is in SMPTE314M 4:1:1 format, while it actually is in
> IEC61834 4:2:0 format. I'm not sure that ffmpeg is wrong; the file does
> look fishy too...
> 
> 
> First some context from the libavcodec's point of view:
> 
> The corresponding if-statement seems to be located here:
> libavcodec/dvdata.c:258
>    /* 576i50 25Mbps 4:1:1 is a special case */
>    if (dsf == 1 && stype == 0 && frame[5] & 0x07) {
>        return &dv_profiles[2];
>    }
> Especially the last condition checking frame[5]'s lower 3 bits.
> 
> This line dates back from commit
> 69afa85bf7cb5e3491efdd088d7b5067a2858d6d, but the logic is much older. I
> traced it back through GIT (sorry, I'm a little more familiar with GIT
> than with SVN): (recent to old)
> * 69afa85bf7cb5e3491efdd088d7b5067a2858d6d
> * fe4d60d52c7ba06b5d035db6660820dc07c45272
> * ba65fac202644cce948a7f11bd27759499213d1c
> * 691af50dbdf7262aa732b1a2eab42fb2f6873316
> 
> During the beginning of its lifetime, it was commented as "APT flag",
> but that comment was lost on the last commit (69afa).
> 
> 
> The DV-stream contains the following Application ID fields:
> APT=0b000 AP1=0b001 AP2=0b001 AP3=0b001
> 
> SMPTE314M states that four 0b000 values indicate IEC parameters (4:2:0,
> correct in this case); while four 0b001 values indicate SMPTE parameters
> (4:1:1, incorrect in this case). Clearly, this file conforms to none of
> these defined sets.
> 
> 
> The reason why I'm raising this issue here (as well as with the tool
> that produced the file), is that a simple fix (attached) will:
> * make ffmpeg work for our production system
> * conform to the original comment (which is now lost) by checking the
> APT flag instead of the AP1 flag.
> 
> Obviously, this change may break DV decoding if the current behaviour is
> desired. I'm no expert on the DV format, comments and insights are welcome.

do we have a maintainer for DV? IIRC roman was not active lately ...

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100914/d2a354b8/attachment.pgp>



More information about the ffmpeg-devel mailing list