OOONA PARSER

Background

Ooona Parser is a helper application that allows you to manipulate your source video files to make them ready for use inside Ooona’s Online Toolkit.
It can transcode a source video and create a low-resolution, streaming-ready .mp4 file (down-conversion);
extract metadata, audio waveform, and detect shot-changes in the video;
eventually it can package the video into MPEG-DASH container (with an optional encryption of the content to keep it safe from possible theft).

Installation

The parser has no GUI installation. It's supplied as a portable program.
Please contact our support to receive a link to download the latest version of the Parser.
Unpack the downloaded archive to your desired location (for example to D:\OoonaParser).

Commands

-encode

Down-convert a source video to .mp4 proxy (*) + adjust for fast streaming

-encode

Down-convert a source video to .mp4 proxy (*) + adjust for fast streaming

-encode watermark

Same as above, plus it will burn a static watermark into the proxy. The image is taken from watermark.png located in the Parser root folder.
(you can replace the default image with your own)

-encode startTC=00:00:00:00+dropmode=ndf

Sending startTC and dropmode (optional) to -encode is relevant when setting encoding.timecode.enabled to true under appsettings.json.
This will set the parameters to burnt-in timecode.

-encode watermark+startTC=01:00:00:00+dropmode=ndf

Combine watermark with burnt-in timecodes parameters. -encode parameters code right after encode with a “-” and joined by a “+” symbol.

-dat

Extract video metadata, audio waveform and shot-change timecodes to a sidecar .dat file

-dash

Package the file into MPEG DASH container (a directory with .mpd xml description and video/audio segments)

-drm

Same as “-dash” but with encryption – use either -dash or -drm, but don’t use both together).
Will package the file into MPEG DASH container, encrypted and protected with DRM via OOONA’s proxy server
(it will only be playable using the exact same Toolkit server used to encrypt it).

-s3

Upload the result to an S3 bucket according to the “s3” configuration in the appsettings.json file.

-email

Send an email to a dedicated target address (requires SMTP server settings in the “email” configuration in the appsettings.json file)

-delete

Delete the created files (should only be used after -s3 if you don’t want to keep the parser results).

-deleteSource

Delete the input file after the parser is done.

-remux

Re-wraps video for frame-accurate playback in HTML players (the source should be .mov or .mp4 with h.264 video and aac audio)

-audio

Adding -audio will extract the audio track into a separate file. You can change the target extension and codec under the “extractAudio” settings in appsettings.json. This is a must if you want to be able to run ASR on mpeg-dash with DRM stream because ASR engines won’t be able to decrypt the video and the source might be gone. It’s a general recommendation to use the audio track separately for ASR engines to lower the exposure of your content the 3rd party engines.

Command Line

The command line tool can help you create custom scripts for parsing your video files. Use the Parser as part of an existing video processing pipeline (a custom one or in a 3rd part application).
To run it, open command line and open the containing directory (for this sample we’re assuming “D:\OoonaParser”):

D:
cd D:\OoonaParser

To down-convert the source video and package a DASH stream without DRM encryption (you don’t have to have an “.mp4” as source but any ffmpeg supported video):
OoonaParser.exe -encode -dat -dash FULL_FILE_PATH_HERE.mp4

To achieve the same with DRM encryption (requires the appsettings.json and internet access):
OoonaParser.exe -encode -dat -drm FULL_FILE_PATH_HERE.mp4

If you already down-converted the video or have an MP4proxy (*), you don’t need -encode
OoonaParser.exe -dat -drm FULL_FILE_PATH_HERE.mp4

If you already down-converted the video or have an MP4proxy (*), and only need to create a sidecar file with audio waveform and shot-changes
OoonaParser.exe -dat FULL_FILE_PATH_HERE.mp4

To package with DRM, upload the results to S3, send an email when done and delete the files:

OoonaParser.exe -encode -dat -drm -s3 -email -delete FULL_FILE_PATH_HERE.mp4

Watch Folder

(OPTIONAL) If you define the “watch” section in your configuration file (appsettings.json) and run the Parser with no arguments – it will search for files it didn’t parse yet in the input directory and run the command defined in the configuration file against this file and output the result to the output directory.

Configuration

(OPTIONAL) At the root directory of the Ooona Parser (where the OoonaParser.exe file is) you can see the appsettings.json file – this file contains the DRM API secret key needed to encrypt your MPEG-DASH streams (supplied by a Toolkit super user – contact us if you don’t have a key) and the watch folder related settings.

 A sample file looks like this:

{ "drm": { "host": "https://clientname.ooonatools.tv", "apiKey": "XXXXXXXXXXXXXXXXYYYYYYYYYYYYYYYYYY" }, "watch": { "input": "C:\\input", "output": "C:\\output", "arguments": "-encode watermark+startTC=00:00:00:00+dropmode=ndf -dat -audio -drm -s3" }, "s3": { "accessKeyId": "YYYYYYYYYYYYYYY", "secretAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", "bucketName": "BUCKET_NAME", "region": "us-east-1", "targetPrefix": "drm/{year}{MMM}/", "maxSimultaneous": 8, "signedUrlExpirationsDays": 7 }, "encoding": { "useOpus": false, "remuxWithMp4Box": false, "dontEncode": { "extensions": "mp4,mov", "videoCodecs": "h264,avc", "audioCodecs": "aac,opus", "maxBitrate": 1000, "maxVideoHeight": 720 }, "timecode": { "enabled": true, "frames": true, "media": true, "smpte": true } }, "extractAudio": { "extension": "aac", "command": "-c:a aac" }, "email": { "SMTPServer": "smtp.gmail.com", "SMTPPort": 465, "SMTPUsername": "XXXXXXX@gmail.com", "SMTPPassword": "XXXXXXXXXXX", "from": "no-reply@ooonatools.tv", "ssl": false, "subject": "A new asset is ready for streaming: {name}", "body": "Here are the links:\r\n<br/><br/>\r\n<strong>Video: </strong> {mpd}\r\n<br/><strong>DAT: </strong> {dat}" }, "dat": { "excludeShotchanges": false }, "manifest": "https://ooona-public.s3.amazonaws.com/parser/parser.json", "log": "%target%\\%filename%.log", "extensions": "avi,h264,webm,mov,mp4,m4a,mp3,aac,mpeg,ogg,wav,mpg,wmv,mkv,mxf", "placeOutputNextToOriginalFile": false, "scanSubFolders": true, "threads": 32 }

Here you can see that under "drm" you should define your own Toolkit URL for "host" and the secret API key for "apiKey".

Under "watch" you define which input folder to scan for files when opening the parser (it saves the list of parsed files in the “parsed-files.json” file which you can delete if you want to re-parse all files in the input directory).

Make sure that any path you supply to "input" and "output" won’t contains a single back-slash (“\”) character – it should be replaced with a double back-slash (“\\”) sequence instead.

The "arguments" value has the same behavior as the command lines arguments has – every new file in the input directory will be parsed with those arguments and the result will end up in the output directory.

Under “encode” you can define the encoding parameters, including at which quality to skip encoding and if and how to add burnt-in timecode on the video.

Under “extractAudio” you can set the relevant extension and codec for the “-audio” to generate an audio file.

Under “s3” you can set the AWS credentials and target path to be used when using the “-s3” argument to upload the results to a bucket. You can use any of the following arguments in the "targetPrefix": year (2020), month (08), yy (20), MMM (Aug), MMMM (August), dd (03).

Under “email” are the SMTP settings, target email address and email subject / body templates.

For “log” you can either specify a single path for a log file to be overridden on every job or use the “%target%\\” prefix to write the log to the same directory as the result of the parser. If you simply specify the value “lastrun.log” the file will be saved in the OoonaParser directory and overridden on every job.


 (*) MP4 proxy spec

Video: AVC Baseline@L3, 360p, 500kbps, source FPS
Audio: AAC, 64 kbps, stereo, 48 kHz