Ticket #2343 (new enhancement)
Stream is blocked by 20 seconds or more when reading an mjpeg stream at low resolutions
|Reported by:||virtuald||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
When opening a network-based mjpeg stream from an AXIS M1011 camera, the stream doesn't actually get opened until 20 or 30 seconds later, and the program blocks waiting for ffmpeg to evaluate the stream parameters (as it freezes in avformat_find_stream_info). I find that I don't notice it with 640x480 30fps streams, but at 320x260 5fps the delay is huge.
How to reproduce:
% ffmpeg -i http://192.168.0.10/mjpg/video.mjpg
The problem shows up on version 1.1.3 on Windows (32-bit) and Linux (64-bit).
It also shows up on the version installed on my Ubuntu box by default, 0.8.5-6:0.8.5-0ubuntu0.12.10.1.
Note that in the logfile I attached, it hangs right before the line "[mjpeg @ 0x1016500] max_analyze_duration 5000000 reached at 5000000" for about 25 seconds or so. And yes, it ends in an error saying that there is no output file, but an output file isn't necessary to illustrate the issue. The point is that it hangs. :)
I originally found this issue when using OpenCV, but the ffmpeg executable has the same problem. I was able to remove the delay in OpenCV by setting max_analyze_duration to 50000 on the context. However, it seems like the default setting should just work.
comment:1 in reply to: ↑ description ; follow-up: ↓ 3 Changed 2 months ago by cehoyos
- Priority changed from normal to wish
- Type changed from defect to enhancement
- Version changed from 1.1.3 to git-master
- Component changed from undetermined to avformat