Processing Larger Files #1089
-
My code works fine on smaller files; however, I have an issue when working with files above 900MB. Is there a way to work with larger files?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @Adam-Arrayen 👋 I've managed to reproduce a similar issue.
Can you try setting the env variable it suggests to a higher value? For example, I've had success with: # Scope the env var to a single command
OPENCV_FFMPEG_READ_ATTEMPTS=16384 python main.py If you're in a Colab environment, the process is different, but let me know and I can help out ;) |
Beta Was this translation helpful? Give feedback.
-
That's an environmental variable. Typically they're set outside the Python script. A few examples, but I recommend option 3:
OPENCV_FFMPEG_READ_ATTEMPTS=16384
python your_python_script_with_supervision.py
OPENCV_FFMPEG_READ_ATTEMPTS=16384 python your_python_script_with_supervision.py
Create a file that's just called OPENCV_FFMPEG_READ_ATTEMPTS=16384 (other env variables would be in seperate lines, no need for any commas at the end or anything) Then, when you have an env file, you need to load it in python. from dotenv import load_dotenv
load_dotenv() This should make OpenCV see it, and it should work in both scripts and Jupyter notebooks.
Update: Tested in Colab, and it seems that at least some notebooks have a simpler way:
|
Beta Was this translation helpful? Give feedback.
That's an environmental variable. Typically they're set outside the Python script. A few examples, but I recommend option 3:
.env
files.Create a file that's just called
.env
, inside it only write:(other env variables would be in seperate lines, no need for any commas at the end or anything)
Then, when you have an env file, you need to load it in python.
pip install python-dotenv