# UseAVTranscoderVideo
**Repository Path**: LYGiteeSpace/UseAVTranscoderVideo
## Basic Information
- **Project Name**: UseAVTranscoderVideo
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2025-07-03
- **Last Updated**: 2025-07-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## Use AVTranscoder to realize video transcoding (ArkTS)
### Introduce
This example will explain the functions of AVTranscoder video transcoding to developers in a process
of "Start Transcoding-Pause Transcoding-Restore Transcoding-Transcoding Complete".
### Effect Preview
| HomePage | TranscodingPage | TranscoderedPage |
|------------------------------------------------------------|---------------------------------------------------------------------|--------------------------------------------------------------------|
|
|
|
|
Instructions for use:
1. Open the application. The home page supports the parameter configuration required for video transcoding.
After selecting, click the start transcoding button to jump to the video transcoding page.
2. The video transcoding page can see the progress of video transcoding. Click the pause button, pause transcoding,
click the recovery button, and resume transcoding; click the cancel button, pop-up window reminds whether to cancel transcoding;
after transcoding is completed, click the completion button to jump to the transcoding completion page.
3. The transcoding completion page can watch the video after transcoding. Click the home button to return to the home page.
### Engineering Catalogue
```
├──ets
│ ├──entryability
│ │ └──EntryAbility.ets
│ ├──pages
│ │ ├──index .ets // Home page
│ │ ├──TranscoderFinishPage.ets // Video transcoding completion page
│ │ ├──VideoTranscoderPage.ets // Video transcoding progress page
│ └──utils
│ └──AVTranscoderManager.ets // Video transcoding management
└──resources
└──rawfile
└──video_sample.mp4 // Transcoding video
```
### Concrete realization
1. Use [AVTranscoder](https://developer.huawei.com/consumer/doc/harmonyos-references/arkts-apis-media-avtranscoder)
Video transcoding management class, first through [createAVTranscoder()](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-media-f#mediacreateavtranscoder12)
Build an AVTranscoder instance, then register the transcoding monitoring event, and finally call the relevant interface to realize the process of "start transcoding - pause transcoding - restore transcoding - transcoding completion".
2. By [AVTranscoder](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-media-avtranscoder)
After transcoding, the output path is usually the path in the application sandbox. After the complete path needs to be stitched (such as files//app package name/output path),
Via [Video](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-media-components-video)
Component to realize video playback, please refer to [How to get the BundleName of the current HAP](https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-package-structure-26) for the name of the application package
### Related Permissions
Not involved
### Dependency
Not involved
### Constraints and restrictions
1.This example only supports running on standard systems and supports devices: Huawei mobile phones.
2.HarmonyOS system: HarmonyOS 5.0.5 Release and above.
3.DevEco Studio version: DevEco Studio 5.0.5 Release and above.
4.HarmonyOS SDK version: HarmonyOS 5.0.5 Release SDK and above.