Make sure you have brew installed on your mac first! Go to http://brew.sh and follow the instructions there to install brew on your mac.
-
Install sox by running
brew install soxon your terminal -
Install ffmpeg by running
brew install ffmpegon your terminal
Without these 2, you will not be able to run some of the scripts in this repository. In particular, multinorm.sh
- We use this script to normalize the audio of multiple video files.
- It creates a new folder called
normalizedand puts the rendered file in there. - Attribution: This script was based on Sayanee Basu's
normscript.
$ ./multinorm.sh ./<folder_name>*Important: Please replace spaces with underscore in your folder name and file names.(eg. my_videos instead of my videos and video_file.mov instead of video file.mov).
- When you started the recording too early, this script helps you remove the first few seconds of the video.
- This will generate a new file.
$ ./cutfront.sh <path_to_input_file> <time_stamp> <path_to_output_file>- When you ended the recording long after the presentation is done, this script helps you remove the last few seconds of the video.
- This will generate a new file.
$ ./cutback.sh <path_to_input_file> <time_stamp> <path_to_output_file>- Use this when you want to join multiple files into 1 video file
-
Run this command to create a text file with the list of all the files you want to combine:
ls -1 > files.txt -
Edit
files.txtand remove the lines of the files you don't want to use. -
Add
file ./to the front of each line such that it ends up like this:file ./video1.mp4 file ./video2.mp4 file ./video3.mp4 -
Run this command in the folder
ffmpeg -f concat -safe 0 -i files.txt -c copy <name_of_combined_file.mp4>This
ffmpegcommand will create a new combined file of all the videos infiles.txt.
- Generates a thumbnail of the video at the time stamp supplied (eg.
00:00:12) - Creates a
thumbnailfolder and generates ajpgandpngversion of the thumbnail.
$ ./genthumb.sh <video_file> <time_stamp>$ ./copyts.sh ./<folder_name>-
Build the Docker Image
docker build -t esg-tools . -
Run the Docker Container and mount your working folder into the container.
docker run -it --rm -v <path_to_working_folder>:/app/<folder_name> esg-tools
Example:
docker run -it --rm -v $PWD/videos:/app/videos esg-tools docker run -it --rm -v %CD%/videos:/app/videos esg-toolsTo refer to the currect directory, use
$PWDin Linux / Mac and use%CD%in Windows Command Prompt. -
You can now run the scripts in Docker container.
Example:
./cutfront.sh ./videos/presenter1.mp4 00:05:12 ./videos/presenter1-trimmed.mp4
Remember to output the file to the mounted folder to see it in your host machine.
Use yt-dlp to download video from YouTube URL.
yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" [URL]