|
|
@ -23,10 +23,15 @@ Args: |
|
|
|
- sample_type: str |
|
|
|
|
|
|
|
uniform_temporal_subsample |
|
|
|
time_step_sample |
|
|
|
|
|
|
|
- args: dict |
|
|
|
|
|
|
|
sample_type is `uniform_temporal_subsample` |
|
|
|
num_samples: int |
|
|
|
|
|
|
|
sample_type is `time_step_sample` |
|
|
|
time_step: int |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
@ -41,7 +46,7 @@ Args: |
|
|
|
|
|
|
|
Returns: |
|
|
|
|
|
|
|
- Image |
|
|
|
- towhee.types.VideoImage |
|
|
|
|
|
|
|
## Requirements |
|
|
|
av |
|
|
@ -56,18 +61,37 @@ d = ops.video_decode.ffmpeg(start_time=10.0, end_time=20.0, sample_type='uniform |
|
|
|
for frame in d(video_path): |
|
|
|
print(frame) |
|
|
|
|
|
|
|
print('#' * 50) |
|
|
|
|
|
|
|
d = ops.video_decode.ffmpeg(start_time=10.0, end_time=20.0, sample_type='time_step_sample', args={'time_step': 1}) |
|
|
|
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) |
|
|
|
``` |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 10010, key_frame: 1 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 11078, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 12145, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 13280, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 14348, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 15482, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 16550, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 17684, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 18752, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 19887, key_frame: 0 |
|
|
|
################################################## |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 10010, key_frame: 1 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 11011, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 12012, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 13013, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 14014, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 15015, key_frame: 1 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 16015, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 17017, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 18018, key_frame: 0 |
|
|
|
VideoFrame shape: (360, 480, 3), mode: RGB, timestamp: 19019, key_frame: 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Reference |
|
|
|
|
|
|
|