<p>One way to achieve this might be to create an .MP4 with your audio and an all-black image, which should encode to something not much larger than the audio file but still have the same internal structure as the full video files.</p>

CC BY-SA 3.0
2016-10-21T12:19:57.857Z
I could use that, and it wil probably work. However, the file wouldn't be technically audio only then. I don't see any other way though. Thank you for your suggestion!
Wouter Pol
CC BY-SA 3.0
2016-10-21T12:23:29.210Z
Extracting the audio from one of the encoded files should get you audio only. Remember to add `-copyts` to the extraction command and extract to .mp4.
Gyan
CC BY-SA 3.0
2016-10-21T20:44:37.413Z
@WouterPol  Another possible advantage to this is that you could use a static image such as text over black saying "Low Bandwidth - Audio Only". This would take a little more space, but not much.
Jim Mack
CC BY-SA 3.0
2016-10-24T12:27:36.857Z
Yes, that would be a great fallback technique, thank you!
Wouter Pol
CC BY-SA 3.0
2016-10-21T12:07:19.017Z
2016-10-21T12:07:19.017Z
Jim Mack
<p>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.</p>
<p>The problem is alignment of said audio stream. I've aligned the videostream with</p>
<pre><code>-x264opts keyint=48:min-keyint=48:no-scenecut 
</code></pre>
<p>This creates equal intervals in keyframes, allowing consistent GOP's for streaming. But such an option is not available for audio only.</p>
<p>I extracted the audio from the original file, like this:</p>
<pre><code>ffmpeg -i Sample.avi -vn -ar 44100 -ac 2 -ab 128k -f mp3 audio_only.mp3
</code></pre>
<p>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).</p>
<p>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?</p>

<ffmpeg><audio>
FFmpeg - Synchronize external audio file
Wouter Pol
# FFmpeg - Synchronize external audio file

(Asked by: username_0 on 2016-10-21)

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?

**Tags:** ffmpeg, audio


---

## 1 answers

### Answer by username_1 on 2016-10-21. Score: 0 | Accepted answer

One way to achieve this might be to create an .MP4 with your audio and an all-black image, which should encode to something not much larger than the audio file but still have the same internal structure as the full video files.

> **Comments:**
> **username_0**: I could use that, and it wil probably work. However, the file wouldn't be technically audio only then. I don't see any other way though. Thank you for your suggestion!  
> **username_2**: Extracting the audio from one of the encoded files should get you audio only. Remember to add `-copyts` to the extraction command and extract to .mp4.  
> **username_1**: @WouterPol  Another possible advantage to this is that you could use a static image such as text over black saying "Low Bandwidth - Audio Only". This would take a little more space, but not much.  
> **username_0**: Yes, that would be a great fallback technique, thank you!  

---

