1

我正在尝试使用此处描述的 Google Transcoder API 裁剪视频:https ://cloud.google.com/transcoder/docs/how-to/crop-videos

转码成功运行,但没有发生裁剪,并且转码作业详细信息实际上缺少裁剪请求。

我正在使用 npm @google-cloud/video-transcoder 1.5.0 版

这是 json 请求:

{
    "parent": "projects/.../locations/us-central1",
    "job": {
        "config": {
            "pubsubDestination": {
                "topic": "projects/.../topics/..."
            },
            "elementaryStreams": [
                {
                    "key": "video-stream0",
                    "videoStream": {
                        "frameRate": 30,
                        "widthPixels": 480,
                        "codec": "h264",
                        "heightPixels": 270,
                        "bitrateBps": 150000,
                        "preset": "slower"
                    }
                },
                {
                    "key": "audio-stream0",
                    "audioStream": {
                        "codec": "aac",
                        "bitrateBps": 2000
                    }
                }
            ],
            "muxStreams": [
                {
                    "key": "g7FNokXVOuyCgw767Oz7",
                    "container": "mp4",
                    "fileName": "g7FNokXVOuyCgw767Oz7",
                    "elementaryStreams": [
                        "video-stream0",
                        "audio-stream0"
                    ]
                }
            ],
            "inputs": [
                {
                    "uri": "gs://.../g7FNokXVOuyCgw767Oz7.165.165",
                    "preprocessingConfig": {
                        "crop": {
                            "topPixels": 100
                        }
                    },
                    "key": "input0"
                }
            ],
            "output": {
                "uri": "gs://.../"
            }
        }
    }
}

当我检查工作时,我看到的是,庄稼不见了:

{
  "config": {
    "editList": [
      {
        "inputs": [
          "input0"
        ],
        "key": "atom0",
        "startTimeOffset": "0s"
      }
    ],
    "elementaryStreams": [
      {
        "key": "video-stream0",
        "videoStream": {
          "bitrateBps": 150000,
          "codec": "h264",
          "crfLevel": 21,
          "entropyCoder": "cabac",
          "frameRate": 30.0,
          "gopDuration": "3s",
          "heightPixels": 270,
          "pixelFormat": "yuv420p",
          "preset": "slower",
          "profile": "high",
          "rateControlMode": "vbr",
          "vbvFullnessBits": 135000,
          "vbvSizeBits": 150000,
          "widthPixels": 480
        }
      },
      {
        "audioStream": {
          "bitrateBps": 2000,
          "channelCount": 2,
          "channelLayout": [
            "fl",
            "fr"
          ],
          "codec": "aac",
          "sampleRateHertz": 48000
        },
        "key": "audio-stream0"
      }
    ],
    "inputs": [
      {
        "key": "input0",
        "preprocessingConfig": {
          "audio": {},
          "color": {},
          "crop": {},
          "deblock": {},
          "denoise": {
            "tune": "standard"
          },
          "pad": {}
        },
        "uri": "gs://.../g7FNokXVOuyCgw767Oz7.165.165"
      }
    ],
    "muxStreams": [
      {
        "container": "mp4",
        "elementaryStreams": [
          "video-stream0",
          "audio-stream0"
        ],
        "fileName": "g7FNokXVOuyCgw767Oz7",
        "key": "g7FNokXVOuyCgw767Oz7"
      }
    ],
    "output": {
      "uri": "gs://.../"
    },
    "pubsubDestination": {
      "topic": "projects/.../topics/..."
    }
  },
  "createTime": "2021-07-27T03:23:46.089Z",
  "endTime": "2021-07-27T03:23:59.534Z",
  "name": "projects/372477578623/locations/us-central1/jobs/220420ff5a110eaa92c66d00d1f33df6",
  "startTime": "2021-07-27T03:23:52.106Z",
  "state": "SUCCEEDED",
  "ttlAfterCompletionDays": 30
}

有人在使用 Google Cloud Transcoder API 裁剪视频方面有运气吗?

[如果谷歌开发者看到这篇文章,工作名称就在片段中。]

4

1 回答 1

0

我安装了 NodeJS 模块并尝试使用相同的配置运行作业,并且可以确认这可以重现。

问题可能是客户端库的 v1beta1 原型自最初创建以来尚未同步。

我们已经创建了一个修复并部署到 prod。它现在应该可以工作了。

于 2021-08-23T19:31:39.267 回答