How to reduce video delivery time by using Video Chunk Encoding

To get a video ready for consumption on web and mobile devices, you will have to first upload the master video file on to the server. And then encode the file before delivery. This is a time-consuming process. In an industry where ‘Who gets the eyeball first?’ plays an important role in video becoming a success, saving every minute is paramount. The lesser time the process takes, the better.

Usually, the process of uploading and encoding are done in sequence. The time taken for this process can be reduced significantly by encoding video chunks even while the video upload is still in progress.

Things to remember when encoding video chunks

  • This process is only suitable for large video uploads especially for files > 50 MB.
  • The conversion component needs to be fixed (~10-20 seconds), irrespective of video size.
  • We should encode the last chunk only after the video upload is completed.

Process for encoding

As you start uploading the video, follow the steps below.

  1. After the first chunk of 10MB is uploaded,
    • Get video details – video bitrate & audio bitrate
    • Calculate the number of seconds of video in the chunk of 10 MB
    • Fix the time-slice for encoding based on the above calculation
  2. Calculate start-time and end-time for the subsequent chunk and slice-time
  3. Call ffmpeg for encoding with the partial uploaded video, start-time, end-time.
  4. If ‘encoding process’ runs into an error, abort the chunk encoding and fall back to full conversion
  5. If the ‘encoding process’ is successful,
    • Mark the chunk as completed
    • And append the converted video to the video_list
  6. In the last chunk, along with the above steps, call a new ffmpeg to concatenate all the chunk videos in the list. If this process runs into an error, abort the chunk encoding and fall back to full conversion.

How to reduce video delivery time by using Video Chunk Encoding

To get a video ready for consumption on web and mobile devices, you will have to first upload the master video file on to the server. And then encode the file before delivery. This is a time-consuming process. In an industry where ‘Who gets the eyeball first?’ plays an important role in video becoming a success, saving every minute is paramount. The lesser time the process takes, the better.

Usually, the process of uploading and encoding are done in sequence. The time taken for this process can be reduced significantly by encoding video chunks even while the video upload is still in progress.

Things to remember when encoding video chunks

  • This process is only suitable for large video uploads especially for files > 50 MB.
  • The conversion component needs to be fixed (~10-20 seconds), irrespective of video size.
  • We should encode the last chunk only after the video upload is completed.

Process for encoding

As you start uploading the video, follow the steps below.

  1. After the first chunk of 10MB is uploaded,
    • Get video details – video bitrate & audio bitrate
    • Calculate the number of seconds of video in the chunk of 10 MB
    • Fix the time-slice for encoding based on the above calculation
  2. Calculate start-time and end-time for the subsequent chunk and slice-time
  3. Call ffmpeg for encoding with the partial uploaded video, start-time, end-time.
  4. If ‘encoding process’ runs into an error, abort the chunk encoding and fall back to full conversion
  5. If the ‘encoding process’ is successful,
    • Mark the chunk as completed
    • And append the converted video to the video_list
  6. In the last chunk, along with the above steps, call a new ffmpeg to concatenate all the chunk videos in the list. If this process runs into an error, abort the chunk encoding and fall back to full conversion.

Introduce Yourself (Example Post)

This is an example post, originally published as part of Blogging University. Enroll in one of our ten programs, and start your blog right.

You’re going to publish a post today. Don’t worry about how your blog looks. Don’t worry if you haven’t given it a name yet, or you’re feeling overwhelmed. Just click the “New Post” button, and tell us why you’re here.

Why do this?

  • Because it gives new readers context. What are you about? Why should they read your blog?
  • Because it will help you focus you own ideas about your blog and what you’d like to do with it.

The post can be short or long, a personal intro to your life or a bloggy mission statement, a manifesto for the future or a simple outline of your the types of things you hope to publish.

To help you get started, here are a few questions:

  • Why are you blogging publicly, rather than keeping a personal journal?
  • What topics do you think you’ll write about?
  • Who would you love to connect with via your blog?
  • If you blog successfully throughout the next year, what would you hope to have accomplished?

You’re not locked into any of this; one of the wonderful things about blogs is how they constantly evolve as we learn, grow, and interact with one another — but it’s good to know where and why you started, and articulating your goals may just give you a few other post ideas.

Can’t think how to get started? Just write the first thing that pops into your head. Anne Lamott, author of a book on writing we love, says that you need to give yourself permission to write a “crappy first draft”. Anne makes a great point — just start writing, and worry about editing it later.

When you’re ready to publish, give your post three to five tags that describe your blog’s focus — writing, photography, fiction, parenting, food, cars, movies, sports, whatever. These tags will help others who care about your topics find you in the Reader. Make sure one of the tags is “zerotohero,” so other new bloggers can find you, too.

Design a site like this with WordPress.com
Get started