I use the GCP Transcoder API with the following configuration:
NodeJS 12
Firebase Storage
Firestore DB
GCP CDN
job start on upload (firebase function)
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" ] } ],
The videos run wonderfully on various players, also adapt to the bandwidth, but the sound is missing on iPhones. Possible reason: The audio files were generated, but the number differs from the generated video files. At about 10 sec. video, there is one more audio file.
Any idea what I have forgotten or overlooked or wrongly defined or interpreted?