All Products
Search
Document Center

Upload merged videos

Last Updated: Jul 30, 2019

The short video SDK provides the AliyunIVodCompose interface that is specifically designed for video production and upload. This interface encapsulates video production and upload features to facilitate these operations on clients, and allows you to produce and upload edited videos on a dedicated UI.

  • The production method must be called before the upload method.
  • The production method can be called multiple times. The upload method uploads only the latest video file that is produced.
  • If a video is edited, you need to save the effects added to the video to the local configuration file before creating an AliyunIVodCompose instance. Otherwise, the produced video does not contain these effects. To save added effects to the local configuration file, call the following method:
  1. AliyunIEditor#saveEffectToLocal();

Edition difference

Edition Description
Professional edition All features are supported.
Standard edition All features are supported.
Basic edition The production and upload features are not supported. You can use the VODUpload SDK to upload videos and images to ApsaraVideo for VOD.

Produce and upload a video

  • Initialize a production instance (AliyunIVodCompose).
  1. AliyunComposeFactory#createAliyunVodCompose();
  2. AliyunIVodCompose#init(Context context);
  • Produce a video.
  1. AliyunIVodCompose#compose(String config, String output, AliyunIComposeCallBack callback);
  • Pause the production.
  1. AliyunIVodCompose#pauseCompose();
  • Resume the production.
  1. AliyunIVodCompose#resumeCompose();
  • Cancel the production.
  1. AliyunIVodCompose#cancelCompose();
  • Upload a video or an image.
  1. /**
  2. * Uploads a video by using the upload URL and credential.
  3. * videoPath: the path of the video file.
  4. * uploadAddress: the upload URL.
  5. * uploadAuth: the upload credential.
  6. * aliyunVodUploadCallBack: the upload callback.
  7. */
  8. AliyunIVodCompose#uploadVideoWithVod(String videoPath, String uploadAddress, String uploadAuth, AliyunIVodUploadCallBack aliyunVodUploadCallBack);
  1. /**
  2. * Uploads an image by using the upload URL and credential.
  3. * imagePath: the path of the image file.
  4. * uploadAddress: the upload URL.
  5. * uploadAuth: the upload credential.
  6. * aliyunVodUploadCallBack: the upload callback.
  7. */
  8. AliyunIVodCompose#uploadImuploadImageWithVodageWithVod(String imagePath, String uploadAddress, String uploadAuth, AliyunIVodUploadCallBack aliyunVodUploadCallBack);

The AliyunIVodCompose interfaces uploads a video or an image by using the upload URL and credential. For more information, see Obtain the video upload URL and credential.

  • Update the upload credential.
  1. /**
  2. * uploadAuth: the upload credential.
  3. */
  4. AliyunIVodCompose#refreshWithUploadAuth(String uploadAuth);

The upload credential has a validity period. If the upload credential expires, you need to obtain a new credential by using the onUploadTokenExpired method. For more information, see Update the upload credential.

  • Cancel the upload.
  1. AliyunIVodCompose#cancelUpload();
  • Resume the upload.
  1. AliyunIVodCompose#resumeUpload();
  • Pause the upload.
  1. AliyunIVodCompose#pauseUpload();
  • Release resources.
  1. AliyunIVodCompose#release();