FFmpegVideoReader can hang on some videos. Although videos can be played by any videopleer and listed in fiftyone app.
Investigation:
Running process
ffmpeg -loglevel error -vsync 0 -i video.mp4 -vsync 0 -f image2pipe -vcodec rawvideo -pix_fmt rgb24 -
produces many messages like
[image2pipe @ 0x5bf4845fdf40] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 13 >= 13
Method FFmpeg::read reads only stdout self._p.stdout.read(num_bytes)
after some time the stderr stream overflows and stdout.read hangs
Possible solution:
make stdout and stderr nonblocking (fcntl.fcntl(self._p.stdout.fileno(), fcntl.F_SETFL, os.O_NONBLOCK))
and read all available data from both streams:
self._p.stdout.read1(bytes)
self._p.stderr.read1(bytes)
FFmpegVideoReader can hang on some videos. Although videos can be played by any videopleer and listed in fiftyone app.
Investigation:
Running process
ffmpeg -loglevel error -vsync 0 -i video.mp4 -vsync 0 -f image2pipe -vcodec rawvideo -pix_fmt rgb24 -produces many messages like
[image2pipe @ 0x5bf4845fdf40] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 13 >= 13Method
FFmpeg::readreads only stdoutself._p.stdout.read(num_bytes)after some time the stderr stream overflows and stdout.read hangs
Possible solution:
make stdout and stderr nonblocking (
fcntl.fcntl(self._p.stdout.fileno(), fcntl.F_SETFL, os.O_NONBLOCK))and read all available data from both streams:
self._p.stdout.read1(bytes)self._p.stderr.read1(bytes)