From 68e6c9d709063df95710a88041f51870456bb7b7 Mon Sep 17 00:00:00 2001 From: junjiejiangjjj Date: Wed, 1 Feb 2023 19:56:52 +0800 Subject: [PATCH] update readme Signed-off-by: junjiejiangjjj --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a18c015..8e6ae2a 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,17 @@ av ## How it works +```python +from towhee.dc2 import pipe, ops, DataCollection + +p = ( + pipe.input('video_file') + .flat_map('video_file', 'frame', ops.video_decode.ffmpeg(start_time=10.0, end_time=15.0, sample_type='time_step_sample', args={'time_step': 1})) + .output('frame') +) + +DataCollection(p('./video.mp4')).show(limit=1) +``` ```python from towhee import ops