open-mmlab / mmcv

OpenMMLab Computer Vision Foundation
https://mmcv.readthedocs.io/en/latest/
Apache License 2.0
5.91k stars 1.65k forks source link

[Bug] mmcv.VideoReader needs to provide an async API to handle large videos #3010

Open yurivict opened 10 months ago

yurivict commented 10 months ago

Prerequisite

Environment

When the video is large - it makes no sense to read the whole video into memory like video = mmcv.VideoReader(video_file) does. It quickly runs out of memory.

mmcv.VideoReader should provide an async API instead.

In C++ this would look something like this:

mmcv::VideoReader(video_file, [](const VideoFrame &frame) {
    // process the frame
});

Reproduces the problem - code sample

n/a

Reproduces the problem - command or script

n/a

Reproduces the problem - error message

n/a

Additional information

n/a

zhouzaida commented 10 months ago

Hi @yurivict , thanks for your feedback. This is a good proposal but we have no time to support it recently.