Skip to content

FFmpegVideoReader hangs #647

@smartnet-club

Description

@smartnet-club

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions