diff --git a/README.en.md b/README.en.md index 5a7d9907eea724015341a7c2db72bc43b05a0d87..5231f2e57cb3d88cbbd98ab10d6d05b9e6d0a430 100644 --- a/README.en.md +++ b/README.en.md @@ -1,66 +1,57 @@ -## Use AVTranscoder to realize video transcoding (ArkTS) +## Use AVTranscoder to Transcode Videos (ArkTS) -### Introduce +### Overview -This example will explain the functions of AVTranscoder video transcoding to developers in a process -of "Start Transcoding-Pause Transcoding-Restore Transcoding-Transcoding Complete". +This sample demonstrates how to use the AVTranscoder to implement video transcoding, covering the process of starting, pausing, resuming, and exiting transcoding. -### Effect Preview +### 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. +How to use: +1. Open the application. The home page allows users to select the parameter configurations required for video transcoding. Then, tap Start Transcoding to navigate to the video transcoding page. +2. On the video transcoding page, users can view the transcoding progress. Tapping Pause suspends the process, while tapping Resume resumes the transcoding. Selecting Cancel opens a confirmation popup to cancel the transcoding. Once complete, tapping Finish redirects the user to the transcoding completion page. +3. On the transcoding completion page, users can view the video after transcoding. Tapping Home Page takes them back to the home page. -### Engineering Catalogue +### Project Directory ``` ├──ets │ ├──entryability │ │ └──EntryAbility.ets │ ├──pages -│ │ ├──index .ets // Home page -│ │ ├──TranscoderFinishPage.ets // Video transcoding completion page -│ │ └──VideoTranscoderPage.ets // Video transcoding progress page +│ │ ├──index .ets // Home page. +│ │ ├──TranscoderFinishPage.ets // Video transcoding completion page. +│ │ └──VideoTranscoderPage.ets // Video transcoding progress page. │ └──utils -│ └──AVTranscoderManager.ets // Video transcoding management +│ └──AVTranscoderManager.ets // Video transcoding management class. └──resources └──rawfile - └──video_sample.mp4 // Transcoding video + └──video_sample.mp4 // Transcoded video. ``` -### Concrete realization +### How to Implement -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 +1. Use the [AVTranscoder](https://developer.huawei.com/consumer/en/doc/harmonyos-guides/media-kit-intro#avtranscoder) video transcoding management class to first create an instance via createAVTranscoder(). Then, register transcoding event listeners, and finally call relevant APIs to complete the process of starting, pausing, resuming, and exiting transcoding. +2. After the [AVTranscoder](https://developer.huawei.com/consumer/en/doc/harmonyos-guides/media-kit-intro#avtranscoder) is used for transcoding, the output path is usually the sandbox path of the application. You need to concatenate the full path (e.g., files// Application bundle name/Output directory) before using the [Video](https://developer.huawei.com/consumer/en/doc/harmonyos-references/ts-media-components-video) component to play the video. For information on obtaining the application bundle name, see [How do I obtain the bundle name of the current HAP?](https://developer.huawei.com/consumer/en/doc/harmonyos-faqs/faqs-package-structure-26) -### Related Permissions +### Required Permissions -Not involved +N/A -### Dependency +### Dependencies -Not involved +N/A -### Constraints and restrictions +### Constraints -1.This example only supports running on standard systems and supports devices: Huawei mobile phones. +1.This sample is only supported on Huawei phones running standard systems. -2.HarmonyOS system: HarmonyOS 5.0.5 Release and above. +2.The HarmonyOS version must be HarmonyOS 5.0.5 Release or later. -3.DevEco Studio version: DevEco Studio 5.0.5 Release and above. +3.The DevEco Studio version must be DevEco Studio 5.0.5 Release or later. -4.HarmonyOS SDK version: HarmonyOS 5.0.5 Release SDK and above. +4.The HarmonyOS SDK version must be HarmonyOS 5.0.5 Release SDK or later. diff --git a/README.md b/README.md index 397c00576818db43f8f6efc523f243fa37da31ff..96a0da6e1e2529cc05ccf04ba829a5b546f38b2f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ ### 具体实现 1. 使用[AVTranscoder](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-media-avtranscoder) -视频转码管理类,先通过[createAVTranscoder()](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-media-f#mediacreateavtranscoder12) +视频转码管理类,先通过createAVTranscoder() 构建一个AVTranscoder实例,然后注册转码监听事件,最后调用相关接口实现“开始转码-暂停转码-恢复转码-转码完成”的流程。 2. 通过[AVTranscoder](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-media-avtranscoder) 转码后,输出路径通常为应用沙箱内的路径,需要拼接出完整路径(如:files//应用包名/输出路径)后,