The technology used by Worldnow for re-streaming and displaying live streams on their clients’ websites was provided by Akamai Technologies, a U.S. network which specializes in Internet content delivery. While this is one of the largest distributed computing platforms in the world and currently serves between 15 and 20 percent of all web traffic, the display of closed captions proved to be a problem as they just disappeared once a video signal containing CC data was uploaded to their servers. Our software experts quickly identified the source of the problem: Flash media live encoder (FMLE) actually deleted all CC data when encoding the video signal to AAC/H264.
In order to make this work in a way that would both satisfy our client and deliver a great end-user experience, two possible roads were identified for our project team to take:
1. Find a solution to the issues caused by the existing Workflow and FMLE
During the analysis of the existing solution, the following shortcomings of FMLE were detected:
- Unable to read closed caption data from a device’s pin
- Unable to copy streams without modifying it
- CC data was deleted during h264 encoding
- No configuration option available to remedy this behavior
- No open source solution for modifying this information available
2. Find alternative encoder(s) capable of retaining CC data during encoding
We tried and tested various encoding software solutions, like Afritelly encoder, Wirecast, and Sorenson Squeeze. However, things proved difficult as all of these either had similar problems with CC data or were incompatible with streaming to Akamai. The reason for this was the secure connection used by Akamai, which is protected by usernames and passwords.
In the end and after much deliberation, the winner was… ffmpeg, which is an open source project with a highly flexible configuration and supports tons of formats for encoding and streaming. In order to adapt this solution to our needs, however, a lot of research was still needed:
- Repeat the current workflow process of streaming video and audio to Akamai via ffmpeg. This proved successful as streaming ffmpeg to Akamai through basic auth worked faultlessly.
- Encode CC data as a live stream and send this stream to Akamai via ffmpeg. Here, it was important to make sure that no CC data would be lost. In this stage, development was hampered due to some bugs in ffmpeg, which made it impossible to implement the functionality as required:
- The program is unable to successfully read the pins of the device, so CC data cannot be read from it
- FFmpeg deletes CC data when encoding to H264, just like FMLE; even if we can read closed captions and encode them to the video stream, ffmpeg will still delete CC data during encoding
This proved to be a complex project, due to the above-mentioned reasons, but the happy ending arrived when we found out that if the step of video encoding is skipped and ffmpeg is used only for transmitting the stream to Akamai, CC data is not removed.
After this piece of good news, the remaining task was much simplified: finding a way to encode video to H264 without losing CC data and to upload it to Akamai via ffmpeg. In order to overcome this final hurdle, we settled on MainConcept H264 encoder, which is able to use video and CC byte-streams as input data and produce a signal with the closed captions encoded to the video stream (a so-called elementary stream).