Skip to content

Instantly share code, notes, and snippets.

@Dulani
Created September 25, 2020 14:47
Show Gist options
  • Save Dulani/bf3028432f897beb82f369b99f25f0f3 to your computer and use it in GitHub Desktop.
Save Dulani/bf3028432f897beb82f369b99f25f0f3 to your computer and use it in GitHub Desktop.

Convert audio file to video file for uploading to MS Stream, YouTube, etc.

Source:

Install ffmpeg (on a Mac):

brew install ffmpeg --with-libvorbis --with-sdl2 --with-theora

Use ffmpeg for the conversion:

ffmpeg -i audio_input_file.m4a -c:a copy video_output_file.mp4

This works very quickly because it just wraps the audio file in a video container. Would like to eventually include a relatively simple image on every frame of the video.

@Dulani
Copy link
Author

Dulani commented Oct 7, 2020

Later, I had a need to do the reverse process for some files.

Use ffmpeg -i input_file.mp4 to get information on the embedded audio format.

In this case it was AAC. So, then I used: ffmpeg -i video_input_file.mp4 -vn -acodec copy copy audio_output_file.m4a
to demux it (source).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment