Comments (9)
I meet the same problem
from decord.
Try num_threads=1
from decord.
Setting num_threads=1
in VideoReader
resolves the issue for me.
from decord.
Which version of decord, and could you share a corrupted video (ideally a small-sized one)?
Edit: sorry, saw the video link above
from decord.
BTW how to deal with corrupted frames? Raise an error or a warning? Return a black frame?
from decord.
It depends on what the user cares about, e.g. object detection (just warning and skip would be fine), tracking (maybe reuse the previous frame), optical flow (maybe an interpolated frame). I guess it would be better to offer options for users to choose from. Some packages I have tried:
- OpenCV (cv2.VideoCapture): skip without warning in Python, but FFmpeg prints obscure warnings (like the ones above such as
[NULL @ 0x7fde3829b200]
). It is not desired when you care about the frame index to align with annotation. - Pims with PyAV: return a black frame without warning in Python, also warnings from FFmpeg. It affects the detection and tracking performance.
- MoviePy: return the previously available frame without warning.
- AVI-R: option to skip or return previously available frame; option for warning.
from decord.
I tested the video. The pts are all -9223372036854775808, i.e., AV_NOPTS_VALUE. The current (master) logic of decord relies on pts. One improvement of the logic is to use dts when pts is not available.
However, even when replace the null pts with dts, decord still cannot decode this video.
That's what I know by far.
from decord.
@Lijun-Yu corrupted packet can cause more complicated situtations, for example, a single corrupted frame can affect all consequential frame decoding until the next keyframe. Multiple corrupted frame across the entire video can make it completely useless during training.
decord is intended for training models and the best hander for corrupted frame is to throw the error and let user determine by
- catch the DecordError and throw away the entire video
- try catch and locate the corrupted frame range, and only access the valid part of the video(this can be improved by decord by returning valid range maybe?)
Any thoughts?
from decord.
@zhreshold Agreed, corrupted frames should not be used in training. But there can still be situations where people want to decode a corrupted video for inference.
I guess for the VideoReader
, it could be enough to just throw the error and let users decide whether to throw away the video/batch/batch or try to recover it. Locating the corrupted frame range may require decoding the whole video, which does not seem efficient in this direct access context. But it could be better to include documentation stating that errors can be raised in certain conditions.
For the VideoLoader
, it may be better for users to control its behavior by choosing from some options, e.g. skip the batch, skip the video, or try to recover it first and skip if failed. Or the errors raised from its internal loading procedure could cause a mess. Just some initial thoughts.
from decord.
Related Issues (20)
- Inconsistent frame reading behavior with VideoReader
- Get the sample rate of the audio from a video
- Do not using decord, This is a very last lib I saw it claimed surpress opencv but didn't support macOS and python3.9+
- could decord support aarch64? HOT 3
- Support fetching title (and other video-level metadata)
- pip install decord HOT 3
- How do you pad a decord.video_reader.VideoReader Object?
- How to read RGBA video? HOT 1
- Code corrupted silently when import decord before torch HOT 4
- Parallel loading with torch.utils.data.DataLoader HOT 4
- Having issues with VideoReader for certain videos (cannot create buffer source)
- Init VideoReader fast
- pip install decord in linux/arm64 HOT 6
- Extracting H.264 motion vectors HOT 1
- Decord returns file content into console if video reading fails
- is it possible to load only a crop of the video? HOT 1
- Claude Opus - enhancements to video_reader.cc
- issue when using spawn
- Possible mem leak when using queues and consumer thread doesn't keep up with decoding thread. HOT 2
- webm file can not be loaded.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decord.