[FFmpeg-trac] #9255(avcodec:open): DNX120 Decoding is broken in FFMpeg and FFPlay (fine in AVID and Adobe Premiere)
FFmpeg
trac at avcodec.org
Tue May 25 10:21:21 EEST 2021
#9255: DNX120 Decoding is broken in FFMpeg and FFPlay (fine in AVID and Adobe
Premiere)
------------------------------------+-----------------------------------
Reporter: FranceBB | Owner: (none)
Type: defect | Status: open
Priority: normal | Component: avcodec
Version: git-master | Resolution:
Keywords: dnxhd race | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+-----------------------------------
Comment (by FranceBB):
@Balling... it is fixed with -thread_type slice on Linux (Fedora 34) as
well.
Anyway, this is not an outlier, in the sense that every file we have been
receiving from the pitch from this camera were like this, so this is not a
corrupted file or anything, it's clearly a decoding error.
That being said, we've been tested several DNX120 and those that are
decoded correctly in FFMpeg without the -thread_type slice have:
[dnxhd @ 0000025bc07c7c80] interlaced 2, cur field 0
[dnxhd @ 00000222415e7c80] interlaced 3, cur field 1
while the ones that are decoded incorrectly and need the -thread_type
slice in order to decode them correctly have:
[dnxhd @ 0000025bc07c7c80] interlaced 2, cur field 0
[dnxhd @ 0000025bc07c7c80] interlaced 2, cur field 0
Besides, if I use ffprobe to see what's going on in the files that are not
decoded correctly I get:
ffprobe "test.dnxhd" -show_frames |findstr top_field_first
top_field_first=0
top_field_first=1
top_field_first=0
top_field_first=1
top_field_first=0
top_field_first=1
top_field_first=0
top_field_first=1
top_field_first=0
top_field_first=1
top_field_first=0
top_field_first=1
Now, according to the DNX standard, we have one frame header per field
(unlike in other codecs like MPEG-2 where we only have one frame header
for each pair of fields)
The frame header start sequence is 00 00 02 80 01 - the next byte tells us
if we deal with the first or second field of an interlaced frame
00 00 02 80 01 02 indicates first field
00 00 02 80 01 03 indicates second field
If I take one of the DNX120 which is decoded correctly in ffmpeg by
default, I have 02 and 03 that change with every frame header, like so:
frame 0, first field 00 00 02 80 01 02
frame 0, second field 00 00 02 80 01 03
00 00 02 80 01 02
00 00 02 80 01 03
00 00 02 80 01 02
00 00 02 80 01 03
but this is not the case for the DNX120 files we have received from the
pitch in which we have:
00 00 02 80 01 02
00 00 02 80 01 02
00 00 02 80 01 03
00 00 02 80 01 03
00 00 02 80 01 02
00 00 02 80 01 02
00 00 02 80 01 03
00 00 02 80 01 03
See the issue here?
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9255#comment:15>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list