You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Basic concepts
Pipeline
Copy page
Download PDF
Pipeline
A pipeline is a series of commands connected by pipeline operators (|). TOS enables you to use these operators to chain multiple data processing operations, eliminating the need for manual transfer of intermediate results. TOS then executes these operations in the defined order, thereby improving processing efficiency. This topic explains the notes, rules, and usage examples for pipelines.​
Notes​
The following two types of operations are supported when using the pipeline operator (|): 1) chaining multiple image processing operations, and 2) chaining frame extraction with image processing operations. For more information, see Image processing overview and Snapshot.​
Chaining rules​
A pipeline symbol is a typographical mark that looks like a vertical line (|). You can use the vertical bar (|) in the file URL to chain multiple data processing operations. TOS executes these operations sequentially, from left to right, according to the order defined in the file URL. Follow the rules below to chain operations.​
​
Scenario​
Description​
Chaining multiple image processing opertions​
When using the pipeline operator to chain multiple image processing operations, the second and subsequent operations in the chain may or may not include the image/ parameter.​
The file URL format can be: x-tos-process=image/<image processing parameters>|<image processing parameters>|<image processing parameters> or x-tos-process=image/<image processing parameters>|image/<image processing parameters>|image/<image processing parameters>.​
Chaining frame extraction with image processing operations​
When using the pipeline operator to chain frame extraction and image processing:​
  • The first operation in the chain must be frame extraction.​
  • The second operation in the chain can only be image processing and must include the image/ parameter.​
  • Any subsequent operations can be one of the following: 1) image processing with the image/ parameter, or 2) image processing without the image/ parameter.​
The file URL format can be: x-tos-process=video/<frame extraction parameters>|image/<image processing parameters>|<image processing parameters> or x-tos-process=video/<frame extraction parameters>|image/<image processing parameters>|image/<image processing parameters>.​
​
Examples​
  • Example 1: Chain image resizing and watermarking​
  • Resize an image​
  • Specify the width as 200 and the height as 200, and set the mode to fixed.​
  • ​Image​​
  • Chain image resizing and watermarking​
  • Specify the width as 200 and the height as 200, and set the mode to fixed. Apply a text watermark to the image that reads "Hello", and set the text size to 72, the color to red, and the font to FangZhengShuSong.​
  • ​Image​​
  • Example 2: Chain frame extraction and image rotation​
  • Extract a frame from a video​
  • Use the default mode to extract the frame at 26000ms. Scale the image to a width of 400 px and a height of 200 px. Set the output format to jpg.​
  • ​Image​​
  • Chain frame extraction and image rotation​
  • Use the default mode to extract the frame at 26000ms. Scale the image to a width of 400 px and a height of 200 px. Set the output format to jpg. Rotate the image 90 degrees clockwise​
  • ​Image​​
​
Last updated: 2026.10.09 14:46:05