dmlc / dmlc/decord

Resource temporarily unavailable when calling VideoReader or VideoLoader multiple times

Open
#1 23 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
232
PR merge metrics
No merged PRs in 30d

Description

Hi Joshua,

I tried to call VideoReader() or VideoLoader() various times but it crashed in the middle. To reproduce the error, I provide the sample code below:

```python
import decord
for i in range(250):
print(i)
#a = decord.VideoLoader(['/mnt/SSD/Kinetics_trimmed_videos_train_merge/7E60em35UUw.mp4'], shape=(8,340,256,3), interval=8, skip=0,shuffle=3)
a = decord.VideoReader('/mnt/SSD/Kinetics_trimmed_videos_train_merge/7E60em35UUw.mp4')
# a.reset()
```

The program shuts down when i is 230 or 231 with an error message saying:

```bash
Traceback (most recent call last):
File "test_code.py", line 6, in
a = decord.VideoReader('/mnt/SSD/Kinetics_trimmed_videos_train_merge/7E60em35UUw.mp4')
File "/home/yzhao/.local/lib/python3.6/site-packages/decord-0.0.1-py3.6.egg/decord/video_reader.py", line 21, in __init__
uri, ctx.device_type, ctx.device_id, width, height)
File "/home/yzhao/.local/lib/python3.6/site-packages/decord-0.0.1-py3.6.egg/decord/_ffi/_ctypes/function.py", line 175, in __call__
ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
File "/home/yzhao/.local/lib/python3.6/site-packages/decord-0.0.1-py3.6.egg/decord/_ffi/base.py", line 62, in check_call
raise DECORDError(py_str(_LIB.DECORDGetLastError()))
decord._ffi.base.DECORDError: Resource temporarily unavailable
```
For VideoLoader, the error message is similar:
```bash
Traceback (most recent call last):
File "test_code.py", line 4, in
a = decord.VideoLoader(['/mnt/SSD/Kinetics_trimmed_videos_train_merge/7E60em35UUw.mp4'], shape=(8,340,256,3), interval=8, skip=0,shuffle=3)
File "/home/yzhao/.local/lib/python3.6/site-packages/decord-0.0.1-py3.6.egg/decord/video_loader.py", line 24, in __init__
uri, shape[0], shape[1], shape[2], shape[3], interval, skip, shuffle, prefetch)
File "/home/yzhao/.local/lib/python3.6/site-packages/decord-0.0.1-py3.6.egg/decord/_ffi/_ctypes/function.py", line 175, in __call__
ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
File "/home/yzhao/.local/lib/python3.6/site-packages/decord-0.0.1-py3.6.egg/decord/_ffi/base.py", line 62, in check_call
raise DECORDError(py_str(_LIB.DECORDGetLastError()))
decord._ffi.base.DECORDError: Resource temporarily unavailable
```

The environment that I use is also attached for reference
+ Ubuntu 18.04
+ ffmpeg 3.4.6-0ubuntu0.18.04.1

Will appreciate it if you could look into this. Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.