mediamicroservices / mm

MIT License
68 stars 27 forks source link

mediamicroservices documentation

table of contents

  1. summary
  2. installing and configuring mediamicroservices
    1. installing homebrew
    2. installing mediamicroservices
    3. configuring mediamicroservices
      1. variable explanations
  3. Database Instructions
    1. Database Configuration
    2. Database Backup
  4. mediamicroservices functions and instructions for use

summary

mediamicroservices have been developed for the purpose of processing audiovisual collections at CUNY Television. This repository includes scripts to run ffmpeg to create access and service copies of audiovisual assets, as well as to analyze, report, and deliver media as individual files or as Archive Information Packages. Mediamicroservices are written in Bash, and developed and tested for a macOS environment.

Mediamicroservices are installed and run using the terminal application, so knowledge of the command line is necessary. For information on the command line, please see The Command Line Crash Course or the Code Academy Course.

Please use the issue tracker to report any issues with installation and usage of mediamicroservices.

Please subscribe to this repository to receive updates about new releases and enhanced functionalities.


License

This software and associated documentation is covered by the MIT license. Details available here.


installing and configuring mediamicroservices

installing homebrew

before installing mediamicroservices, install homebrew to your computer. here are directions for downloading homebrew. homebrew is a package manager that assists in managing all of the necessary components of mediamicroservices.

be sure to update/upgrade homebrew regularly.

to update the packages in homebrew, type: brew update into the command line. This command will tell you which packages need to be updated.

to upgrade the packages in homebrew, type: brew upgrade into the command line. This command will update all packages to their most recent version.

installing mediamicroservices and dependencies

once homebrew has been installed, you can install mediamicroservices. First, use the tap command. Then, you can install.

Type brew tap mediamicroservices/mm into the command line.

Then, type brew install mm into the command line. This command will install mediamicroservices to your computer.

hooray, you've installed mediamicroservices!

mediamicroservices is dependent on other open source software to run. If you do not have the following software when installing mediamicroservices, homebrew will install it for you.

mediamicroservice dependencies:

mediamicroservices also uses Pashua to run a graphical user interface. It is recommended to install Pashua before running media microservices. Type brew install Pashua into the command line and press enter. You will be prompted for your password. Enter your password, and then you will be able to run mediamicroservices scripts and options that utilize a GUI (Graphical User Interface).

If at any point you would like to uninstall mediamicroservices, type brew uninstall mm into the command line.

configuring mediamicroservices

In order for mediamicroservices to run, you must configure your variable settings. First, take a look at the list of variables below to get a sense of what each variable means. Then, create all of the delivery directories that you'll need, in the place you'd like them to be. You can name the directories themselves anything you'd like; the more important part is tying them to a variable in the configuration process. Not all variables are necessary for microservices to run, so look over which microservices you'd like to use to get a sense of whether or not you'll need to a specific variable.

Type mmconfig into the terminal to access the configuration GUI (or mmconfig -t for the CLI), which will take information input and save a file as mm.conf. This file will store your system variables.

Alt text

mmconfig only has to be run once to create the configuration file, variables will be stored and can be changed by re-running mmconfig.

if you prefer to edit in the terminal, simply run mmconfig and follow the directions on screen. this option allows for you to also choose to edit the config file in nano or TextMate.

variable explanations

1. edit config file in nano choose this option to edit the config file using nano

2. edit config file in TextMate choose this option to edit the config file using TextMate

3. OUTDIR_INGESTFILE set this variable to the processing directory. it is directory where your package will be created, and if you do not choose to deliver the package to AIP_STORAGE, this is where the completed package will remain.

4. OUTDIR_INGESTXDCAM set this variable to the processing directory for xdcam files that are processed using using the mediamicroservices xdcamingest.

5. OUTDIR_PAPER set this variable to the processing directory when using the paperingest script.

6. AIP_STORAGE set this variable to the directory where the archival information package is delivered.

7. PODCASTDELIVER set this variable to the directory where your podcast access copy is delivered.

8. YOUTUBEDELIVER set this variable to the directory where your youtube access copy is delivered.

9. TMPDIR set this variable to a temporary directory. it is used in the uploadomneon microservice as a temporary place for a file to live before it is uploaded to the omneon server.

10. REGEX4PODCAST this variable holds regular expressions that are queried when makepodcast is run, in order to determine if a file qualifies for podcast creation. If you want all of your files to qualify for podcast creation, enter a "." which matches (almost) any character. Learn more about regex.

11. DVDLABELPREFIX this variable is for adding a set prefix to the filename for DVDs in makedvd. You may leave this variable blank if you do not want to have a prefix uniformly assigned.

12. OMNEONIP this variable sets the IP address for delivery of files to the omneon server in uploadomneon and ingestfile. this variable can be set to the IP address of any server that you'd like to have the broadcast copy of your files delivered to.

13. OMNEONPATH this variable is the file path to the specific directory you'd like assets to be delivered to on the omneon server.

14. CUSTOM_LOG_DIR this variable is the directory that stores processing logs for all of the media microservices, and is used when the _log function is called. Consider creating a directory called mmlogs in your documents directory, and assigning it to this variable.

15. LTO_INDEX_DIR this variable is the directory that stores the .schema files created when LTOs are mounted and written to. If you are not using LTO in your workflow, you do not need to create this variable. If you do use LTO in your workflow, consider creating a directory called LTO Indexes, to be housed in your documents directory, and assigning it to this variable.

16. LOCAL_MM_DIR this variable is the directory that stores mediamicroservices scripts locally.

17. EMAIL_FROM this variable is the email address that notifications will be sent from once processes have been completed. You may leave this variable blank if you do not want any notification emails sent once actions have been performed on files.

18. MAKEYOUTUBE_DELIVERY_EMAIL_TO this variable is the email address (or addresses) that notifications will be sent to once makeyoutube has been run on a file.

19. MAKEBROADCAST_DELIVERY_EMAIL_TO this variable is the email address (or addresses) that notifications will be sent to once makebroadcast has been run on a file.

20. FILEMAKER_DB this variable stores the name of the FileMaker database that is used in checksum2filemaker to upload metadata from processed files to a FileMaker database. You may leave this variable blank if you do not use FileMaker.

21. VOLADJUST This variable must be set to yes (Y) or no (N). If set to yes, volume will be run through a volume adjustment filter and adjusted accordingly during transcoding.

22. PREMIS_DB This variable must be set to yes (Y) or no (N). If set to yes, database reporting for mm will be enabled.

23. SQL_ERROR_EMAIL_TO This can be set to include an email address to receive error reports for database insertion.

24. PREMIS_PROFILE Enter the login path information for the database here. (Use the output supplied by the createpremisdb script, or create your own using mysql_config_editor). PREMIS_NAME Enter the name of the database used for mm reporting. 26 PERCEPTUAL_HASH Set this to 1 (on) to enable the creation of perceptual hashes during the ingestfile process 27. Quit if editing in the terminal, use this option to leave the configuration file editor.


Database Instructions

Media Microservices can be integrated with a database for the capture of a variety of preservation metadata generated through the mm workflow. Currently the MM Database supports PREMIS event information, fixity information, perceptual hashes for video files, mediainfo output and ingest logs.

Database specific scripts

Database Configuration

To configure the database, run the command createpremisdb -c on your host computer and follow the prompts. This will set up the database as well as facilitate user creation. To create users without creating a new database, use the command createpremisdb -u. At the end of user creation, the script will supply a command to create a log-in profile for the database. It should look something like this: mysql_config_editor set --login-path=your_user_config --host=xx.xx.xxx.xxx --user=your_user --password. Run this command on your user computer and enter the password for the user you created when prompted. This will create the SQL log-in profile that you will use when configuring the microservices. NOTE: When supplying the suggested command, the script does its best to auto-fill the host IP address. You may wish to verify that this is the correct IP.

To finalize the database setup, run mmconfig (GUI mode) or mmconfig -t (CLI) and select 'Y' in the PREMIS Database logging section, (or set to Y if using CLI). Enter the database name and log-in profile you have created to finalize DB connectivity. Additional database options (such as fingerprint generation) can be set at this time.

Database GUI Example

Database Backup

MM includes a script for database backup. This can be either run manually or set up as an automated process. After configuring the backup script, running dbbackup will create a zipped backup in the chosen location. To automate this process use Brew Services. Typing brew services start mm will cause the db to be backed up automatically using the included plist file. By default, backups will occur daily at 2:00 AM.

To configure database backup use the command dbbackup -e. This will open the config file in a terminal editor. Set the necessary variables to your desired values.


mediamicroservices functions and instructions for use

For all microservices, the structure of the command looks like this: [microservice] -options [input] the microservice is the particular command you want to execute (for example, checksumpackage) options are any non-default choices that the script may contain the input is the package, directory, or file that you are working with

Across all mediamicroservices, you can always receive the usage information by typing the microservice and -h. Your command will look like this: [microservice] -h.

To view the specific ffmpeg encoding options for each file, view the sourcecode of the microservice directly on GitHub or using a text editor on your computer.

aipupgrade

audiotest

barcodeinterpret

blackatends

checksum2filemaker

checksumpackage

createmmdb

createpremisdb

dbbackup

finishpackage

fix_left2stereo

fix_rewrap

fix_timecode

fix_volume

ingestfile

makeaudiographs

makebroadcast

makederiv

makedvd

makefingerprint

makeflv

makeframemd5

makeframes

makegifsummery

makelossless

makemetadata

makemets

makemkvchapters

makemp3

makepdf

makepodcast

makeprores

makeresourcespace

makewaveform

makeyoutube

migratefiles

mmtest

paperingest

phasecheck

qatesting

quickcompare

removeDSStore

restructureForCompliance

rewrapmf

searchfingerprint

uploadomneon

verifypackage

verifytree

xdcamingest