decord icon indicating copy to clipboard operation
decord copied to clipboard

Can decord provide random access to video frames in an URL?

Open MalteEbner opened this issue 3 years ago • 0 comments

Use case:

I have a video stored in the web and the URL to it. Now I want to download specific frames of it (e.g. the 10th and 100th). Can I access these frames using decord without needing to download the full video?

Example URL: example

Benchmark code

# creating the video reader takes 30s to download the 100MB video
vr = decord.VideoReader("https://mediandr-a.akamaihd.net/progressive/2018/0912/TV-20180912-1628-0000.ln.mp4")
# The access itself is super fast
for timestamp in range(0,1000,100):
    frame = vr[timestamp]

I rather want the video reader to be created instantly, even if the access itself takes longer as it hast to download the individual frames.

MalteEbner avatar Jan 28 '22 09:01 MalteEbner