[Libav-user] Mix audio with video sample API calls

Josef Vosyka pepavo at gmail.com
Tue Jul 12 14:12:45 CEST 2016

I'm successfully using libavcodec.a in my project for video encoding.
Now I need to add audio track to existing video.
It works great from command line using this:

     ffmpeg -i raw_sequence.mp4 -i voices_1.cif -c copy -map 0:v:0
-map 1:a:0 -shortest out.mp4

I can not find how to achieve this same thing by making API calls.
I even tried as desperate option to compile ffmpeg program, rename
main() and call it internally.
This is however failing due to a lot of dependencies.

1. could you help me with a hit how to make the API calls?

2. is the ffmpeg inclusion really stupid or would you give me a hit
for this too? It is quite elegant if you consider that there are a lot
of other use-cases when you need to understand the API calls and this
way you "only" need to understand the command line options.

More information about the Libav-user mailing list