[FFmpeg-devel] [PATCH v2 1/2] libavcodec/jpeg2000dec.c: Add functions and modify structs for PPT marker support

Gautam Ramakrishnan gautamramk at gmail.com
Sat Mar 28 05:17:39 EET 2020


On Sat, Mar 28, 2020 at 1:59 AM Gautam Ramakrishnan
<gautamramk at gmail.com> wrote:
>
> On Sat, Mar 28, 2020 at 1:52 AM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> >
> > Am Fr., 27. März 2020 um 20:57 Uhr schrieb Gautam Ramakrishnan
> > <gautamramk at gmail.com>:
> > >
> > > On Sat, Mar 28, 2020 at 12:45 AM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> > > >
> > > > Am Fr., 27. März 2020 um 19:24 Uhr schrieb Gautam Ramakrishnan
> > > > <gautamramk at gmail.com>:
> > > >
> > > > > > > > Did you already look at the sample file I pointed out?
> > > > > > > Yep, am going through the sample file. I shall try to see what
> > > > > > > is causing those errors. However I am assuming that the errors
> > > > > > > could be due to other bugs in the decoder or due to some
> > > > > > > unimplemented features?
> > > > > >
> > > > > > Could be, I don't know, please find out.
> > > > > >
> > > > > The mxf demuxer says: error getting stream index 67174400
> > > > > Does this mean that the mxf demuxer is unable to read the mxf
> > > > > packet itself? Looking at the error thrown by the jpeg2000 decoder,
> > > > > looks like the jpeg2000 frame is corrupt.
> > > >
> > > > I don't think so, you can test with libopenjpeg.
> > > >
> > > I tried using libopenjpeg as the decoder. I run the command
> > > ./ffmpeg -c:v libopenjpeg -i ~/Downloads/jpeg2000_mxf_first_10mb.mxf
> > > -r 1/1 out%03d.bmp
> > > I get only 3 .bmp images as output.
> > > I get the same images compared to when I use the native decoder.
> >
> > rm "-r 1/1"
> > It is supposed to produce 84 frames
> >
> Got 84 frames. I'll try the native decoder.
> > Carl Eugen
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
>
>
> --
> -------------
> Gautam |

Looks like the stream is missing an EOC marker. Even openjpeg throws
the same error.

On replacing (in read_main_headers() )
if (len < 2 || bytestream2_get_bytes_left(&s->g) < len - 2) {
    av_log(s->avctx, AV_LOG_ERROR, "Invalid len %d left=%d\n", len,
bytestream2_get_bytes_left(&s->g));
    return AVERROR_INVALIDDATA;
}

with

if (len < 2 || bytestream2_get_bytes_left(&s->g) < len - 2) {
    av_log(s->avctx, AV_LOG_ERROR, "Invalid len %d left=%d\n", len,
bytestream2_get_bytes_left(&s->g));
    av_log(s->avctx, AV_LOG_WARNING, "Stream does not end with EOC.\n");
    return 0;
}
the code runs correctly. Openjpeg also has a check wherein if the
number of bytes left is 0,
but there is no EOC marker, just return as done. Not sure what to do about this.
-- 
-------------
Gautam |


More information about the ffmpeg-devel mailing list