(04-07-2017 07:07 AM)dialog-se Wrote: That's almost exactly how we tried to do it....
It turned out that the whole process from pressing the DSS button to actually seeing the picture would take almost 10 seconds, and most of that was not caused by ffmpeg having to connect to the camera first (also it didn't look nice as the screen would flash multiple times)
Not suggesting this is a proper solution at all, but in our test we solved the delay problem by basically turning the script into a small daemon and leaving it running on the background of our Asterisk box (linux server). Same sort of idea as you had, except it was on a loop to grab a new frame every second or two, resize it and save it to the same file in a tmp ram drive directory over and over. That way the Yealink XML just had to pull in the already generated file which was no slower than loading any other image.
(We actually reduced the overhead even more because the Hikvision camera we were using supported multiple output streams, so we were able to configure a lower resolution one for this specific application, which meant it took almost no processing power to leave our "interpretter script" running all the time).
Native MJPEG support (or at least grabbing and just displaying the first frame of an MJPEG stream) would be much easier of course, but I wouldn't be surprised if there'd still be a delay incurred during stream start up...