我使用具有以下配置的 GCP Transcoder API:
节点JS 12
Firebase 存储
Firestore 数据库
GCP CDN
上传作业开始(firebase 功能)
const config = { "elementaryStreams": [ { "videoStream": { "codec": "h264", "tune": 'zerolatency', "preset": 'superfast', "heightPixels": 360, "widthPixels": 640, "bitrateBps": 400000, "rateControlMode": "vbr", "frameRate": 30, "crfLevel": 26, "gopMode": { "gopDuration": "1.0s", } }, "key": "video-stream0" }, { "videoStream": { "codec": "h264", "tune": 'zerolatency', "preset": 'superfast', "heightPixels": 480, "widthPixels": 854, "bitrateBps": 1500000, "rateControlMode": "vbr", "frameRate": 60, "crfLevel": 26, "gopMode": { "gopDuration": "1.0s", } }, "key": "video-stream1" }, { "videoStream": { "codec": "h264", "tune": 'zerolatency', "preset": 'superfast', "heightPixels": 720, "widthPixels": 1280, "bitrateBps": 3000000, "rateControlMode": "vbr", "frameRate": 60, "crfLevel": 26, "gopMode": { "gopDuration": "1.0s", } }, "key": "video-stream2" }, { "key": "audio-stream0", "audioStream": { "codec": "aac", "bitrateBps": 128000, "channelCount": 2, "channelLayout": ["fl", "fr"], "sampleRateHertz": 48000, } } ], "muxStreams": [ { "key": "video-only-sd", "container": "fmp4", "elementaryStreams": [ "video-stream0" ], "segmentSettings": { "segmentDuration": { "seconds": "2.0s" }, "individualSegments": true }, }, { "key": "video-only-md", "container": "fmp4", "elementaryStreams": [ "video-stream1" ], "segmentSettings": { "segmentDuration": { "seconds": "2.0s" }, "individualSegments": true }, }, { "key": "video-only-hd", "container": "fmp4", "elementaryStreams": [ "video-stream2" ], "segmentSettings": { "segmentDuration": { "seconds": "2.0s" }, "individualSegments": true }, }, { "key": "audio-only", "container": "fmp4", "elementaryStreams": [ "audio-stream0" ], "segmentSettings": { "segmentDuration": { "seconds": "2.0s" }, "individualSegments": true } } ], "manifests": [ { "fileName": "master.m3u8", "type": "HLS", "muxStreams": [ "video-only-sd", "video-only-md", "video-only-hd", "audio-only" ] } ],
视频在各种播放器上运行良好,也适应带宽,但在 iPhone 上没有声音。可能原因:音频文件已生成,但与生成的视频文件数量不同。在大约 10 秒。视频,还有一个音频文件。
知道我忘记、忽略或错误定义或解释了什么吗?