unix4artists/README.md

222 lines
6.6 KiB
Markdown
Raw Normal View History

2021-05-08 16:53:26 +00:00
---
header-includes:
- \hypersetup{colorlinks=true,
allbordercolors={0 0 1},
pdfborderstyle={/S/U/W 1}}
---
# UNIX FOR ARTISTS
### Fun with FFMPEG
## Requirements
The following applications and runtime environments are needed to run the scripts used in the workshop.
Installation instructions are available below, broken down by operating system.
* [Bash](https://www.gnu.org/software/bash/) - *You probably have it already!*
* [FFMPEG](https://www.ffmpeg.org/)
* [ImageMagick](https://imagemagick.org/index.php)
* [Youtube-dl](https://ytdl-org.github.io/youtube-dl/index.html)
* [Golang](https://golang.org/)
* \*[Python3](https://www.python.org/downloads/) (*optional*)
* \*[Node.js](https://nodejs.org/en/) (*optional*)
It's very helpful to have a text editor that you can comfortably read and edit scripts in.
This selection of text editors ranges from free and open source to "free to use" and "free to try".
You can also use TextEdit or Notepad or any text editing application you prefer as long as it's capable of editing in plaintext.
* [Atom](https://atom.io/) - Free. *macOS, Windows and Linux.*
* [GNU Emacs](https://www.gnu.org/software/emacs/download.html) - Free. *Linux, macOS and Windows.*
* [Visual Studio Code](https://code.visualstudio.com/download) - Free. *macOS, Windows and Linux.*
* [Sublime Text 3](https://www.sublimetext.com/3) - Free to evaluate. *macOS, Windows and Linux.*
* [Notepad++](https://notepad-plus-plus.org/downloads/) - Free to use. *Windows only.*
* [BBEdit](http://www.barebones.com/products/bbedit/download.html) - Freemium. *macOS only.*
-------
## macOS
![The macOS Terminal](img/mac_terminal.png "The macOS Terminal")
Open the Terminal app located in your Applications folder.
Bash 3.2 is available by default on macOS.
##### Install Homebrew
Go to [https://brew.sh](https://brew.sh) and run the command under the "Install Homebrew" heading after pasting it into your Terminal.
You will be asked to confirm a few things while Homebrew installs.
Once the installation process is complete you can install the applications we will be using in this workshop by running the following commands:
```bash
brew install ffmpeg imagemagick youtube-dl
```
Optionally, you can install Node.js for a single example that we will be covering in the workshop.
```bash
brew install node
```
Make sure that you have a compatible version of Python installed by running the following command:
```bash
python3 --version
```
It should print out a value similar to `Python 3.8.2`.
Anything higher than 3.7.0 will work.
##### Install Golang on macOS
Go to the [Golang download site](https://golang.org/doc/install).
Select the "Mac" tab under "2. Go install." if not already selected and download the .pkg installer using the "Download Go for Mac" button.
Open the installer and follow the instructions.
Confirm that Go is installed by running the following command in Terminal:
```bash
go version
```
If Golang has been installed correctly you can now install `primitive`.
```bash
go get -u github.com/fogleman/primitive
```
-------
## Windows 10
Windows has its own command-line interpreter, but in order to keep code and examples consistent across different operating systems you will need to install the Windows Subsystem for Linux (WSL).
##### Enable WSL
Open the "Turn Windows Features on or off" dialog by searching in your command bar.
![Turn Windows features on or off](img/windows_10_turn_windows_features.png "Turn Windows features on or off")
Enable "Virtual Machine Platform" and "Windows Subsystem for Linux" by selecting the checkboxes next to the items and hit "OK".
![Enable WSL and Virtual Machine Platform](img/windows_10_enable.png "Enable WSL and Virtual Machine Platform")
Restart your computer for changes to apply.
##### Install Ubuntu 20.04 LTS
Open the Microsoft Store and search for "Ubuntu".
For the latest LTS version, install `Ubuntu 20.04`.
![Install Ubuntu 20.04](img/windows_10_install.png "Install Ubuntu 20.04 through the Microsoft Store")
Other versions of Ubuntu or openSUSE may work, but will be subject to differences in behavior.
![Select the Ubuntu shell](img/windows_10_ubuntu.png "Select the Ubuntu shell")
Once you've installed Ubuntu, you can open the shell and begin running commands using Bash.
##### Install Requirements on Windows 10
![The Ubuntu shell on Windows 10](img/windows_10_terminal.png "The Ubuntu shell on Windows 10")
You can now run the following commands to install the applications for this workshop:
```bash
sudo apt update
sudo apt install -y ffmpeg imagemagick youtube-dl
```
Optionally install Node.js.
```bash
sudo apt install -y nodejs npm
```
##### Install Golang on Windows 10
Go to the [Golang download site](https://golang.org/doc/install).
Select the "Windows" tab under "2. Go install." if not already selected and download the .msi installer by using the "Download Go for Windows" button.
Confirm that Go is installed by running the following command in your shell:
```bash
go version
```
If Golang has been installed correctly you can now install `primitive`.
```bash
go get -u github.com/fogleman/primitive
```
-------
Additional tutorials for installing Bash on Windows 10.
* [How to Install Linux Bash Shell on Windows 10](https://itsfoss.com/install-bash-on-windows/)
* [Install Bash on Windows 10](https://bayton.org/docs/linux/ubuntu/install-bash-on-windows-10-build-14316/)
-------
## Linux
Open up your preferred terminal application and install the required applications on a Debian-based system.
```bash
sudo apt install -y ffmpeg imagemagick youtube-dl
```
Or, if your distribution uses the `yum` package manager.
```bash
yum install ffmpeg imagemagick youtube-dl
```
Optionally install Node.js.
```bash
sudo apt install -y nodejs npm
```
Or using yum.
```
yum install nodejs
```
##### Install Golang on Linux
Go to the [Golang download site](https://golang.org/doc/install).
Select the "Linux" tab under "2. Go install." if not already selected and download the .tar.gz archive using the "Download Go for Linux" button.
Navigate to the folder you downloaded the archive into.
For the following commands, `go1.16.3.linux-amd64.tar.gz` can be replaced by the filename of the version that you just downloaded.
```bash
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
```
Either restart your terminal or run the command `source $HOME/.profile` to apply the changes just made to your system.
Confirm that Go is installed by running the following command:
```bash
go version
```
If Golang has been correctly installed you can now install `primitive`.
```bash
go get -u github.com/fogleman/primitive
```