Skip to main content

Packaging-only Mode

Usually, you use Axinom Encoding to encode a video, package it with DASH/HLS and protect with DRM - all in one go. But sometimes you may want to encode a video in an upstream system, while still using Axinom Encoding for packaging and DRM protection. For this Axinom Encoding supports a so-called packaging-only mode. You can provide an already encoded video, with as many bitrates as you wish, add audio- and subtitle-streams and apply DRM protection.

As the encoding is the longest processing phase, using the package-only mode is significantly faster.

How to use the packaging-only mode?

You submit a regular job to the Encoding API following the rules below:

  1. Signal the packaging-only mode by setting "VideoFormat":"DoNotEncode" (see Encoding Phase).
  2. For each video bitrate upload the encoded video file to the input storage
    1. The source files must be unencrypted.
    2. The source files must be single files, not segmented files.
    3. The variants/representations must be submitted as separate files. They shall be packaged as-is, i.e. without modifications.
    4. Only AVC (H.264) and HEVC (H.265) encoded source videos are supported. The system shall try to package other encodings as well but they might not work.
    5. All video variants should be encoded with the same encoder. Otherwise, the result is undefined.
    6. The GOP of video sources should be the same for all variants and the GOP size should be 5 seconds or less.
    7. The video file regex in the job request must find all the variants/representations. If the regex doesn’t find a file, the file is not included in the output.
  3. Apply DRM protection to your content in the job request as usual. Multiple keys assignment is also possible, as described under Multiple Keys Support.
  4. Embedded audio, subtitles, or closed captions are not currently supported in video files. All tracks must be in separate source files.
  5. Do not have file names that differ only by their file extensions (e.g. eng.vtt and eng.srt). This leads to file name collisions when packaging the files.
  6. We have witnessed that some formats and codecs do not work in this scenario. For example, WAV and PAC don’t work.

When using the packaging-only mode

The following applies when using the packaging-only mode:

  1. The "OptimizeFor" option has no effect.
  2. The "SubtitleChunksPattern" and "ClosedCaptionChunksPattern" options have no effect.
  3. You can use regular Message Publishers to listen for errors.
  4. If you use DoNotEncode the message ContentMapped has a slightly different structure. Instead of a single object VideoStreamMapping, you shall receive an array with such elements (VideoStreamMappings), as there are multiple video source files possible. If you don’t use DoNotEncode, you shall receive the object VideoStreamMapping like before.
  5. The bitrates in the manifest are the actual bitrates found in the source videos. (The element VideoRepresentations has no effect.)
  6. The source files are generally not changed, except for:
    1. their file names if they contain disallowed characters.
    2. if the best practices include having the output in a specific format, e.g. if the subtitles are converted to binary.
  7. Only the following characters are allowed in the file names:
    1. A-Z
    2. 0-9
    3. _
    4. .
    5. All other characters are changed to the character "_". If the renaming of the file would cause a file name duplication, the job is terminated.
      1. Example: this name conversion would happen: televisión.mp4 → televisi_n.mp4.
  8. The output file extensions are changed if the output is DASH, DashOnDemand, or HLS. In case of CMAF, the file extension stays the same.
  9. If you submit an audio track which is shorter than the video track, the video playback ends when the audio track reaches the end.

Chaining Axinom Encoding

You can use Axinom Encoding to only encode your video, and then run Axinom Encoding again against the output of the first run in a packaging-only mode. For this to work apply the following rules.

For the first run:

  • Set "OutputFormat":["CMAF"] or "OutputFormat":["DashOnDemand"] (only in these cases you get unsegmented output)
  • Do not apply DRM (set "DrmProtection":"None")

For the second run:

  • Set "VideoFormat":"DoNotEncode"
  • Supply all audio- and subtitle-streams as separate files
  • Do apply DRM if desired

Errors

If an error occurs in the underlying packager, the first line of the actual error is published using the message publishers, FinalError.

Sample packaging error message
{
"ExceptionMessage": null,
"PublicMessage": null,
"StackTrace": null,
"MessageBody": "[0927/132625:INFO:demuxer.cc(88)] Demuxer::Run() on file '/app/data/0cb4c241-8d8c-44da-8f96-2e4aa0a3efee/acquired/3minaudio_WAV-rus.wav'. ...",
"ErrorCode": 2000,
"EncodedBitrates": null,
"Timestamp": "2021-09-27T13:26:37.7584359Z",
"JobId": "0cb4c241-8d8c-44da-8f96-2e4aa0a3efee",
"TenantId": "testing-v1",
"ExternalId": "PackagingError: wav",
"ExternalType": "testing",
"ExternalProvider": "Marko"
}