logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

Updated 3 years ago

video-decode

Operator: video-decoder

Author: JunJie Jiang

Overview

Interface

__init__(self, start_time=None, end_time=None, sample_type=None, args=None)

Args:

  • start_time: float

  • end_time: float decode video [start_time, end_time)

    sample_type: uniform_temporal_subsample args: num_samples: int

__call__(self, video_path: str)

Args:

  • video_path: support local path and http/https url.

Returns:

  • Image

Requirements

av

How it works

from towhee import ops

d = ops.video_decode.ffmpeg(start_time=10.0, end_time=20.0, sample_type='uniform_temporal_subsample', args={'num_samples': 10})
for frame in d(video_path):
    print(frame)

result:
Outputs(image=<towhee.types.image.Image object at 0x7fa444776310>, TIMESTAMP=10010)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776700>, TIMESTAMP=11078)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776310>, TIMESTAMP=12145)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776700>, TIMESTAMP=13280)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776310>, TIMESTAMP=14348)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776700>, TIMESTAMP=15482)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776310>, TIMESTAMP=16550)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776700>, TIMESTAMP=17684)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776310>, TIMESTAMP=18752)
Outputs(image=<towhee.types.image.Image object at 0x7fa444776700>, TIMESTAMP=19887)

Reference

video-decode da9085e29d update 5 Commits
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 3 years ago
file-icon README.md
1.6 KiB
download-icon
update 3 years ago
file-icon __init__.py
180 B
download-icon
update 3 years ago
file-icon requirements.txt
3 B
download-icon
update 3 years ago
file-icon video_decoder.py
4.8 KiB
download-icon
update 3 years ago
file-icon video_decoder.yaml
150 B
download-icon
update 3 years ago