## Video File Import and Export Capability

### Import Local Video Resources

- **Function**: Allows end-users to import video materials through the following methods:

  1. Directly activating the phone camera to record video material.
  2. Importing existing video materials from the phone album.

- **Interface Details**: [chooseMedia](https://developer.tuya.com/en/miniapp/develop/ray/api/media/image/chooseMedia#choosemedia)

### Video Pre-Standardization Processing

- **Function**: Primarily used to standardize the resolution and angle of source video resources to prevent anomalies during subsequent AI processing due to varying resolutions and angles.

- **Interface Details**: [clipVideo](/en/miniapp/develop/ray/api/media/video/clipVideo)

### Export after Video AI Generation

- **Function**: Enables end-users to save edited video materials to their phone album.

- **Interface Details**: [saveVideoToPhotosAlbum](https://developer.tuya.com/en/miniapp/develop/ray/api/media/video/saveVideoToPhotosAlbum#savevideotophotosalbum)

## Audio Interaction Capabilities

### Obtain Tuya Default Background Music

- **Function**: Currently, templates provide a selection of default background music for developers to use, with plans to expand the music library in the future.

- **Interface Details**: [backgroundMusicList](/en/miniapp/develop/ray/api/ai/aiKit/backgroundMusicList)

### Download Tuya Default Background Music

- **Function**: Download Tuya's online background music to the app's local sandbox.

- **Interface Details**: [backgroundMusicDownload](/en/miniapp/develop/ray/api/ai/aiKit/backgroundMusicDownload)

### Music Resource Control Instance

- **Function**: Used to play or pause background music for trial listening by the user.

- **Interface Details**: [createInnerAudioContext](https://developer.tuya.com/en/miniapp/develop/ray/api/media/audio/createInnerAudioContext)

## AI Video Stream Processing Functions

<h3 id="Create AI Video Stream Processing Instance">Create AI Video Stream Processing Instance <span className="tag_h2">On-App AI</span></h3>

- **Function**: Initialize AI video stream processing instance.

- **Interface Details**: [objectDetectCreate](/en/miniapp/develop/ray/api/ai/aiKit/objectDetectCreate)

### Destroy AI Video Stream Processing Instance

<h3 id="Destroy AI Video Stream Processing Instance">Destroy AI Video Stream Processing Instance <span className="tag_h2">On-App AI</span></h3>

- **Function**: Destroy AI video stream processing instance to avoid memory leaks.

- **Interface Details**: [objectDetectDestroy](/en/miniapp/develop/ray/api/ai/aiKit/objectDetectDestroy)

### Highlight Pets/Portraits and Edit Video Stream Background Music

<h3 id="Highlight Pets/Portraits and Edit Video Stream Background Music">Highlight Pets/Portraits and Edit Video Stream Background Music <span className="tag_h2">On-App AI</span></h3>

- **Function**:

  1. Highlight relevant subjects within the video stream based on input parameters.
  2. Add custom background music to the video according to music materials and mixing ratios.

- **Interface Details**: [objectDetectForVideo](/en/miniapp/develop/ray/api/ai/aiKit/objectDetectForVideo)

<h3 id="Cancel Video Stream Editing Operations">Cancel Video Stream Editing Operations <span className="tag_h2">On-App AI</span></h3>

- **Function**: Interrupt ongoing AI video stream processing operations.

- **Interface Details**: [objectDetectForVideoCancel](/en/miniapp/develop/ray/api/ai/aiKit/objectDetectForVideoCancel)

<h3 id="AI Processing Progress Monitoring Function">AI Processing Progress Monitoring Function <span className="tag_h2">On-App AI</span></h3>

- **Function**: Monitor the generation progress of the AI video stream.

- **Interface Details**: [onVideoObjectDetectProgress](/en/miniapp/develop/ray/api/ai/aiKit/onVideoObjectDetectProgress)

<h3 id="Cancel AI Processing Progress Monitoring Function">Cancel AI Processing Progress Monitoring Function <span className="tag_h2">On-App AI</span></h3>

- **Function**: Cancel the monitoring of AI video stream generation progress.

- **Interface Details**: [offVideoObjectDetectProgress](/en/miniapp/develop/ray/api/ai/aiKit/offVideoObjectDetectProgress)
