50
« on: March 31, 2009, 07:59:31 am »
I have also been looking into this (among other Motion Wrapper and IP camera improvements). I think sticking with MJPEG would be the way to go initially, as it is very easy to decode in software and its supported by many cameras. I think we can make another command, Get_Video_Stream (a compliment to Get_Video_Frame). The implementation of Get_Video_Stream on a device level will intercept the MJPEG stream from the camera, strip its boundary markers (as there really isn't a tight standard and it is implemented differently from manufacturer to manufacturer), and resend them out with a standardized boundary marker. Then, as Thom suggested, in Orbiter we can either extend the Broadcast Video deisgnobj, or even make a separate MJPEG designobj. Then to make it work across the various platforms (pseudo code)-- if(implements_get_video_stream && is_onscreen_orbiter) { use_get_video_stream } else { use_get_video_frame } (this would mean that any device that implements get_video_stream would also have to implement get_video_frame to provide this compatibility)
I already have a working MJPEG decoder in Ruby for one of my IP cams as my camera didn't have a "snapshot" to static jpg functionality, so I parse the MJPEG stream in real time to construct a jpg image which is returned via Get_Video_Frame. Works quite well too
On a side note, if we provide such an implementation, motion wrapper could be used directly to serve the MJPEG stream