Open mungewell opened 8 years ago
Had a little more of a think about this over my lunch hour; KAPP9.PDF
Problem with RaspPi (running pygameLiveView) is primarily that the 'receive' is held up by the 'decode/display' resulting in an ever increasing queue of frames in the pipe. There is also the issue of delay in TCP/IP pipeline, but that should be comparatively small. We could compare rolling average fps (last 'x' frames) for 'capture' vs 'display', and skip if we're ever slower. This probably wouldn't recover any lag after it had been introduced.
Seems to be working now... https://www.youtube.com/edit?o=U&video_id=xR3gAfu4Hfw
man you need to learn how to put links on the interwebs :D
your youtube link links to some 404 github url and the link's text is the non-public url to the video. it should read instead https://www.youtube.com/watch?v=xR3gAfu4Hfw
also on your youtube video the links back to your forked repo is cut off and is another github 404. https://github.com/mungewell/sony_camera_api would be the right one.
link issues aside i'm glad you've managed to get a smooth live stream working as i'm working on something similar :)
I am seeing a problem when running on a slow computer (namely a Raspberry Pi), it seems that the image decode is not faster enough and at some point lags so far behind that the camera gives up - closing the connection and leaving the app hanging.
Looking at profiling the code it seems that there is just 1 call to liburl2 which returns a pointer to a 'never ending bowl' from which we read the image frames from in turn.
There is a time stamp in the common header, and mention in the API that:
I think this is the solution, but can't quite understand (it's late night here :-) how to evaluate the frame rate/time stamp to decide we're running too far behind. The solution will probably fit here: