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

Local file .H264 file is not playing for the full time #146

Open
ruthsam244 opened this issue May 10, 2024 · 4 comments
Open

Local file .H264 file is not playing for the full time #146

ruthsam244 opened this issue May 10, 2024 · 4 comments

Comments

@ruthsam244
Copy link

I am uploading the h264 file from my local computer. The video plays well but does not play for the full time. Like i had 59.55mins data but the files play for like 30 sec or 2mins 30sec. Iam using the source code of the live demo of the repository. Can you please help me with this?

This is my script file :-
<script>
window.onload = function () {
debugger
document.getElementById('play-btn').addEventListener('click', function (e) {
if (jmuxer) {
jmuxer.destroy();
}
var file = document.getElementById('h264_file');
if (!file.files.length) {
alert('Please choose a file.');
return;
}
var fps = parseInt(document.getElementById('fps-input').value) || 1;
reader.readAsArrayBuffer(file.files[0]);
jmuxer = new JMuxer({
node: 'player',
mode: 'video',
flushingTime: 0,
fps: fps,
clearBuffer: true,
debug: true,
readFpsFromTrack : true
});
}, false);
var jmuxer, duration = 3600000;
var reader = new FileReader();
reader.onload = function (e) {
console.log('File read successfully:', new Uint8Array(e.target.result));
jmuxer.feed({
video: new Uint8Array(e.target.result),
duration : duration
});
console.log(jmuxer)
};
}
</script>

<script type="text/javascript" src="./dist/jmuxer.js"></script>
@ruthsam244
Copy link
Author

@samirkumardas Kindly help me with this!

@samirkumardas
Copy link
Owner

When you play the file in this player https://samirkumardas.github.io/jmuxer/h264_player.html do you get the same result?

@ruthsam244
Copy link
Author

@samirkumardas, Yes Absolutely! The functionality also works the same way, but the only thing is Iam getting lesser chunks of data say 9000000, then the chunks of the data if i upload demo.h264.

@ruthsam244
Copy link
Author

@samirkumardas any thoughts on this? How to resolve it?

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