These scripts are used in conjunction with watchdog and ffmpeg to create an automated media encoding server.
-
Create a
credentials.conf
file with the WordPress and Network storage credentials (Please note the syntax - no spaces and your user and password wrapped in double quotes.):WP_USER="wordpress_user" WP_PASSWORD="wordpress_password"
-
Copy the
plist
file to/System/Library/LaunchDaemons
and give it the proper permissions: 644 / root:wheel. This allows the watch processes to be run automatically. -
From the terminal in the directory these scripts are located, run
encoding-server
, or reboot
The watch directories are hardcoded into the encoding-server
script. The basic structure
looks like this:
```
/FTP
/<campus_short_name>
```
Where <campus_short_name>
is RHO, RHMV, etc. Once received, they are stored in an Output and Source folder within the campus short name folder within the STOREPATH
directory, as defined in the encoding-server
script.
Below is an explaination of the watch/encode/upload process.
- The scripts start watching the FTP folders
- After the file is uploaded, the FTP server renames it, which triggers the watch
- The process scripts are then triggered and find the most recent file
- The file is then converted using ffmpeg into a streaming video file as well as an mp3.
- When the encoding process completes, the source moved
into the
Source
folder, and the converted files are moved into theOutput
folder. These folders are explained in the Directory Structure section. - Finally, the two output files are uploaded to WordPress
- Remove all hardcoded stuff, like paths to network drives
- Create a start/stop action:
encoding-server start