Saving individual frames of mjpeg stream
Question
I was wondering what needed to be done to save each frame of the stream. The reason I want to do this is because I'm trying to create a python program that can view the webcam stream. The problem is anything I attempt to use (whether that be wget, a web browser, or any HTTP based library for python) downloads the stream infinitely and it appears to save it as a video file, not an image. This makes it very difficult and CPU taxing to display the video in a program that isn't a media player.
Also, lets say I use wget to download the stream. If I tell something like VLC to open the file, it only plays about a half second of the file, no matter how large it is. So even as a partially saved video, it doesn't function properly.
Clearly my knowledge of how this is done is limiting, so can you give me any pointers? I get the impression that other webcam streams don't work the same way, because I've seen python scripts that download each frame as an individual jpeg image, which clearly this does not do.
Environment
Motion version: |
3.2.12 |
ffmpeg version: |
|
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
Debian Wheezy |
--
PeterSchmidt - 01 May 2012
Answer