using libav* for audio decoding and packetizing - an example

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using libav* for audio decoding and packetizing - an example

Martin Runge
Hello ffmpeg users,

I am new to libavformat and libavcodec and I missed a really simple "hello
world style" example to get started with audio precessing. Roberto and a
second ffmpeg project member (sorry, I forgot your name) have been so kind to
help me getting started when I visited the ffmpeg booth at Linuxtag 2008 in
Berlin.

I prepared an (hopefully) easy to understand example how to:
 
1) use libavformat to read an audio file packet by packet / disassemble a
stream into packets.
2) decode these packets to raw audio using libavcodec

you can find the example attached or in the wiki of the muroa player project
here:

http://muroa.org/dokuwiki/doku.php?id=src:ffmpeg_examples

there you can also download a ready to build tarball (automake based).
 
comments on the code are welcome, I am looking forward to integrate your
suggestions into the example or add further examples.

Is the example useful enough for inclusion in the ffmpeg distribution?

best regards
Martin

_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

main.cpp (7K) Download Attachment
signature.asc (844 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: using libav* for audio decoding and packetizing - an example

Stefano Sabatini
On date Sunday 2008-07-13 19:19:09 +0200, Martin Runge wrote:

> Hello ffmpeg users,
>
> I am new to libavformat and libavcodec and I missed a really simple "hello
> world style" example to get started with audio precessing. Roberto and a
> second ffmpeg project member (sorry, I forgot your name) have been so kind to
> help me getting started when I visited the ffmpeg booth at Linuxtag 2008 in
> Berlin.
>
> I prepared an (hopefully) easy to understand example how to:
>  
> 1) use libavformat to read an audio file packet by packet / disassemble a
> stream into packets.
> 2) decode these packets to raw audio using libavcodec
>
> you can find the example attached or in the wiki of the muroa player project
> here:
>
> http://muroa.org/dokuwiki/doku.php?id=src:ffmpeg_examples
>
> there you can also download a ready to build tarball (automake based).
>  
> comments on the code are welcome, I am looking forward to integrate your
> suggestions into the example or add further examples.
>
> Is the example useful enough for inclusion in the ffmpeg distribution?

I don't think that's a good idea, developers have already too much
work, FFmpeg evolves rather fastly so to keep examples updated would
be painful, a better idea could be to publish them on the multimedia
wiki, then users could report problems or improvements on libav-user
or directly fix them on the wiki.

It's *really* important to have a central repository for usage
examples, so to minimize the community effort, and the multimedia wiki
is the best candidate for that.

[...]

> #include <iostream>
> #include <string>
> extern "C" {
> #include <ffmpeg/avformat.h>
> #include <ffmpeg/avcodec.h>
> }

Outdated inclusion style, since 12XXX you have to use
libavformat/avformat.h, libavcodec/avcodec.h.

> #include <stdint.h>
> #include <assert.h>
>
> using namespace std;

I think a basic example should use plain C, then I'm not against other
C++ examples.
 
[...]

Thanks for your contribution, regards.
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user