百度智能云

All Product Document

          Multimedia Cloud Processing

          Pipeline

          The pipeline is divided into free type and exclusive type:

          • The transcoding tasks in the free pipeline share about 400 ways of 720P transcoding computing resources provided by Baidu AI Cloud for the transcoding of audio and video.
          • The exclusive pipeline needs procurement additionally to better meet the users with higher business requirements for transcoding timeliness and stability.

          The user can use pipelines to realize task priorities. You can distinguish task priority by creating multiple pipelines. Create most tasks in the pipeline with normal priority, and place high- priority tasks in the pipeline with high priority. Use the principle of first-come-first-served for pipelines to adjust the priority of tasks.

          Create New Pipeline

          The following code creates a pipeline, and the capacity value is 20 by default:

          public void createPipeline (MediaClient client, String pipelineName, 
                 String sourceBucket, String targetBucket, int capacity) { 
              //Create a Pipeline 
              client.createPipeline(pipelineName, sourceBucket, targetBucket, capacity); 
          } 

          List All Pipelines

          The following code can list all the users' Pipeline:

          public void listPipelines (MediaClient client) { 
              //Get the user’s Pipeline list 
              List<PipelineStatus> list = client.listPipelines().getPipelines(); 
          
              //Traverse Pipeline list 
              for (PipelineStatus pipeline : list) { 
                  System.out.println(pipeline); 
              } 
          } 

          Query Assigned Pipeline

          If you only query a certain Pipeline, use the following code:

          public void getPipeline (MediaClient client, String pipelineName) { 
              GetPipelineResponse pipeline = client.getPipeline(pipelineName); 
              System.out.println(pipeline); 
          } 

          Delete Pipeline

          The following code can delete a Pipeline:

          public void deletePipeline (MediaClient client, String pipelineName) { 
              //Delete the Pipeline 
              client.deletePipeline(pipelineName); 
          } 

          You should note that if Job associated with the Pipeline is not completed, you cannot delete the Pipeline. You can delete it successfully only after Job is completed.

          Update Assigned Pipeline

          Update the capacity of the assigned pipeline:

          public void updatePipeline (MediaClient client, String pipelineName, Integer capacity) { 
              PipelineStatus pipeline = client.getPipeline(pipelineName).getPipeline(); 
              pipeline.getConfig().setCapacity(capacity); 
              client.updatePipeline(new UpdatePipelineRequest().withPipeline(pipeline)); 
          } 

          Update the similar writing styles of other fields

          Previous
          MediaClient
          Next
          Transcoding-Job