Skip to content

VideoReader segmentation fault on long videos with timestamps #2259

@bjuncek

Description

@bjuncek

🐛 Bug

VideoReader segmentation fault on long videos when using video_reader backend.
Notes:

  1. doesn't seem to happen with pyav backend
  2. reading in the entire video, without timestams seems to hang - not sure if this is the function of the video being to long or internal errors

To Reproduce

Steps to reproduce the behavior:

  1. select a video (in this case EPIC Kitchens videos
  2. set the tv.video_backend to video_reader
  3. read a video longer than (in my experience with 24 and 30fps videos) 15s
  4. observe segfault

Example of an ipython testing:

# works with pyav
In [1]: import torchvision as tv
In [2]: video_path = "/EPIC_KITCHENS_2018/062519/videos_24fps/train/P08/P08_21.MP4"
In [3]: video = tv.io.read_video(video_path, 0, 15.5, pts_unit="sec")
# success

# now set a video_reader background to try the same command?
In [4]: tv.set_video_backend("video_reader")
In [5]: video = tv.io.read_video(video_path, 0.5, 15.5, pts_unit="sec")
[F VideoReader.cpp:326] Check failed: numberWrittenBytes == expectedWrittenBytes (2245708800 vs. 18446744071660293120)
[1]    8565 abort (core dumped)  ipython

Expected behavior

Video is successfully read and returned as a tensor object

Environment

PyTorch version: 1.6.0.dev20200522
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: version 3.10.2

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration:
GPU 0: Quadro GP100
GPU 1: Quadro GP100

Nvidia driver version: 418.116.00
cuDNN version: Could not collect

Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.6.0.dev20200522
[pip] torchvision==0.7.0a0+3d65fc6
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.1.243 h6bb024c_0
[conda] mkl 2020.0 166
[conda] mkl-service 2.3.0 py37he904b0f_0
[conda] mkl_fft 1.0.15 py37ha843d7b_0
[conda] mkl_random 1.1.0 py37hd6b4f25_0
[conda] numpy 1.18.1 py37h4f9e942_0
[conda] numpy-base 1.18.1 py37hde5b4d6_1
[conda] pytorch 1.6.0.dev20200522 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch-nightly
[conda] torchvision 0.7.0a0+3d65fc6 pypi_0 pypi

  • How you installed PyTorch / torchvision (conda / source):
  • Build command you used (if compiling from source): python setup.py install

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions