I'm developing an c/c++ app that uses ffmpeg to play audio/video.Now i want to enhance the application to allow the users to extract audio from video and save it. I followed this https://ffmpeg.org/doxygen/trunk/muxing_8c-source.html for the saving part but now the problem is with avformat_alloc_output_context2(). I'm getting an error: "undefined reference to `avformat_alloc_output_context2' ". Does anyone know about the proper way to call 'avformat_alloc_output_context2' in ffmpeg version 2.6.3
how to call avformat_alloc_output_context2 in ffmpeg 2.6.3?
7.2k Views Asked by patrick At
2
There are 2 best solutions below
0

Also git grep avformat_alloc_output_context2
in the in-source examples under doc/examples
. A few matches:
- https://github.com/FFmpeg/FFmpeg/blob/n3.0/doc/examples/remuxing.c#L79
- https://github.com/FFmpeg/FFmpeg/blob/n3.0/doc/examples/muxing.c#L569
You can then see exactly how they are built with:
make V=1 examples
on the top-level. The build works on Ubuntu 15.10, so then you can compare it to your build and see what is wrong.
Remember to include
After that you can just call
For example: