Skip to content

Instantly share code, notes, and snippets.

@RealCyGuy
Created June 16, 2024 18:15
Show Gist options
  • Save RealCyGuy/908d9dea2cebf2359dc683c7e9df247d to your computer and use it in GitHub Desktop.
Save RealCyGuy/908d9dea2cebf2359dc683c7e9df247d to your computer and use it in GitHub Desktop.
merges m4a with mp4 file. made for use with radeon relive recordings
# merges m4a with mp4 file. made for use with radeon relive recordings
def main [video_name: path] {
let audio_name = $video_name | path parse | update extension m4a | path join
let video_name = $video_name | path parse | update extension mp4 | path join
let front = $video_name | path parse | update extension "" | path join
let output = $front + " merged.mp4" | path join
ffmpeg [-i $video_name -i $audio_name -c:v copy -filter_complex "[1:a] volume=2 [aud]; [0:a][aud] amix=inputs=2:duration=longest [audio_out]" -map 0:v -map "[audio_out]" $output]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment