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