Show two camera feeds on one device

Hi all,

New to flutter, had an idea I want to try to build but I’m not quite sure how complicated it will be. Any tips and ideas for what I can use to accomplish this is much appriciated.

Simply put, what I want is an app that can show me two camera feeds from two different devices, on one of them, with the option to watch a 10 second replay.

  1. Device A is set up and the app shows its camera feed.

  2. Device B is set up and the app sends its camera feed to Device A, so I can see both cameras on Device A. I’m open to suggestions on how they should communicate, either a local wifi network or bluetooth.

  3. I can hit a button on Device A that says “show replay”, which should show a replay of the last 10 seconds from both cameras.

I don’t want the entire session to be saved as a large video file if it can be avoided, it’s only the 10 seconds after I pressed “show replay” that should be saved. Once the replay is finished it starts recording again, giving me a new option to show a new replay of the previous 10 seconds.

I guess I would have to record and save the entire video feed and then “cut out” the last 10 seconds, throw away the rest, show the replay, and then start a new recording? I’m worried it will record for a long time, using a lot of space, if it takes a while before someone presses “show replay”. Or can you “buffer” the video so you can “clip” the last 10 seconds without saving the entire thing?

I’m confused whether you want “the next ten seconds” or “the past ten seconds” when you push this replay button. If the latter, you’ll need to continuously record chunks, and cycle out the older ones when they’d never been needed for replay.

Hi, yes I want the past ten seconds, so yes I need to save the entire thing I assume and cut it once someone presses the button(?). If I record chunks I don’t know how I would handle it if someone presses “Show replay” 2 seconds after a new chunk has started recording?

You can do it with a double buffer. You first record to A, for up to 10 seconds. Then you switch to recording to B for 10 seconds. At any point during recording B, you always have “the previous 10 seconds”, partially from all of B, and the last part of A to make up the final time. Then after you’re done recording B, you switch to overwriting A. See the pattern? You just flip-flop between recording A and recording B, and at any moment the “prior 10 seconds” are always available.