Opened 3 years ago

Last modified 13 months ago

#9326 new defect

avformat_find_stream_info sometimes gets stuck

Reported by: Jean-Michaël Celerier Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hello,

Under Linux, with a V4L2 device, avformat_find_stream_info gets stuck (tried on ffplay).

Minimal code that fails for me (can be reproduced in ffplay):

auto formatContext = avformat_alloc_context();


avformat_open_input(&formatContext, "/dev/video0", nullptr, nullptr);
avformat_find_stream_info(formatContext, nullptr); < stuck here

(error code checking omitted for clarity).

My video device is a virtual V4L2 device (Droidcam which allows to get a camera feed from an Android tablet or phone to the desktop over the network).

The issue can be tested with the droidcam ArchLinux AUR package. What seems to happen is just that there is no data flowing out of /dev/video0 at all and I guess avformat_find_stream_info is trying to probe some bytes of the stream without a timeout ?

What kind of checks could I add in my client app to make sure that things aren't going to get stuck, sort of running a probe in a separate process and adding a watchdog ?

For instance, guvcview is able to perform operations on the stream without getting stuck, even if there is no input, so likely there *is* a way.

Change History (1)

comment:1 by Balling, 13 months ago

Does this still happen?

Note: See TracTickets for help on using tickets.