-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
63 lines (42 loc) · 2.04 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: VideoEncoder
slug: Web/API/VideoEncoder
page-type: web-api-interface
browser-compat: api.VideoEncoder
---
{{APIRef("WebCodecs API")}}{{SecureContext_Header}}{{AvailableInWorkers("window_and_dedicated")}}
The **`VideoEncoder`** interface of the {{domxref('WebCodecs API', '', '', 1)}} encodes {{domxref("VideoFrame")}} objects into {{domxref("EncodedVideoChunk")}}s.
{{InheritanceDiagram}}
## Constructor
- {{domxref("VideoEncoder.VideoEncoder", "VideoEncoder()")}}
- : Creates a new `VideoEncoder` object.
## Instance properties
_Inherits properties from its parent, {{DOMxRef("EventTarget")}}._
- {{domxref("VideoEncoder.encodeQueueSize")}} {{ReadOnlyInline}}
- : An integer representing the number of encode queue requests.
- {{domxref("VideoEncoder.state")}} {{ReadOnlyInline}}
- : Represents the state of the underlying codec and whether it is configured for encoding.
### Events
- {{domxref("VideoEncoder.dequeue_event", "dequeue")}}
- : Fires to signal a decrease in {{domxref("VideoEncoder.encodeQueueSize")}}.
## Static methods
- {{domxref("VideoEncoder.isConfigSupported_static", "VideoEncoder.isConfigSupported()")}}
- : Returns a promise indicating whether the provided `VideoEncoderConfig` is supported.
## Instance methods
_Inherits methods from its parent, {{DOMxRef("EventTarget")}}._
- {{domxref("VideoEncoder.configure()")}}
- : Asynchronously prepares the encoder to accept video frames for encoding with the specified parameters.
- {{domxref("VideoEncoder.encode()")}}
- : Asynchronously encodes a {{domxref("VideoFrame")}}.
- {{domxref("VideoEncoder.flush()")}}
- : Returns a promise that resolves once all pending encodes have been completed.
- {{domxref("VideoEncoder.reset()")}}
- : Cancels all pending encodes and callbacks.
- {{domxref("VideoEncoder.close()")}}
- : Ends all pending work and releases system resources.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
[Video processing with WebCodecs](https://developer.chrome.com/docs/web-platform/best-practices/webcodecs)