Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFmpegVideoReader hangs #647

Open
smartnet-club opened this issue Jan 23, 2025 · 0 comments
Open

FFmpegVideoReader hangs #647

smartnet-club opened this issue Jan 23, 2025 · 0 comments

Comments

@smartnet-club
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant