diff --git a/en/application-dev/media/video-recording.md b/en/application-dev/media/video-recording.md index 6f4d925942b257b2e51d49b717900fa183afebec..d2f5affc31bca6badec8329a918a2aed2e498779 100644 --- a/en/application-dev/media/video-recording.md +++ b/en/application-dev/media/video-recording.md @@ -62,21 +62,7 @@ Read [AVRecorder](../reference/apis/js-apis-media.md#avrecorder9) for the API re > - The recording output URL (URL in **avConfig** in the sample code) must be in the format of fd://xx (where xx indicates a file descriptor). You must call [ohos.file.fs](../reference/apis/js-apis-file-fs.md) to implement access to the application file. For details, see [Application File Access and Management](../file-management/app-file-access.md). ```ts - class AVProfile { - fileFormat: media.ContainerFormatType; - videoBitrate: number; - videoCodec: media.CodecMimeType; - videoFrameWidth: number; - videoFrameHeight: number; - videoFrameRate: number; - } - class AVConfig { - videoSourceType: media.VideoSourceType; - profile: AVProfile; - url: string; - rotation: number; - } - let avProfile: AVProfile = { + let avProfile: media.AVRecorderProfile = { fileFormat: media.ContainerFormatType.CFT_MPEG_4, // Video file encapsulation format. Only MP4 is supported. videoBitrate: 200000, // Video bit rate. videoCodec: media.CodecMimeType.VIDEO_AVC, // Video file encoding format. Both MPEG-4 and AVC are supported. @@ -84,7 +70,7 @@ Read [AVRecorder](../reference/apis/js-apis-media.md#avrecorder9) for the API re videoFrameHeight: 480, // Video frame height. videoFrameRate: 30 // Video frame rate. } - let avConfig: AVConfig = { + let avConfig: media.AVRecorderConfig = { videoSourceType: media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, // Video source type. YUV and ES are supported. profile : avProfile, url: 'fd://35', // Create, read, and write a file by referring to the sample code in Application File Access and Management. @@ -139,24 +125,10 @@ Refer to the sample code below to complete the process of starting, pausing, res import media from '@ohos.multimedia.media' import { BusinessError } from '@ohos.base'; const TAG = 'VideoRecorderDemo:' -class AVProfile { - fileFormat: media.ContainerFormatType; - videoBitrate: number; - videoCodec: media.CodecMimeType; - videoFrameWidth: number; - videoFrameHeight: number; - videoFrameRate: number; -} -class AVConfig { - videoSourceType: media.VideoSourceType; - profile: AVProfile; - url: string; - rotation: number; -} export class VideoRecorderDemo { private avRecorder: media.AVRecorder; private videoOutSurfaceId: string; - private avProfile: AVProfile = { + private avProfile: media.AVRecorderProfile = { fileFormat: media.ContainerFormatType.CFT_MPEG_4, // Video file encapsulation format. Only MP4 is supported. videoBitrate: 100000, // Video bit rate. videoCodec: media.CodecMimeType.VIDEO_AVC, // Video file encoding format. Both MPEG-4 and AVC are supported. @@ -164,7 +136,7 @@ export class VideoRecorderDemo { videoFrameHeight: 480, // Video frame height. videoFrameRate: 30 // Video frame rate. } - private avConfig: AVConfig = { + private avConfig: media.AVRecorderConfig = { videoSourceType: media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, // Video source type. YUV and ES are supported. profile : this.avProfile, url: 'fd://35', // Create, read, and write a file by referring to the sample code in Application File Access and Management.