>
>
> Message: 4
> Date: Sat, 26 Jul 2014 08:07:57 +0200
> From: Luca Barbato <[email protected]>
> To: [email protected]
> Subject: Re: [libav-api] Parsing VP8 Bitstreams
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=windows-1252
>
> On 26/07/14 00:58, Joseph Rosensweig wrote:
> > I've just started to learn about VP8, so give me some slack if this is a
> > dumb question.
> > H.264 Example
> >
> > In the past I've worked mostly with H.264. Whenever I needed to parse
> H.264
> > bit streams, I would leverage libav to help me and use something like
> this
> >
> > av_register_all();
> >
> > _ioContext = avio_alloc_context(
> >         encodedData,
> >         H264_READER_BUF_SIZE,
> >         0,
> >         0,
> >         &readFunction,
> >         NULL,
> >         NULL);
> > if (_ioContext == NULL)
> >     throw std::exception("Unable to create AV IO Context");
> >
> > AVInputFormat *h264Format = av_find_input_format("h264");
> > if (h264Format == NULL) {
> >     throw std::exception("Unable to find H264 Format");
> > }
> >
> > _context = avformat_alloc_context();
> > _context->pb = _ioContext;
> >
> > ret = avformat_open_input(&_context,
> >         "",
> >         h264Format,
> >         NULL);
> >
> > if (ret != 0) {
> >     throw std::exception(
> >             "Failed to open input file :" +
> >             std::string(_avErrToString(ret)));
> > }
> >
> > ....
> >
> > ....
> >
> > int ret = av_read_frame(_context, &_packet);
> >
> > VP8
> >
> > The above method has worked great for parsing the H.264 bit streams and
> > providing me with H.264 frames to feed to my own decoding infrastructure.
> >
> > I'm trying to duplicate the same effort with VP8. I tried using this code
> > as a basis and instead of looking for the "h264" format, I've tried "vp8"
> > and "webm". "vp8" doesn't seem valid, but "webm" is able to load a
> format.
> > However when I get to avformat_open_input I get this error:
>
> h264 is a codec and also an elementary stream format
>
> > [matroska,webm @ 0x101812400] Unknown entry 0xF0
> > [matroska,webm @ 0x101812400] EBML header using unsupported features
> > (EBML version 0, doctype (null), doc version 0)
> > Failed to open input file :Not yet implemented in FFmpeg, patches welcome
> >
> > Am I out of look? Or am I just approaching this incorrectly?
>
> You may ask libav which is the format you are trying to demux, I think
> it could be ivf (that's the closest to a vp8 elementary stream) if you
> want to keep restricting what is supported and what is not.
>
> lu
>

Hi Luca,

    I decided to try the AVProbe route to keep things flexible and get an
idea of what I wanted to do.  Here is a link to my small example code
http://pastie.org/9424879.

    If I try to run this on h264, webm, and ivr in that order.  I get the
results below.  First snippet is some info derived from mediainfo.  Second
is my program results.  Does this mean that libav can't parse the webm or
ivf data files.  Or am I still doing something wrong?

===== ../../bear.h264 ====

-- MEDIA INFO --
Complete name                            : ../../bear.h264
Format                                   : AVC
Format/Info                              : Advanced Video Codec

--- Sample Program Result ---
Format for ../../bear.h264 is h264
Successfully parsed 61 frames!

===== ../../bear.ivf ====
-- MEDIA INFO --
Complete name                            : ../../bear.ivf
Format                                   : IVF
Format                                   : VP8

--- Sample Program Result ---
Unable to find format for ../../bear.ivf

===== ../../bear.webm ====
-- MEDIA INFO --
Complete name                            : ../../bear.webm
Format                                   : WebM
Format version                           : Version 2
Format                                   : VP8

--- Sample Program Result ---
Unable to find format for ../../bear.webm
_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to