Streampunk/beamcoder

Error splitting the input into NAL units.

Opened this issue · 2 comments

I am facing this error when decode the mkv file with h264 codec.

Error

[h264 @ 0x3c78200] No start code is found.
[h264 @ 0x3c78200] Error splitting the input into NAL units.

Reproduction Steps

MKV File which i'm using : https://github.com/aws/amazon-kinesis-video-streams-parser-library/blob/master/src/test/resources/output_get_media.mkv

const beamcoder = require('beamcoder');

async function run() {
	const demuxer = await beamcoder.demuxer('<video-file>.mkv');
	console.log(JSON.stringify(demuxer));
	const decoder = beamcoder.decoder({ name: 'h264' });

	let packet = {};
	for (let x = 0; x < 1000 && packet !== null; x++) {
		packet = await demuxer.read();
		if (packet && packet.stream_index === 0) {
			const data = await decoder.decode(packet);
                        console.log(data)
		}
	}
}
run();

Related

This issue has been fixed by providing the extradata into the decoder.

decoder.extradata = demuxer.streams[0].codecpar.extradata

what is it extradata?