Creating a Media Workflow

Create a media workflow and configure the required tasks for the workflow in Media Flow.

  • You can configure the OCI AI Service task only after you create a workflow. For more information on OCI AI Services, see Using the OCI AI Services.

    Setting up Assets for Input

    Before you begin, ensure that:

    • You have created a compartment.

    • You have uploaded the video assets to a OCI bucket in the same OCI region in which you will run the job.

    1. Open the navigation menu and click Analytics & AI. Under Media Services, click Media Flow.
    2. Select the compartment to create the workflow in.
    3. On the Media Workflows list page, click Create Media Workflow.
    4. On the Create Media Workflow page, in the Input pane of the Configure Tasks for Media Workflow section, select the bucket from where you want to load the assets. If you opt to select the bucket later, you must specify the bucket at run time.

    Transcoding the Video Assets

    After setting up assets for input, you can specify the resolutions for video streaming. Convert a video for ABR streaming or single file output using the Transcoding a video asset feature. You can select the preferable resolutions of a video, with a bandwidth suitable for you. Transcoding is an optional step.

    The time for transcoding a video depends on the number of rungs in the transcode workflow, resolution of the outputs, and length of the input video. Videos transcoded at outputs lesser than 4K resolutions complete in 1.5x real time (if the video is 30 seconds long, the job might take 90 seconds). Jobs that include 4K resolutions typically complete in 4x real-time (if the video is 30 seconds long, the job might take around two minutes).

    1. In the Create Media Workflow page, under the Configure Tasks for Media Workflow section, click the Transcode pane.
    2. In the Transcode pane, select the setting you want to use for transcoding the video asset. The available options are as follows:
      • Standard: This default setting provides the standard options.
      • Speed optimized: This setting provides you the standard options along with speed optimization options. This setting is a premium feature and has extra costs associated with it. You can see the details by hovering over the Additional Cost icon.
      • Quality optimized: This setting provides you the standard options along with quality optimization options for best output quality. This setting is a premium feature and has other costs associated with it. You can see the details by hovering over the Additional Cost icon.
    3. Specify the Transcode options for the asset. The available options are as follows:
      • Package type: Select the package type. The available options are as follows:
        • HLS
        • Dash
        • MP4
        • WebM
      • Segment length: Input the segment length in seconds for streaming packages.
      • Video codec: Select the video codec that you want to use. Based on the package type you have selected, the options change. Currently, the H265 codec is unavailable. For more information, contact Oracle Support. See Getting Help and Contacting Support. Based on the selected media container types the available codec options are as follows:
        • H.264
        • VP8
        • VP9
      • Audio codec: Select the audio codec that you want to use. Based on the package type you have selected, the options change. Based on the selected media container types the available codec options are as follows:
        • AAC
        • MP3
        • Opus
        • Vorbis
      • Speed optimization: This option is available if you have selected the Speed optimized setting. Select Standard, Fast, or Very Fast from the list.
      • Quality optimization: This option is available if you have selected the Quality optimized setting. Select Medium, High, or Very High from the list.
      • Two pass encoding: This option is available if you have selected the Quality optimized setting. You can enable or disable this option.
    4. In the Ladder section, perform the following steps:
      1. Specify the following settings for the ladder rung:
        • Width
        • Height
        • Resize Method
        • Bitrate: This option is available when you select Quality Optimized.
        You can create many rungs of resolutions for the video. The lower resolutions require less bandwidth to display.
      2. Click Add Size.
        A new ladder rung is created. You can remove the rung that you don't need.
    5. (Optional) In the Task output section, specify the Task output subfolder.
      The output from the Transcode task is placed in the specified folder. All the output folders are subfolders from the job output prefix and placed within the Job folder.

    The transcode configuration is complete.

    Using the OCI AI Services

    The OCI AI Services task includes the Transcribe and Vision tasks. These tasks are optional. The OCI AI Services task is a premium feature which uses the OCI Artificial Intelligence (AI) services and has other costs associated with it.

    Transcribing a video asset enables you to create a JSON and SRT file of the text from the audio of a video. Transcribe is a premium feature, which uses the OCI Speech service and has other costs associated with it. You must have the OCI Speech and Language Policies applied in your user account to use this task.

    Important

    To enable this feature, you must already have a workflow.

    Vision enables you to detect objects and text in the video. Vision is a premium feature, which uses the OCI Vision service, and has other costs associated with it. You must have the OCI policies applied in your user account to use this task.

    1. In the Create Media Workflow page, under Configure Tasks for Media Workflow section, click the OCI AI Services pane.
    2. (Optional) Enable the Transcribe task and provide the following information:
      • Audio language: Select the audio language used in the video's audio. The available options are English, Portuguese, and Spanish.
      • Analyze text: You can turn on this option to analyze the transcription output. This option uses the OCI Language service and includes detection of entities, sentiment, key phrase, and text classification.
      • Wait for completion: Turn on this option if you want to wait for completion. Disabling it runs the task in the background.
      • Task output subfolder: Specify the Task output subfolder. The output from the Transcribe tasks are placed in the specified subfolders within the job output folder.
    3. (Optional) Enable the Vision task and provide the following information:
      • Detection type: Select the detection type. The available options are Object detection and Text detection. If you select Text detection, then select the text detection language. English is the supported language.
      • Scene sensitivity: Specify the scene sensitivity from 0 to 100.
      • Minimum clip length: Select the minimum clip length in seconds.
      • Cleanup images: Turning on this option erases all the images generated for each of the scenes. The output excludes scene images captured during this task.
      • Task output subfolder: Specify the Task output subfolder. The output from the Vision tasks is placed in the specified subfolders within the job output folder.

    The AI task outputs are generated in the selected output bucket. The AI Services configuration is complete and now you can add thumbnails for the video.

    Creating Thumbnails

    Thumbnails are the images representing the frames of the videos.

    They help you to have a quick snapshot of the content in the video files. Adding thumbnails is an optional step.

    1. In the Create Media Workflow page, under Configure Tasks for Media Workflow section, click the Thumbnail pane.
    2. In Image capture options, specify the options to capture the thumbnail. The available options are as follows:
      • Fixed: This option enables you to capture thumbnail images at fixed timestamps.
        1. Click Add Timestamp.
        2. Specify the timestamp details.
      • Interval: This option enables you to select intervals in the video and captures frames at specified intervals. Specify the values in the Starting time, Interval time, and Number of frames fields.
      • Percentage: This option enables you to specify thumbnail captures based on the playback percentage of the video.
        1. Click Add percentage.
        2. Specify the percentage.
    3. In Image options, select the format for the image.
    4. In the Image sizes section, perform the following steps:
      1. Specify the width, height, and resize method for the image.
      2. Click Add Size to specify a different size.
        Image Size is generated for each image capture. You can remove thumbnails you do not require.
    5. (Optional) In the Task output section, specify the task output subfolder.
      The output from the Thumbnail task is placed in the specified folders. All the output folders are subfolders from the job output prefix and placed within the Job folder.

    Specifying the Output Bucket

    Select the output location in the bucket list of your compartment where you want to store the output rendered from the workflow. You can edit the settings while running a job.

    1. In the Create Media Workflow page, under Configure Tasks for Media Workflow section, click the Output pane.
    2. Select the output bucket in the Object Storage compartment where you want to store the transcoded video.
    3. In the Job output prefix field, enter a prefix for the folder or file name.

    Specifying a Distribution Channel for Streaming

    Ensure to set up a distribution channel before defining the workflow.

    Streaming is a built-in integration with Media Streams. The metadata is picked up from the content and moved to the final location for streaming of the video files.

    1. In the Create Media Workflow page, under Configure Tasks for Media Workflow section, click the Streaming pane.
    2. Specify the channel for distribution.

    The media workflow is ready. Click Save. In the Media Workflow name dialog box, enter a name for the Media Flow and click Save.

    The workflow is created. If you want to run a job for this media workflow, select Run Job. The JSON output is generated with the job and is stored in the Object Storage bucket. On the Job Output page, you can find a link to the file.

  • To create a media workflow, run the create command:

    oci media-services media-workflow create [OPTIONS]

    Required parameters for the create command:

    • --compartment-id, -c [text]
    • --display-name [text]

    Media workflows are complex JSON objects. You can use the --from-json option and pass the body of the media workflow in a file.

    To get all the commands for media-workflow:

    oci media-services media-workflow -h

    To get help for the create command:

    oci media-services media-workflow create -h

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

  • To configure a media workflow, use the CreateMediaWorkflow operation.