自2020年10月1日以来,Youtube liveStreams插入出现错误

问题描述

自10月1日起,我们在创建liveStreams插入时出错了…广播创建得很好,但是当到达liveStreams时出现此错误

"{\n  \"error\": {\n    \"code\": 500,\n    \"message\": \"Internal error encountered.\",\n    \"errors\": [\n      {\n        \"message\": \"Internal error encountered.\",\n        \"domain\": \"global\",\n        \"reason\": \"backendError\"\n      }\n    ],\n    \"status\": \"INTERNAL\"\n  }\n}\n""

我们的代码代码

        $streamSnippet = new Google_Service_YouTube_LiveStreamSnippet();
        $streamSnippet->setTitle('New Stream');

        // Create an object for content distribution network details for the live
        // stream and specify the stream's format and ingestion type.
        $cdn = new Google_Service_YouTube_CdnSettings();
        $cdn->setFormat("720p"); //1080p
        $cdn->setIngestionType('rtmp');

        // Create the API request that inserts the liveStream resource.
        $streamInsert = new Google_Service_YouTube_LiveStream();
        $streamInsert->setSnippet($streamSnippet);
        $streamInsert->setCdn($cdn);
        $streamInsert->setKind('youtube#liveStream');

        // Execute the request and return an object that contains information
        // about the new stream.
        $streamsResponse = $youtube->liveStreams->insert('snippet,cdn',$streamInsert,array());

我们的PHP Lib版本是'dev-master'版本。我也尝试使用像2.4.0这样的旧版本,什么也没有...同样的错误

有任何想法的Google团队或任何人吗?

解决方法

发现了问题。

$cdn->setFormat("720p");

不再受支持。

更改为:

$cdn->setFrameRate("30fps");
$cdn->setResolution("720p");

工作了。