Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-21T12:19:57.857Z
Answers.Text: 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!
Answers.UserDisplayName: Wouter Pol
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-21T12:23:29.210Z
Answers.Text: 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.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-21T20:44:37.413Z
Answers.Text: @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.
Answers.UserDisplayName: Jim Mack
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-24T12:27:36.857Z
Answers.Text: Yes, that would be a great fallback technique, thank you!
Answers.UserDisplayName: Wouter Pol
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-21T12:07:19.017Z
Answers.LastActivityDate: 2016-10-21T12:07:19.017Z
Answers.UserDisplayName: Jim Mack
Body: <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>
  
Tags: <ffmpeg><audio>
Title: FFmpeg - Synchronize external audio file
UserDisplayName: Wouter Pol
ThreadText: # 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**: @username_0  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!  
  
  ---
  
  