# Commanding the Edit Suite
# External Resources
- [Free Code Camp](https://www.freecodecamp.org/news/command-line-for-beginners/)
- [ffmprovisr](https://amiaopensource.github.io/ffmprovisr/)
- Tips, tricks, and examples for using `ffmpeg`
- [TL:DR;](https://tldr.inbrowser.app/)
- Documentation is hard to read, this is more user-friendly ways to learn how commands work!
- Youtube channels
- [\*NIX Tricks](https://www.youtube.com/@nixtricks)
- Great short videos on specific Terminal Commands
- [FireshipIO](https://www.youtube.com/watch?v=26Mayv5JPz0)
- Quick fast videos on programming topics.
- [FFMPEG Useful Techniques](https://fireship.io/lessons/ffmpeg-useful-techniques/)
- [MacOS Defaults](https://macos-defaults.com/finder/)
- Shows commands for setting settings via Terminal on macOS
# Moving Files
Get every file ending in `.mov` in each folder, and move them into the current folder.
```zsh
mv -i **/*.mov ./
```
# `ffmpeg`
More examples on [ffmprovisr](https://amiaopensource.github.io/ffmprovisr/)
More detailed explanations on the way!
## Quickly add a mixed file to a video
Smash a video file, and an audio file into one, without needing to re-encode. Can be used to quickly add a final mix to a video.
```zsh
ffmpeg -i Spring-SFXOnly.mp4 -i Spring-FullMix.aac -map 0:v -map 1:a -c copy Spring-FullMix.mp4
```
## Extract Audio from Video
Can sometimes be used to save audio from a corrupt video, or just to extract audio when needed.
Advanced versions of this can even add full 7.1 Surround Sound audio into a video.
```zsh
ffmpeg -i pretend_this_is_corrupt.mxf -vn -c copy saved_audio.wav
```
# Defaults and Preferences
Lots of preferences can be brought along with you and can make your life easier if hopping between machines for freelance or school work!
```zsh
# Setup Your Dock
defaults delete com.apple.dock persistent-apps # Empties Dock
defaults write com.apple.dock autohide 1
killall Dock # Restarts the Dock
# Setup Finder Defaults
defaults write com.apple.finder "FXPreferredViewStyle" -string "Nlsv" # List View
defaults write com.apple.finder "ShowPathbar" -bool "true"
defaults write com.apple.dock "orientation" -string "left"
defaults write NSGlobalDomain "AppleShowAllExtensions" -bool "false"
defaults write com.apple.finder "ShowRemovableMediaOnDesktop"
defaults write com.apple.finder "ShowHardDrivesOnDesktop"
defaults write com.apple.finder "ShowExternalHardDrivesOnDesktop"
defaults write com.apple.finder "ShowMountedServersOnDesktop"
killall Finder # Restarts Finder
```
> [!INFO] What the heck is `killall`?
> `killall` is a way to quit a program in the Terminal. There's a lot of history for why it is that. And there's more graceful ways to quit apps. You can sort of think of it as the "Force Quit" of the terminal
# Finding Stock Footage
This `egrep` command is basically reading the EDL file, and then searching for things that match the given pattern.
The pattern is a format called regex. I recommend [regex101](https://regex101.com) or [regexr](https://regexr.com) for learning how that works!
```zsh
egrep -io "getty(images)?-[0-9]+" MediaComposer.edl | uniq
```
## Fancier Example
I'm using a different scripting language for this one, nushell, since it's a bit easier to combine lines. You can do the same thing in ZSH no issue! You can set shortcuts for this using macOS Shortcuts, or using aliases in your terminal.
```nushell
^open
quot;https://www.gettyimages.com/search/2/film?family=editorial&phrase=(open ~/cmd_the_edit/sequence/stock/AvidSequenceReport.txt | egrep -io 'getty(images)?-[0-9]+' | cut -d'-' -f2 | lines | uniq | str join ',')"
```
## Live Presentation Media Sources
Footage and assets from the `Blender Foundation | studio.blender.org` (CCBY4.0):
- Spring
- Big Buck Bunny
- Cosmo's Laundromat