简体   繁体   English

谷歌云 - 文件 pipe

[英]Google cloud - file pipe

I have a system that is able to produce a custom video (based on input text) faster than real-time.我有一个能够比实时更快地生成自定义视频(基于输入文本)的系统。

I would like to create an HTTP endpoint: /create_video?description=dog riding a horse that, as part of the response, returns the URL to the produced video.我想创建一个 HTTP 端点: /create_video?description=dog riding a horse作为响应的一部分,将 URL 返回到制作的视频。

Video can be quite long, and its generation can take some time.视频可能很长,其生成可能需要一些时间。 Rather than waiting for it to complete, I would like to return the response as soon as first frames are available, such that the user can watch instantly using the provided URL (we generate faster than real-time, so there will be no buffering).我不想等待它完成,而是希望在第一帧可用时立即返回响应,以便用户可以使用提供的 URL 立即观看(我们生成的速度比实时生成的速度快,因此不会有缓冲) . The URL must point to generate video indefinitely (even months after generation). URL 必须指向无限期地生成视频(甚至生成后数月)。

I am using Google Cloud.我正在使用谷歌云。 What would be the recommended way to do that?推荐的方法是什么?

I could create a custom endpoint that serves the videos, and has the described properties, but maybe something as simple as Cloud Storage could work (I was not able to get it to read while writing was not finalized though)?我可以创建一个自定义端点来为视频提供服务,并具有所描述的属性,但也许像 Cloud Storage 这样简单的东西可以工作(虽然写入尚未完成,但我无法读取它)?

As per @Piotr Dabkowski, after doing some extra research it seems to not be that easy.根据@Piotr Dabkowski 的说法,在做了一些额外的研究之后,它似乎并不那么容易。 My best idea is to implement a custom endpoint that streams the result, while the file is being generated using temporary array entry in DB.我最好的想法是实现一个自定义端点来流式传输结果,同时使用数据库中的临时数组条目生成文件。 Once the file is fully generated (db entry will be empty and point to cloud storage location), redirects to cloud storage.文件完全生成后(数据库条目将为空并指向云存储位置),重定向到云存储。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM