Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogithesymbian/224e6936037bacd6d1101c78b59b8da3 to your computer and use it in GitHub Desktop.
Save yogithesymbian/224e6936037bacd6d1101c78b59b8da3 to your computer and use it in GitHub Desktop.
using ffmpeg command on bashscript to short a command for compression video .mov to .mp4
1. create file custom
```
touch ~/.custom_bash_commands.sh
```
2. Open this up in your preferred text editor, and add the following code:
```
#!/bin/bash
# greet the user
function yoVideo() {
ffmpeg -i $1.mov -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k -movflags +faststart $1.mp4
}
```
3. Once you have saved that file, we need to test if it works. To make this command available, enter the following:
```
$ source ~/.custom_bash_commands.sh
```
4. done , try it by `yoVideo videoName`
@yogithesymbian
Copy link
Author

  1. create file custom
touch ~/.custom_bash_commands.sh
  1. Open this up in your preferred text editor, and add the following code:
#!/bin/bash

# greet the user
function yoVideo() {
  ffmpeg -i $1.mov -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k -movflags +faststart $1.mp4
}
  1. Once you have saved that file, we need to test if it works. To make this command available, enter the following:
$ source ~/.custom_bash_commands.sh
  1. done , try it by yoVideo videoName

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