I have a setup where a local application writes a sequence of JPEG images into a FIFO (Unix named pipe on Linux). On the other end I have ffmpeg
picking up the sequence and passing it into an instance of ffserver
:
% ffmpeg -i fifo.mjpeg http://127.0.0.1:8090/feed.ffm
The configuration for ffserver
looks like this:
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 20
MaxClients 10
MaxBandwidth 1000
<Feed feed.ffm>
File /tmp/feed.ffm
FileMaxSize 200k
ACL allow 127.0.0.1
</Feed>
<Stream stream.mpjpeg>
Format mpjpeg
Feed feed.ffm
VideoSize 960x600
VideoFrameRate 2
VideoIntraOnly
Strict -1
NoAudio
NoDefaults
</Stream>
This works fine, I can point my web browser to http://127.0.0.1:8090/stream.mpjpeg
and see the video.
Now I want to add a way to download a single JPEG (I think of it as snapshot of the video). I added the following to the ffserver
configuration:
<Stream image.jpg>
Format singlejpeg
Feed feed.ffm
VideoSize 960x600
VideoFrameRate 2
VideoIntraOnly
Strict -1
NoAudio
NoDefaults
</Stream>
That only sort of works. Sure, if I point my browser to http://127.0.0.1:8090/image.jpg
I do so a still picture from the video, but the browser never stops loading!
Indeed, if I run wget http://127.0.0.1:8090/image.jpg
I see that the MIME type is good (image/jpeg
), but there seems to be no end to the image.
Am I missing something in my configuration that makes ffserver
sending more than a single image?
I should add I've tried this setup on both 2.8.6 (Debian Jessie, package comes from jessie-backports) and 3.0 (Arch Linux), with the same result in both cases.