Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error splitting the input into NAL units. #88

Open
dharmik-dalwadi-seaflux opened this issue Mar 21, 2022 · 2 comments
Open

Error splitting the input into NAL units. #88

dharmik-dalwadi-seaflux opened this issue Mar 21, 2022 · 2 comments

Comments

@dharmik-dalwadi-seaflux
Copy link

dharmik-dalwadi-seaflux commented Mar 21, 2022

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

@dharmik-dalwadi-seaflux
Copy link
Author

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

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

@vinnitu
Copy link

vinnitu commented Dec 26, 2023

what is it extradata?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants