Corrupted videos

I’m having problem reading some videos to frames (I’m using 64x64 resolution).

For example ‘vivrQrGGhM.mp4’ is corrupted and skvideo.io gives error. I tried other libs like imageio - even though it can open, it’s really slow and gives error on 27 frame…

I tried downloading from direct link and from torrent - all the same.

Anyone having the same issue?

My bad, I see that in provided generators there are also list for bad videos.

Hello there,

sk-video.vread throws an exception when reading corrupted video such as ‘vivrQrGGhM.mp4’. Any ideas how to fix it?

Exception in thread Thread-15:
Traceback (most recent call last):
File “/home/user/anaconda3/lib/python3.5/site-packages/skvideo/io/ffmpeg.py”, line 267, in _read_frame_data
assert len(arr) == framesize
AssertionError

Many thanks,
T

I had the same problem and figured out how to fix.
We can just catch RuntimeError which is actually thrown out after AssertionError.

primatrix_dataset_utils.py

    def _get_video_batch(self, x_paths, as_grey=True, reduce_frames=True, verbose=False):
            ...
            ...
            # load
            try:
                video = skv.vread(filepath, as_grey=as_grey)
            except RuntimeError:
                failed.append(obf_id)
                continue

Yeah, thanks mate, that worked out for me too!