Skip to content

Instantly share code, notes, and snippets.

@MilesDowe
Created November 26, 2021 04:05
Show Gist options
  • Save MilesDowe/dfc39e30457c91a60518aa8136280a59 to your computer and use it in GitHub Desktop.
Save MilesDowe/dfc39e30457c91a60518aa8136280a59 to your computer and use it in GitHub Desktop.
Just some notes on editing videos in Blender.

Multiple audio tracks in a video

Blender doesn't recognize multiple audio tracks and will only provide the first (as far as I can tell).

What I instead do is:

  1. Rip the other audio track(s) into a separate audio file using ffmpeg.
  2. In Blender, click "add" and then "sound".
  3. Select the freshly ripped audio track.

Below is an example of the ffmpeg command.

$name='vid_name'; ffmpeg -i "${name}.mp4" -vn -acodec copy -map 0:a:1 "${name}_aud.mp4"; mv "${name}_aud.mp4" "${name}_aud.mp3"

A couple of notes:

  1. This is done in PowerShell, since I'm usually editing on my Windows PC.
  2. The -vn flag means no video.
  3. The -acodec copy means use the same codec as the original video file.
  4. The -map 0:a:1 argument means rip the second audio track (a for audio, 1 for the second track because it's zero-based).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment