[Libav-user] Libav API: Filtering + Transconding

Gustav González xtingray at gmail.com
Tue May 10 06:20:41 EEST 2022


 <https://stackoverflow.com/posts/72180320/timeline>
Hi, I need to process a list of several audio files (MP3 and WAV) and mix
them to generate an audio stream (AAC codec / fltp) to be included in an
mp4 file (using the Libav API).

Currently, I can mix the list of input files to generate a WAV file
successfully using filters, nevertheless, when I try to create the MP4
file, I always get this error message: '*Resource temporarily unavailable*'
(Of course, I tried several audio codec/fmt values to make it work with no
luck).

The basic version of my experimental implementation is available right here
<https://github.com/xtingray/audio_mixer/blob/main/audio_mixer.c>

I was checking the AAC transcoding example
<https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/transcode_aac.c>
that comes with the FFMPEG source code, and it works perfectly giving the
outcome exactly as I need it.

(The only problem I have with this example is that it doesn't include any
filtering process. I tried to extend it but I failed in an epic way...
besides, the workflow of the code looked pretty tangled)

So, this is my question: Can I try to achieve the same result as the
transcode_aac but using a filter? I would like to keep the mixing feature
already implemented using filters without having to make big changes in my
workflow to generate the audio stream for the MP4 file. Any ideas or
suggestions are pretty welcome!

Thanks!

*PS:* I was thinking of using the resample filter
<https://libav.org/documentation/libavfilter.html#resample> to solve my
problem, but the documentation says: "*It is not meant to be used directly*".
So, I wonder: is there any clean easy way to implement it as part of my
workflow?
--
  Gustav Gonzalez
  xtingray at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220509/4cd6f9af/attachment.htm>


More information about the Libav-user mailing list