Skip to main content

How profiles pipelining makes your life easier

Have you ever wondered if there is an option to encode your video and then use an encoded version of it as an input to new encoding? So far it hasn’t been available off the shelf, but it has been possible to get it using our notification system. But why should our customers have to take care of it by themselves?

So, what is profiles pipelining?

Let’s say you want to send a video to Panda and encode it using 3 profiles: “h264.1”, “h264.2”, “h264.3”, and then you want a video created within profile “h264.2” to be encoded using profiles “h264.4” and “h264.5”. And you also want to create output using profile “h264.3” which needs to be encoded using profile “h264.6”. But it’s not the end. To make it harder you also want to encode video created with profile “h264.5” using “h264.7”. Uhh, it can be hard to imagine what is going on, so for simplicity below you can see an image showing what I mean.

 

Pipeline Example
Example pipeline

 

 

First we need to describe it using JSON:

{
  “h264.1”:{},
  “h264.2”:{
    “h264.4”:{},
    “h264.5”:{
      “h264.7”:{}
    }
  },
  “h264.3”:{
    “h264.6”:{}
  }
}

 

And now we can send our request to Panda. Below is example Ruby code:


pipeline = {
  “h264.1” => {},
  “h264.2” => {
    “h264.4” => {},
    “h264.5” => {
      “h264.7” => {}
    }
  },
  “h264.3” => {
    “h264.6” => {}
  }
}


Panda::Video.create!(
  :source_url => “SOURCE_URL_TO_FILE”,
  :pipeline => pipeline.to_json
)

Now, when encoding is done, Panda will look if there is anything more to do next in the pipeline. If, for example, encoding to “h264.2” is done, it will become a new input for  “h264.4” and “h264.5” profiles and so on. Encodings created using pipelines will have additional field parent_encoding_id which can be used to find out what was the input used to encode or to reproduce pipeline with encodings instead of profiles.

If you have any problems with this new feature don’t forget that we are always here to help you.

Take care!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.