Table of contents
It creates a compressed copy of a large .mov
file in the .mp4
format using ffmpeg
.
This is a simple function. It isn't very tolerant to fault.
You need to download and install [ffmpeg
].
- Download and Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install ffmpeg
brew install ffmpeg
-
Follow the Prerequisite instructions.
-
Clone this repository.
git clone https://github.com/csantarin/ffmpeg_mp4_to_mov.git
-
Navigate to the repostitory folder.
cd <path/to/the/parent/of/your/local/copy>/ffmpeg_mov_to_mp4
-
Expose the
ffmpeg_mov_to_mp4
function to command line.source ./ffmpeg_mov_to_mp4.sh
-
Follow the Linking instructions to add this command to your command line permanently.
Call the newly-installed ffmpeg_mov_to_mp4
command.
# Call the function and provide an input file name
# - Include the trailing .mov extension.
# - Include a path (relative or absolute) if necessary.
ffmpeg_mov_to_mp4 <path/to/your/file>.mov
Example:
$ ffmpeg_mov_to_mp4 ../my-project/my-project-recording.mov
Processing ../my-project/my-project-recording.mov ...
# Some processing from the ffmpeg converter...
Done!
../my-project/my-project-recording.mp4
In case you don't want to constantly source
the same same command over and over, you can link the script.
You should locate where your shell environment is.
Assumptions in the subsequent parts:
- Shell environment file:
.zshrc
- Location: user home directory (
~
. In the following, it represents the/Users/csantarin
folder).
There's a link.sh
file that can do this for you.
sh ./link.sh ~/zshrc
Result:
Retrieving this repository's working directory ...
/Users/csantarin/ffmpeg_mov_to_mp4
Adding to /Users/csantarin/.zshrc ...
Done!
Copy this to your shell environment file.
source ~/ffmpeg_mov_to_mp4/ffmpeg_mov_to_mp4.sh
source
the changes immediately or launch a new command line session:
source ~/.zshrc