How do I process captions with the Encoding.com API?

The Closed Caption feature set is available within our  API to rapidly upgrade our customers’ digital video authoring and distribution workflows. The new feature set permits customers to extract closed captions from source files stored somewhere on the Internet and convert them into sidecar files. Customers can also copy a closed caption or timed text track from a source video into an output video. And we allow customers to mux a sidecar file (in SRT or SCC format) with a source video to encode a valid closed caption track into their output videos. The idea is to use the cloud to empower customers to easily increase their addressable audience while saving money and obeying the law.

Here is a complete summary of the XML required to process closed captions in a valid HTTP POST with parameter (xml) submitted to the Encoding.com API:

<?xml version="1.0"?>
<query>
    <action>AddMedia</action>
    <userid>[UserID]</userid>
    <userkey>[UserKey]</userkey>
    <source>[SourceURL]</source>
    <format>
        <output>[preset_profile_name]</output>
        <closed_captions>
            <source>[closed_caption_source_file_url]</source>
            <copy>[yes|no]</copy>
            <extract>[srt|scc]</extract>
            <mux_type>[cea-608|timed-text]</mux_type>
            <language>[LanguageCode]</language>
        </closed_captions>
        <destination>[OutputURL]</destination>
    <format>
</query>

Let’s review the three new features in a little more detail: extract, mux and copy:

<extract>
Extraction of a closed caption sidecar file is often necessary. Browser-based video players can’t read closed caption tracks in digital videos. Android video players mostly require sidecar files as well. Editing and authoring suites depend on sidecar files to make it easier for video editors to do their jobs.

Encoding.com is the only cloud transcoding provider to support extraction of closed caption “sidecar” files from the most common closed caption tracks in HD television (CEA-708) and SD television (CEA-608) programming. We also extract the closed captions from 3GPP TT or MPEG-4 Part 17 tracks in a video file. You can produce output video in any format while extracting a caption track as a SCC or SRT sidecar.

<mux_type>
Muxing a sidecar with a video file is a common requirement. Editors often use SCC sidecars to exchange timed text information among authoring tools, files and/or colleagues. DVD publishers convert SCC files into analog closed captions to encode into their MPEG-2 creations. Digital captions have to become analog captions before they can be inserted into HTTP Live Streaming files for delivery to iOS apps. There are other common workflows. It makes sense to do this work using a SaaS like the Encoding.com platform

<copy>
Do you have analog captions in a library of ASF, MOV, MXF, MPEG-2, or some other kind of files? Do you need HTTP Live Streaming output but don’t want to waste time extracting and muxing pesky sidecar files? Do you have 3GPP Timed Text captions in 3GP files and need them in MP4 files instead? Customers have both these problems. <copy> solves them. It rocks.

Create Closed Caption Output From Source File and Sidecar File:

Example: NBC might need to mux subtitles into video files for a new iPhone app.

<?xml version="1.0"?>
<query>
    <format>
        <output>iPhone_stream</output>
        <closed_captions>
            <source>ftp://files.nbc.com/Grimm/episode_1.srt</source>
            <mux_type>cea-608</mux_type>
        </closed_captions>
    </format>
</query>

Extract Sidecar Files from Source Files for Browsers:

Amazon Instant Video might need to extract sidecars for browser-based players.

<?xml version="1.0"?>
<query>
    <format>
        <output>mp4</output>
        <closed_captions>
            <extract>srt</extract>
        </closed_captions>
    </format>
</query>

Create Video for iOS with Closed Captions from the Edit Bay:

Example: NBA might need SCC files muxed with ASF files to play in iOS apps.

<?xml version="1.0"?>
<query>
    <format>
        <output>iPad_stream</output>
        <closed_captions>
            <source>ftp://files.nba.com/publish/game_upc.scc</source>
            <mux_type>cea-608</mux_type>
        </closed_captions>
    </format>

<format> <output>mp4</output> <closed_captions> <source>ftp://files.nba.com/publish/game_upc.scc</source> <mux_type>timed text</mux_type> </closed_captions> </format> </query>

Create iPhone and HTML5 closed captions from Legacy Video Library:

Example: MTV might need to extract captions from MPEG-2s for iPad and a Flash player.

<?xml version="1.0"?>
<query>
    <format>
        <output>iPad_stream</output>
        <closed_captions>
            <copy>yes</copy>
        </closed_captions>
    </format>

<format> <output>mp4</output> <closed_captions> <extract>scc</extract> </closed_captions> </format> </query>

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

edchelp