Joyent Manta

Video transcoding

This job takes any number of video objects as input and uses the "ffmpeg" tool to transcode each one into the "webm" format. It stores the converted video under your user account's public directory, using a name similar to the input video. This example runs on a video from the public kartlytics dataset.

Note that this example uses ffmpeg's -nostdin option to avoid attempting to read user input from stdin. If this flag is left out, ffmpeg attempts to interpret the video file itself (which Manta provides on stdin) as an interactive interface through which it accepts commands like "q" to exit. The result is that video files are often truncated. Use the "-nostdin" ffmpeg option to avoid this behavior. For more information, see ffmpeg ticket 42.

Run it yourself

Once you've set up the Manta CLI tools, you can run this job yourself on the publicly accessible dataset using the following command:

$ mfind -t o -n '.*\.mov' /manta/public/examples/kart | \
    mjob create -n "Video transcoding" -w \
    -m 'ffmpeg -nostdin -i $MANTA_INPUT_FILE -an out.webm && \
        mpipe -p -H "content-type: video/webm" -f out.webm \
        "~~/public/manta-examples/kart/$(basename $MANTA_INPUT_OBJECT .mov).webm"'

Because the output for this job is quite large, this example did not use "mjob create -o" (which prints all job outputs). For the actual output, see "Output summary" below.

Job body

[
        {
                "exec": "ffmpeg -nostdin -i $MANTA_INPUT_FILE -an out.webm && \\\n        mpipe -p -H \"content-type: video/webm\" -f out.webm \\\n\t    \"~~/public/manta-examples/kart/$(basename $MANTA_INPUT_OBJECT .mov).webm\"",
                "type": "map"
        }
]

Input summary

(binary) /manta/public/examples/kart/2012-08-03_0011.mov

Output summary

1 total outputs
(binary) /manta/public/manta-examples/kart/2012-08-03_0011.webm

Error summary

0 total errors