Skip to content

Commit d36307f

Browse files
committed
* update video doc
1 parent ab25372 commit d36307f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/doc/en/video/record.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ An example of recording a video in `h265` format.
2020
from maix import video, image, camera, app, time
2121

2222
cam = camera.Camera(640, 480, image.Format.FMT_YVU420SP)
23-
e = video.Encoder()
23+
e = video.Encoder(width=cam.width(), height=cam.height())
2424
f = open('/root/output.h265', 'wb')
2525

26-
record_ms = 2000
26+
record_ms = 5000
2727
start_ms = time.ticks_ms()
2828
while not app.need_exit():
2929
img = cam.read()
@@ -79,7 +79,7 @@ while not app.need_exit():
7979
5. Timed 2s exit
8080

8181
```python
82-
record_ms = 2000
82+
record_ms = 5000
8383
start_ms = time.ticks_ms()
8484
while not app.need_exit():
8585
if time.ticks_ms() - start_ms > record_ms:
@@ -98,12 +98,12 @@ An example of recording a video in `h265` format.
9898
from maix import video, time, image, camera, app
9999

100100
cam = camera.Camera(640, 480, image.Format.FMT_YVU420SP)
101-
e = video.Encoder(capture = True)
101+
e = video.Encoder(width=cam.width(), height=cam.height(), capture = True)
102102
e.bind_camera(cam)
103103

104104
f = open('/root/output.h265', 'wb')
105105

106-
record_ms = 2000
106+
record_ms = 5000
107107
start_ms = time.ticks_ms()
108108
while not app.need_exit():
109109
frame = e.encode()

docs/doc/zh/video/record.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ update:
2020
from maix import video, image, camera, app, time
2121

2222
cam = camera.Camera(640, 480, image.Format.FMT_YVU420SP)
23-
e = video.Encoder()
23+
e = video.Encoder(width=cam.width(), height=cam.height())
2424
f = open('/root/output.h265', 'wb')
2525

26-
record_ms = 2000
26+
record_ms = 5000
2727
start_ms = time.ticks_ms()
2828
while not app.need_exit():
2929
img = cam.read()
@@ -77,10 +77,10 @@ while not app.need_exit():
7777
- `f = open(xxx)`打开并创建一个文件
7878
- `f.write(frame.to_bytes(False))`将编码结果`frame`转换为`bytes`类型,然后调用`f.write()`将数据写入文件中
7979

80-
5. 定时2s退出
80+
5. 定时5s退出
8181

8282
```python
83-
record_ms = 2000
83+
record_ms = 5000
8484
start_ms = time.ticks_ms()
8585
while not app.need_exit():
8686
if time.ticks_ms() - start_ms > record_ms:
@@ -99,12 +99,12 @@ while not app.need_exit():
9999
from maix import video, time, image, camera, app
100100

101101
cam = camera.Camera(640, 480, image.Format.FMT_YVU420SP)
102-
e = video.Encoder(capture = True)
102+
e = video.Encoder(width=cam.width(), height=cam.height(), capture = True)
103103
e.bind_camera(cam)
104104

105105
f = open('/root/output.h265', 'wb')
106106

107-
record_ms = 2000
107+
record_ms = 5000
108108
start_ms = time.ticks_ms()
109109
while not app.need_exit():
110110
frame = e.encode()

0 commit comments

Comments
 (0)