This is a Python implementation of processing/editing video and audio with FFmpeg libraries.
Many thanks to FFmpeg and its contributors. For more related information, please visit FFmpeg website.
-
Extracting the audio from a video.
-
Adding the audio to a video that contains no audio.
-
Removing the audio from a video.
-
Converting the format of audio.
-
Cutting video or audio into clips.
-
Merging video or audio clips.
- ffmpeg 4.1.1 (for Linux)
- ffmpeg 4.1.3 (for Mac)
- Installation
$ sudo apt-get install ffmpeg- Upgrade (if applicable)
# The latest version of FFmpeg is 4.1.x (11th April 2019).
$ sudo add-apt-repository ppa:jonathonf/ffmpeg-4
$ sudo apt update && sudo apt upgrade- Installation
# Install homebrew.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install FFmpeg via homebrew.
$ brew install ffmpeg- Upgrade (if applicable)
# Upgrade FFmpeg via homebrew.
$ brew update && brew upgrade ffmpegSpecify the path/name of input and output media in the code (see comments).
Please use the code provided in VideoAudio_Processing/.
-
To extract the audio from a video, run
run_VAP_extract.py. -
To add the audio to a video, run
run_VAP_add.py. -
To remove the audio from a video, run
run_VAP_remove.py. -
To convert the format of audio, run
run_VAP_convert.py.
Please use the code provided in VideoAudio_Editing/.
-
To cut video or audio into clips, run
run_VAE_Video_01Clip.pyorrun_VAE_Audio_01Clip.py. -
To merge video or audio clips, run
run_VAE_Video_02Merge.pyorrun_VAE_Audio_02Merge.py.
Please report an issue if you have any question about this repository, I will respond ASAP.
Please star this repository if you found its content useful. Thank you very much. ^_^