Discussion:
[Libav-user] FFmpeg libavcodec examples
Ken Bass
2014-04-13 02:41:59 UTC
Permalink
This has probably been hashed out many times before, but I just started
coding with libavcodec and feel like I just ran into a brick wall.

The example I am working with now is the "libavcdec/api-example" on your
site @ /doxygen/0.6/api-example_8c-source.html.

I don't know if the program will work, since I can't get it to compile. The
main problem I run into is that the example is extremely out of date. Many
of the function calls are deprecated, as well as constants and enums
changed. (I won't elaborate since it is probably all well known).

All I am trying to do right now is this: I have raw audio and video streams
that I want to encode and mux into a file. Simple, right?

But I can't find any working examples of this anywhere.

Please help!

TIA

(BTW: the one "issue" that REALLY hurt was that the libraries are all "C"
only. It was a simple solution for me to enclose the library headers with
extern "C", but it would have been nice if someone had mentioned it
somewhere obvious :-( ).
Joshua Kordani
2014-04-13 04:35:07 UTC
Permalink
For starters, locate the doxygen for the latest version of that file.  Your link indicates that you are referencing a very old version.

Your best bet is likely to be working from a checkout of the latest trunk version and find
Ken Bass
2014-04-13 14:53:02 UTC
Permalink
Okay, my bad, sort of :-).

I went to the ffmpeg home page, followed the link to the "current" doxygen
documentation link, and finally got to an updated an (presumably) working
example.

The only one to really blame, I guess, is google ( is that like blaming
g*d?), since that is how I got the first, outdated, link. Don't know how to
fix that.

In a previous life, I was a sw designer/architect/company. So from that
experience, might I suggest that for those older versions of the
documentation, putting (noticeable) text somewhere stating that that isn't
the "current" version, and perhaps with a link to the current version. That
would have saved me many days of hitting that brick wall. But then, this is
only a suggestion. You guys are the experts, and obviously good ones at
that :-). Thanks for great (open src) software.

And thx, Joshua, for your response.

ken
Post by Joshua Kordani
For starters, locate the doxygen for the latest version of that file.
Your link indicates that you are referencing a very old version.
Your best bet is likely to be working from a checkout of the latest trunk
version and find that file and follow the library build instructions
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Joshua Kordani
2014-04-14 03:15:57 UTC
Permalink
Post by Ken Bass
The only one to really blame, I guess, is google ( is that like
blaming g*d?), since that is how I got the first, outdated, link.
Don't know how to fix that.
This happened to me too
Post by Ken Bass
In a previous life, I was a sw designer/architect/company. So from
that experience, might I suggest that for those older versions of the
documentation, putting (noticeable) text somewhere stating that that
isn't the "current" version, and perhaps with a link to the current
version. That would have saved me many days of hitting that brick
wall. But then, this is only a suggestion. You guys are the experts,
and obviously good ones at that :-). Thanks for great (open src) software.
You'll find that its common in open source projects for past versions of
the documentation to be browse-able from the web, and you'll also find
that open source projects tend to assume much of the user's knowledge
level. For that I wish you luck.
Post by Ken Bass
And thx, Joshua, for your response.
You're welcome!

Carl Eugen Hoyos
2014-04-13 14:51:36 UTC
Permalink
Post by Ken Bass
The example I am working with now is the "libavcdec/api-example"
on your site at /doxygen/0.6/api-example_8c-source.html.
This is not just outdated but antique.
Please find current examples in the
directory doc/examples/ in your git checkout.
Post by Ken Bass
(BTW: the one "issue" that REALLY hurt was that the
libraries are all "C" only. It was a simple solution
for me to enclose the library headers with extern "C",
but it would have been nice if someone had mentioned
it somewhere obvious ).
You mean mentioning it somewhere else than in the FAQ
(4.9 and 4.10)?

Carl Eugen
wm4
2014-04-13 15:04:08 UTC
Permalink
On Sat, 12 Apr 2014 19:41:59 -0700
Post by Ken Bass
The example I am working with now is the "libavcdec/api-example" on your
Yep, like others pointed out, this is ancient. Almost completely
different API if you look at the details.
Post by Ken Bass
(BTW: the one "issue" that REALLY hurt was that the libraries are all "C"
only. It was a simple solution for me to enclose the library headers with
extern "C", but it would have been nice if someone had mentioned it
somewhere obvious :-( ).
This probably can't be fixed anymore, because I don't think these
"extern" blocks can be nested. So if extern blocks would be added to
the ffmpeg public headers, every single downstream C++ program would
break.
Loading...