Need to replay the whole video even after live stream stopped.

I am using google live stream service to stream live video. I need to keep whole streamed video in the cloud storage because audience need to see the whole video even after live stream stopped. But it’s overwriting by new video segments.

please suggest a way to do this

As shown in the documentation, all files and folders in the bucket generated by the Live Stream API are deleted once you stop the channel.

So, in order to keep those files, I would suggest using a Pub/Sub notification when the input stream is stopped, before stopping the channel. To configure the Pub/Sub notification, you could use this documentation.

Then you could use a Cloud Function like this sample to copy your files to another bucket. This Cloud function should be triggered by the previously configured Pub/Sub notification, as shown here.

At the end of the Cloud function, once the files have been copied, you could finally close the channel.

See also:

1 Like

Thanks a lot for your solution. I will try this and give the feed back.