Video Resource Import
Function Introduction
During the initial import phase, video resources rely on the following two key capabilities:
-
- User Material Collection
- chooseMedia: Supports end-users in submitting original video materials by either recording videos in real-time or importing from the phone's album.
-
- Video Pre-standardization Processing
- clipVideo: Automatically standardizes the resolution and angle of the source video to prevent format differences from causing exceptions in the subsequent AI video generation process.
Interaction Process
sequenceDiagram
rect rgb(191, 223, 255)
Panel->>App: 1. Request video resource (record / album)
App->>System: 2. Call system API (camera / album permission)
System-->>App: Return raw video resource
App->>App: 3. Copy video to sandbox
App->>App: 4. Pre-standardization (resolution / angle)
App-->>Panel: 5. Return processed video URL
end
rect rgb(200, 150, 255)
Note right of Panel: User Interaction Layer
Note left of System: System Service Layer
endConsiderations
-
- When using the chooseMedia API, for better compatibility with both iOS and Android systems, please set the parameter isFetchVideoFile to true by default.
-
- When using the clipVideo API
- (1) The parameter endTime is in milliseconds, while the video duration returned by the chooseMedia API is in seconds. Please pay attention to unit conversion.
- (2) The parameter level indicates the compression resolution level of the target video:
- 1 represents 480854 with a bitrate: 15721000
- 2 represents 540960 with a bitrate: 21281000
- 3 represents 7201280 with a bitrate: 31451000
- 4 represents 10801920 with a bitrate: 35001000
- To ensure clarity of the output video, it is recommended to choose level 4 for this parameter.