I'm creating some encoding templates for multi-bitrate streaming, and I want to create a fallback that is audio-only. So when the bandwidth of a users connection falls below x, it drops video playback and switches to audio-only.
The problem is alignment of said audio stream. I've aligned the videostream with
-x264opts keyint=48:min-keyint=48:no-scenecut
This creates equal intervals in keyframes, allowing consistent GOP's for streaming. But such an option is not available for audio only.
I extracted the audio from the original file, like this:
ffmpeg -i Sample.avi -vn -ar 44100 -ac 2 -ab 128k -f mp3 audio_only.mp3
That creates a separate .MP3 file, equal to the audio-streams of the original file (.MP4). However, I have no way to ensure this is inline with the audio streams of the encoded .MP4's (the multi-bitrate set).
So, is there a way to make sure these files are aligned? Or should I extract the audio from one of the encoded files, instead of the mezzanine file?