Awesome
Video and Audio Processing/Editing
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.
Table of Contents
Functions
-
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.
Dependencies
- ffmpeg 4.1.1 (for Linux)
- ffmpeg 4.1.3 (for Mac)
Install FFmpeg for Linux
- 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
Install FFmpeg for Mac
- 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 ffmpeg
Usage
Specify the path/name of input and output media in the code (see comments).
Video and Audio Processing
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
.
Video and Audio Editing
Please use the code provided in VideoAudio_Editing/
.
-
To cut video or audio into clips, run
run_VAE_Video_01Clip.py
orrun_VAE_Audio_01Clip.py
. -
To merge video or audio clips, run
run_VAE_Video_02Merge.py
orrun_VAE_Audio_02Merge.py
.
<i>Please report an issue if you have any question about this repository, I will respond ASAP.</i>
<i>Please star this repository if you found its content useful. Thank you very much. ^_^</i>