未验证 提交 73fd8f09 编写于 作者: S shuboxu 提交者: Gitee

update en/application-dev/media/video-recording.md.

Signed-off-by: Nshuboxu <xushubo1@huawei.com>
上级 08120c60
...@@ -63,32 +63,32 @@ Read [AVRecorder](../reference/apis/js-apis-media.md#avrecorder9) for the API re ...@@ -63,32 +63,32 @@ Read [AVRecorder](../reference/apis/js-apis-media.md#avrecorder9) for the API re
```ts ```ts
class AVProfile { class AVProfile {
fileFormat: media.ContainerFormatType; fileFormat: media.ContainerFormatType;
videoBitrate: number; videoBitrate: number;
videoCodec: media.CodecMimeType; videoCodec: media.CodecMimeType;
videoFrameWidth: number; videoFrameWidth: number;
videoFrameHeight: number; videoFrameHeight: number;
videoFrameRate: number; videoFrameRate: number;
} }
class AVConfig { class AVConfig {
videoSourceType: media.VideoSourceType; videoSourceType: media.VideoSourceType;
profile: AVProfile; profile: AVProfile;
url: string; url: string;
rotation: number; rotation: number;
} }
let avProfile: AVProfile = { let avProfile: AVProfile = {
fileFormat: media.ContainerFormatType.CFT_MPEG_4, // Video file encapsulation format. Only MP4 is supported. fileFormat: media.ContainerFormatType.CFT_MPEG_4, // Video file encapsulation format. Only MP4 is supported.
videoBitrate : 100000, // Video bit rate. videoBitrate : 100000, // Video bit rate.
videoCodec: media.CodecMimeType.VIDEO_AVC, // Video file encoding format. Both MPEG-4 and AVC are supported. videoCodec: media.CodecMimeType.VIDEO_AVC, // Video file encoding format. Both MPEG-4 and AVC are supported.
videoFrameWidth: 640, // Video frame width. videoFrameWidth: 640, // Video frame width.
videoFrameHeight: 480, // Video frame height. videoFrameHeight: 480, // Video frame height.
videoFrameRate: 30 // Video frame rate. videoFrameRate: 30 // Video frame rate.
} }
let avConfig: AVConfig = { let avConfig: AVConfig = {
videoSourceType: media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, // Video source type. YUV and ES are supported. videoSourceType: media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, // Video source type. YUV and ES are supported.
profile : avProfile, profile : avProfile,
url: 'fd://35', // Create, read, and write a file by referring to the sample code in Application File Access and Management. url: 'fd://35', // Create, read, and write a file by referring to the sample code in Application File Access and Management.
rotation: 0, // Video rotation angle. The default value is 0, indicating that the video is not rotated. The value can be 0, 90, 180, or 270. rotation: 0, // Video rotation angle. The default value is 0, indicating that the video is not rotated. The value can be 0, 90, 180, or 270.
} }
avRecorder.prepare(avConfig).then(() => { avRecorder.prepare(avConfig).then(() => {
console.info('avRecorder prepare success') console.info('avRecorder prepare success')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册