facebookresearch / pytorchvideo

A deep learning library for video understanding research.
https://pytorchvideo.org/
Apache License 2.0
3.28k stars 406 forks source link

error when using EncodedVideo to read videos #151

Closed sunguwei closed 2 years ago

sunguwei commented 2 years ago

using the following code to read the video data

video = EncodedVideo.from_path(filename)
video_data = video.get_clip(start_sec=start_sec, end_sec=end_sec)

and the following errors happened.

Original Traceback (most recent call last): File "/home/sunwei/.conda/envs/pytorchvideo/lib/python3.8/site-packages/pytorchvideo/data/encoded_video_pyav.py", line 40, in init self._container = av.open(file) File "av/container/core.pyx", line 355, in av.container.core.open File "av/container/input.pyx", line 68, in av.container.input.InputContainer.cinit File "av/stream.pyx", line 50, in av.stream.wrap_stream File "av/stream.pyx", line 83, in av.stream.Stream._init File "av/utils.pyx", line 26, in av.utils.avdict_to_dict File "av/utils.pyx", line 14, in av.utils._decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8e in position 21: invalid start byte

kalyanvasudev commented 2 years ago

It might be that the particular video you are trying out on is corrupted.

Could you try another backed in EncodedVideo? like, video = EncodedVideo.from_path(filename, decoder='torchvision')

Please re-open the issue if the problem persists.