Giter Site home page Giter Site logo

Comments (9)

THUSIGSICLAB avatar THUSIGSICLAB commented on August 25, 2024 6

I meet the same problem

from decord.

prismformore avatar prismformore commented on August 25, 2024 2

Try num_threads=1

from decord.

btekin avatar btekin commented on August 25, 2024 2

Setting num_threads=1 in VideoReader resolves the issue for me.

from decord.

innerlee avatar innerlee commented on August 25, 2024

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.

innerlee avatar innerlee commented on August 25, 2024

BTW how to deal with corrupted frames? Raise an error or a warning? Return a black frame?

from decord.

Lijun-Yu avatar Lijun-Yu commented on August 25, 2024

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.

innerlee avatar innerlee commented on August 25, 2024

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.

zhreshold avatar zhreshold commented on August 25, 2024

@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.

Lijun-Yu avatar Lijun-Yu commented on August 25, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.