<div dir="ltr"><button class="gmail-js-bookmark-btn gmail-s-btn gmail-s-btn__unset gmail-c-pointer gmail-py4 gmail-js-gps-track" aria-label="Bookmark" aria-describedby="--stacks-s-tooltip-x1yrzaxg">
            
        </button>
    

    
        <a class="gmail-js-post-issue gmail-flex--item gmail-s-btn gmail-s-btn__unset gmail-c-pointer gmail-py6 gmail-mx-auto" href="https://stackoverflow.com/posts/72180320/timeline" aria-label="Timeline" aria-describedby="--stacks-s-tooltip-5gp9i053"></a><div class="gmail-votecell gmail-post-layout--left"><div class="gmail-js-voting-container gmail-d-flex gmail-jc-center gmail-fd-column gmail-ai-stretch gmail-gs4 gmail-fc-black-200">

</div>

        </div>

        

<div class="gmail-postcell gmail-post-layout--right">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).
<div class="gmail-s-prose gmail-js-post-body"><p>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:
'<em><strong>Resource temporarily unavailable</strong></em>' (Of course, I tried several audio codec/fmt values to make it work with no luck).</p>
<p>The basic version of my experimental implementation is available <a href="https://github.com/xtingray/audio_mixer/blob/main/audio_mixer.c" rel="nofollow noreferrer">right here</a></p>
<p>I was checking the <a href="https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/transcode_aac.c" rel="nofollow noreferrer">AAC transcoding example</a> that comes with the FFMPEG source code, and it works perfectly giving the outcome exactly as I need it.</p>
<p>(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)</p>
<p>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!</p><p>Thanks!<br></p>
<p><strong>PS:</strong> I was thinking of using the <a href="https://libav.org/documentation/libavfilter.html#resample" rel="nofollow noreferrer">resample filter</a> to solve my problem, but the documentation says: "<em><strong>It is not meant to be used directly</strong></em>". So, I wonder: is there any clean easy way to implement it as part of my workflow? <br></p></div></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--<br>  Gustav Gonzalez<br>  <a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a><br><br></div></div></div></div>