Welcome to Swank Motion Pictures! This guide will walk you through the structure and processing of our AES encrypted hard drives. The entire process is designed for automated ingestion into your system, providing you with licensed movie content, detailed metadata, and a rich set of promotional materials.
1. The Anatomy of a Swank Drive
When you receive and open a hard drive, you will find a simple root directory structure containing the following key components:
-
Manifest.json: This is the most important file on the drive. It is a machine-readable "map" that provides the exact location of every movie title, metadata file, and publicity asset. Your entire ingest process must start by parsing this file. -
Content/: This folder contains the encrypted video files and their associated media information. -
Publicity/: This folder contains all the promotional materials for the movie titles, such as poster art, trailers, and localized metadata.
The Golden Rule: The file and folder names within the Content and Publicity directories may change over time. The only reliable method for locating files is to parse the paths provided in the Manifest.json file. Do not build your ingest solution based on hard-coded directory paths.
2. Your Roadmap: The High-Level Ingest Process
For every hard drive you receive, the automated workflow should follow these steps:
-
Parse the
Manifest.jsonfile located in the root directory. -
The manifest contains a
ContentItemscollection, which is a list of all the titles on the drive.You will loop through each item in this collection to process one title at a time.
-
For each title, you will perform the following actions:
a. Decrypt the Content Key: Extract the unique, encrypted key for the specific movie title.
b. Decrypt the Content File: Use the decrypted key to decrypt the main video file (.MP4).
c. Ingest Metadata: Locate and parse the JSON files containing rich information like cast, crew, synopsis, genre, and technical video specifications.
d. Ingest Publicity Assets: Locate and copy all associated promotional files like posters and trailers.
3. Deep Dive: Step-by-Step Instructions
Here we will break down each step of the roadmap using the files from your sample drive.
Step 3a: Decrypting the Content Key
Each movie in the ContentItems list has a unique key used to encrypt it. You first need to decrypt this key.
-
Locate the Encrypted Key: In the manifest item for the title, find the
DRMKeyInfosection. The encrypted key is the Base64 string in theKeyfield.-
Example:
"Key": "0NREkX0I/DqUNlrFAY1J9SuBGOSndkt2H+op/wKehVqqf7Wb0SclYox4zrwPmTkhKWH1thK1wdJE+KPMnlgwiw=="
-
-
Decrypt with Your Customer Key: This value is encrypted using your unique Customer Encryption Key (provided to you by Swank during setup) with the following specifications:
- Algorithm: AES-256
- Mode: Cipher Block Chaining (CBC)
- Padding: PKCS7
-
Extract the Initialization Vector (IV): To perform the decryption, you need an IV. After you Base64-decode the
Keystring into a byte array, the first 16 bytes of the array are the IV. The rest of the byte array is the encrypted Content Key that you need to decrypt.
The result of this process is the decrypted Content Key. You will use this key in the next step.
Step 3b: Decrypting the Content File (The Movie)
Now you can decrypt the actual movie file.
-
Locate the Encrypted File: The manifest item points to the file's location.
-
The path to the folder is in
Asset.Location(e.g.,Content/2476857/1/1/). -
The filename is the
Identifiers.FilmNumber(e.g.,0049546) followed by the appropriate extension (e.g.,.MP4). - Example Path:
Content/2476857/1/1/0049546.MP4
-
-
Decrypt with the Content Key: Use the decrypted Content Key from the previous step to decrypt this file. The encryption settings are identical:
- Algorithm: AES-256
- Mode: CBC
- Padding: PKCS7
- Extract the Initialization Vector (IV): Just like with the key, the IV is embedded in the file itself. The first 16 bytes of the encrypted .MP4 file are the IV. The remaining bytes of the file are the encrypted video data.
After this step, you will have a playable, unencrypted video file.
Step 3c: Ingesting Metadata
Each title comes with two essential metadata files, both linked in the Manifest.json.
-
Publicity Metadata (
.FilmMetadata.json):-
Location: Found in the
PublicityMetadataLocationfield of the manifest. -
Contents: This JSON file contains rich descriptive information for your user interface. This includes:
- Title, release year, and runtime.
- Synopsis (in multiple languages and for different devices).
- Studio, rating, genres, and tags.
- Full cast and crew lists.
-
Location: Found in the
-
Media File Info (
.MediaFileInfo.json):-
Location: Found in the
Asset.MediaFileInfoLocationfield of the manifest. -
Contents: This JSON file provides detailed technical specifications about the encoded video file, such as:
- Video resolution (e.g., 1280x720 pixels).
- Overall bitrate (e.g., "2104 kb/s") and video bitrate ("2000 kb/s").
- Video and audio codecs (e.g., "AVC" and "AAC").
- Precise file runtime in seconds (e.g., "734").
-
Location: Found in the
Step 3d: Ingesting Publicity Assets
The final step is to gather all the promotional materials, like posters and trailers.
-
Open the Publicity Metadata File (
0049546.FilmMetadata.jsonfrom the previous step). -
Find the
AssetsList: Inside this file is anAssetslist. Each item in the list represents a single publicity file. -
Get the Asset Path: Each item specifies the
AssetType(e.g., "One Sheet", "Trailer - MP4") and itsLocation.-
Important: The
Locationpath (e.g.,en-US/0049546photo.jpg) is relative to the publicity metadata file itself. You must combine the path of the metadata file with this relative path to get the full path to the asset. -
Example: The manifest points to
Publicity/0049546/0049546.FilmMetadata.json. The asset location isen-US/0049546photo.jpg. Therefore, the full path to the asset isPublicity/0049546/en-US/0049546photo.jpg.
-
Important: The
By iterating through this Assets list, you can copy all available publicity materials into your system.
This completes the process for a single movie title. Your automation will repeat these steps for every item in the manifest's ContentItems list until the entire drive has been ingested.
4. Next Steps
Here are some links where you can download sample content and code examples in Python and C# to help you understand these steps better.
Coding Your Solution: A Guide to Processing Swank AES Drives with C#
Coding Your Solution: A Guide to Processing Swank AES Drives in Python
Comments
0 comments
Please sign in to leave a comment.