Open DinoMan opened 3 years ago
I compiled from source and the problem went away but it would still be good to get an explanation about why this happened,
conflicting c libs might cause the error, since deadlocks are too difficult to track I can only imagine something goes wrong in python call.
I have the same issue after compiling from source.
I met the same problem
Same, here
I figured out maybe its caused by the video file info not correct. eg, the fps * duration not match the total frame count. But opencv can handle those files. so I read and rewrite those problematic files using OpenCV.
In my current experiments, it seems that SeekAccurate in C++ API hangs somewhere. I'm using a workaround with asyncio, similar to this: https://stackoverflow.com/questions/34452590/timeout-handling-while-using-run-in-executor-and-asyncio.
I set a timeout of 1 s for the seek_accurate python method and than read the next frame:
loop = asyncio.get_event_loop()
for x in range(nframes):
future = loop.run_in_executor(None, dc_vid.seek_accurate, idx[x])
try:
await asyncio.wait_for(future, timeout=1)
except asyncio.TimeoutError:
print(f"Timeout for frame {idx[x]}")
continue
fr = dc_vid.next().asnumpy()
As a result, you may not get all the frames you wanted and it's slower than native get_batch
I have just started trying this library for loading videos and it has all the features I am looking for. Unfortunately, when I run a simple script to read some video the script doesn't exit and hangs. Here is the minimal example I run:
I have checked and it seems to hang on the del function on the _CAPI_VideoReaderFree(self._handle) call.