when using cv::VideoCapture to read video from the disk, what does exactly happens?
If the second option is the answer, is it possible to do it in the first way?
To accomplish this in Python on Linux, I simply made a copy of the input file to /dev/shm, which is a RAM-backed filesystem.
tempdir = tempfile.TemporaryDirectory(dir='/dev/shm')
copypath = os.path.join(tempdir.name, os.path.basename(args.video))
shutil.copy(args.video, copypath)
args.video = copypath
Of course there is the cost of the copy operation as well but it shouldn't be much more than simply reading the entire file (since there is no slow disk that's being written to on the other side of the copy).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With