Media tool kit is a language-agnostic scripting platform for making software based art.
It's based around a shell script called
controller.sh. In it you can invoke a variety of task-specific scripts that can help you build neat things.
The control script is simply a standardized way of running terminal commands with the main goal of making things a bit more readable.
Let's take a look at a sample control script. You can follow along by opening up the
example-controller.sh file included in the root directory.
In this example, the controller will:
# Blend Video # ////////////////////////////// print "blending video..." python random-video-blend.py \ --audio-input-dir="media/audio" \ --vid-input-dir="media/video" \ --vid-duration="(30,60)" \ --opacity=".4" \ --blend-mode-1="name-of-blend-mode" \ --blend-mode-2="name-of-blend-mode" \ --output-dir="/output" &&
You'll notice that the as the
random-video-blend script is called, the command-line arguments are listed out and fed corresponding variables.
The output above is piped into a folder in the home directory called simply
# Upload to Youtube # ////////////////////////////// print "uploading to youtube" python youtube-upload \ --video-input "$LATEST-OUTPUT" \ --title="A cool vid" \ --description="a description of a cool vid" \ --category=Misc \ --tags="mutter, beethoven" \ --client-secrets=my_client_secrets.json \ --credentials-file=my_credentials.json \ --playlist "My favorite music" \
We'll then use the output of the previous script and call it into the
upload-to-youtube script by using a built in variable
This variable will simply look at the
/output folder and print out the latest file in that folder.
And that's it! It's essentially a more standardized way of manually triggering scripts in the command line.
Each plug-in has it's own set of documentation so that command-line arguments and syntax can be made clear!
Note that some of these scripts are modified versions of open-source and publically availiable software. When applicable the original authors are credited.
Further documentation use can be found in their respective readme's.
random-audio-blend- Blends audio files together
random-video-blend- Blends three different videos together
centered-object-video- Places an image or video in the middle of a video file
video-segment-splitter- Splits a video into multiple parts
datamosh-video- Destroys avi videos
video-frame-splitter- Splices frames from a video into images
line-reader- Prints a line from a specified text file
random-youtube-cc- Prints a closed caption from a random youtube video
random-facebook-status- Prints a random, public facebook status
These are scripts that are designed to upload content to a variety of different sources. They can be found in the
The current web apps that we included scripts in MTK for are:
When adding a new script to the plugins section, make sure to follow the following rough guidelines
Scripts should ideally be treated as CLI's. This will make it easier for all variables to be managed directly within the main control script.
Arguments should be verbose and variables should be contained within double quotes.
plugin.py --argument1="variable" --argument2="variable"
Each plugin should contain some documentation as to how it works. I would also add an example of the script being used in the controller like the example below.
python random-facebook-status.py \ --print-to-file="yes" \ --whitelist="whitelist.txt" --character-limit="(5, 60)" --output-dir="media/text"