[FFmpeg-devel] Query regarding codec parsers

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Apr 17 00:57:50 EEST 2020


Am Do., 16. Apr. 2020 um 12:24 Uhr schrieb Gautam Ramakrishnan
<gautamramk at gmail.com>:
>
> On Mon, Apr 13, 2020 at 11:00 PM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> >
> > Am Mo., 13. Apr. 2020 um 17:27 Uhr schrieb Gautam Ramakrishnan
> > <gautamramk at gmail.com>:
> > >
> > > On Sun, Mar 29, 2020 at 8:34 PM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> > > >
> > > > Am So., 29. März 2020 um 16:45 Uhr schrieb Gautam Ramakrishnan
> > > > <gautamramk at gmail.com>:
> > > >
> > > > > > > What exactly does a parser do and how is it different from a decoder?
> > > > > > > I am unable to understand the exact use case of a parser.
> > > > > >
> > > > > > Try the following:
> > > > > > $ cat 1.jpg 2.jpg | ffmpeg -i -f null -
> > > > > > (Is expected to decode two frames as can be seen in the console output,
> > > > > > also works for example with png)
> > > > > >
> > > > > > $ cat 1.j2k 2.j2k | ffmpeg -i - -f null -
> > > > > > Will only decode one frame because there is no parser to split the
> > > > > > input.
> > > > > >
> > > > > So does it basically try to find the SOC marker and EOC markers and
> > > > > split the streams into frames?
> > > >
> > > > Basically, yes.
> > > > Look at existing parsers in libavcodec/*parser* (or git grep AVCodecParser),
> > > > especially the jpeg parser.
> >
> > > Would working on a parser be a good idea now?
> >
> > Either that or you look at ticket #4681 (no idea how difficult this is).

> I thought I'll start with the parser first.
> I went through the BMP and JPEG parsers and needed some more clarification.
> So, each frame could either be a JPEG2000 file or a JPEG2000 codestream.
> The parse function must be able to find the end of the file/codestream
> and return the location of it. Is my understanding correct?

It is supposed to find the end of the first and the beginning of the
second frame in above example, see what the jpg parser does.

Carl Eugen


More information about the ffmpeg-devel mailing list