3
2
Is it possible to append one jpeg frame (or a small number of frames) to a video while retaining good image quality and compression? I have a script that downloads a jpeg image from a webcam every 30 seconds. I can build a video out of these frames using ffmpeg or mencoder, e.g.:
ffmpeg -f image2 -i %d.jpg out.swf
I'd like to keep this video up to date as new frames come in, but don't want to keep the computer busy re-encoding the entire video so frequently. I also worry about ffmpeg/mencoder doing something intelligent with only a single frame of new data - e.g. will it try to make each new frame a keyframe (making the video unnecessarily large)?
Any insight on how to do this sensibly would be greatly appreciated.
1I wanted to build the video one frame (or a few frames) at a time as a way to keep the video up to date without constantly swamping the CPU. This project may expand to include several video feeds, so I wanted to keep efficiency in mind. The video is being used for cloud monitoring at an astronomical observatory, which is why I wanted to keep it as up to date as possible. Most likely, I'll compromise by making two videos - a frequently updated one with just the last 30 minutes of data, and a less frequently updated one with the last 24 hours. I was just curious if frame-at-a-time was possible. – Kevin Ivarsen – 2009-12-28T17:44:26.683
You can run a script to combine the last 300 JPEG images into a 30 second FLV video (at 10 frames per second) every 15 minutes. You can also write a Flash SWF file that will play all the movies from a given hour or day, in sequence, so that to the viewer it looks like a single movie. No swamping. If you want to be fancy, write a script that combines all the movies from a given day into a single longer movie once very 24 hours at a low-traffic time like 2:00 am. – CarlF – 2009-12-29T06:59:10.713