Play raw h264 live stream in browser
I'm looking for a solution to play raw h264 stream coming from a native server through websocket live on a browser. I tried many third party h264 decoders in javascript and each one has its own issues. Decoders based on broadway cannot decode main and high profile h264. Other decoders are too slow to decode 1080p frames. I tried converting raw h264 into fragmented mp4 in javascript but the playback is very ugly when decoding bidirectional frames. I also tried webrtc but it seems impossible to implement peerconnection between browser and a native server. Any suggestions?
Thanks!
javascript html5 webrtc live-streaming http-live-streaming
add a comment |
I'm looking for a solution to play raw h264 stream coming from a native server through websocket live on a browser. I tried many third party h264 decoders in javascript and each one has its own issues. Decoders based on broadway cannot decode main and high profile h264. Other decoders are too slow to decode 1080p frames. I tried converting raw h264 into fragmented mp4 in javascript but the playback is very ugly when decoding bidirectional frames. I also tried webrtc but it seems impossible to implement peerconnection between browser and a native server. Any suggestions?
Thanks!
javascript html5 webrtc live-streaming http-live-streaming
1
You will need to mux your h.264 stream into an MP4/ISO BMFF container, and then use MediaSource Extensions to play it back. You mentioned you tried this... can you show the code you tried?
– Brad
Jan 2 at 17:25
Yes i tried it. I used this project github.com/xevokk/h264-converter to do the muxing. It does not play well in chrome due to the fact that chrome decoder refers decoding timestamp instead of presentation timestamp for decoding b-frames.
– Kiran Raj
Jan 3 at 13:46
MSE in Chrome can handle b-frames just fine (unlike WebRTC), you just need to provide composition times in your fragmented mp4. So whatever library you are using for muxing, make sure to set composition times which are the difference between presentation and decoder timestamps.
– user1390208
Jan 3 at 16:38
Thanks for the idea @user1390208. Can u suggest a standard muxing library that handles cts properly
– Kiran Raj
Jan 7 at 6:32
add a comment |
I'm looking for a solution to play raw h264 stream coming from a native server through websocket live on a browser. I tried many third party h264 decoders in javascript and each one has its own issues. Decoders based on broadway cannot decode main and high profile h264. Other decoders are too slow to decode 1080p frames. I tried converting raw h264 into fragmented mp4 in javascript but the playback is very ugly when decoding bidirectional frames. I also tried webrtc but it seems impossible to implement peerconnection between browser and a native server. Any suggestions?
Thanks!
javascript html5 webrtc live-streaming http-live-streaming
I'm looking for a solution to play raw h264 stream coming from a native server through websocket live on a browser. I tried many third party h264 decoders in javascript and each one has its own issues. Decoders based on broadway cannot decode main and high profile h264. Other decoders are too slow to decode 1080p frames. I tried converting raw h264 into fragmented mp4 in javascript but the playback is very ugly when decoding bidirectional frames. I also tried webrtc but it seems impossible to implement peerconnection between browser and a native server. Any suggestions?
Thanks!
javascript html5 webrtc live-streaming http-live-streaming
javascript html5 webrtc live-streaming http-live-streaming
asked Jan 2 at 7:59
Kiran RajKiran Raj
111
111
1
You will need to mux your h.264 stream into an MP4/ISO BMFF container, and then use MediaSource Extensions to play it back. You mentioned you tried this... can you show the code you tried?
– Brad
Jan 2 at 17:25
Yes i tried it. I used this project github.com/xevokk/h264-converter to do the muxing. It does not play well in chrome due to the fact that chrome decoder refers decoding timestamp instead of presentation timestamp for decoding b-frames.
– Kiran Raj
Jan 3 at 13:46
MSE in Chrome can handle b-frames just fine (unlike WebRTC), you just need to provide composition times in your fragmented mp4. So whatever library you are using for muxing, make sure to set composition times which are the difference between presentation and decoder timestamps.
– user1390208
Jan 3 at 16:38
Thanks for the idea @user1390208. Can u suggest a standard muxing library that handles cts properly
– Kiran Raj
Jan 7 at 6:32
add a comment |
1
You will need to mux your h.264 stream into an MP4/ISO BMFF container, and then use MediaSource Extensions to play it back. You mentioned you tried this... can you show the code you tried?
– Brad
Jan 2 at 17:25
Yes i tried it. I used this project github.com/xevokk/h264-converter to do the muxing. It does not play well in chrome due to the fact that chrome decoder refers decoding timestamp instead of presentation timestamp for decoding b-frames.
– Kiran Raj
Jan 3 at 13:46
MSE in Chrome can handle b-frames just fine (unlike WebRTC), you just need to provide composition times in your fragmented mp4. So whatever library you are using for muxing, make sure to set composition times which are the difference between presentation and decoder timestamps.
– user1390208
Jan 3 at 16:38
Thanks for the idea @user1390208. Can u suggest a standard muxing library that handles cts properly
– Kiran Raj
Jan 7 at 6:32
1
1
You will need to mux your h.264 stream into an MP4/ISO BMFF container, and then use MediaSource Extensions to play it back. You mentioned you tried this... can you show the code you tried?
– Brad
Jan 2 at 17:25
You will need to mux your h.264 stream into an MP4/ISO BMFF container, and then use MediaSource Extensions to play it back. You mentioned you tried this... can you show the code you tried?
– Brad
Jan 2 at 17:25
Yes i tried it. I used this project github.com/xevokk/h264-converter to do the muxing. It does not play well in chrome due to the fact that chrome decoder refers decoding timestamp instead of presentation timestamp for decoding b-frames.
– Kiran Raj
Jan 3 at 13:46
Yes i tried it. I used this project github.com/xevokk/h264-converter to do the muxing. It does not play well in chrome due to the fact that chrome decoder refers decoding timestamp instead of presentation timestamp for decoding b-frames.
– Kiran Raj
Jan 3 at 13:46
MSE in Chrome can handle b-frames just fine (unlike WebRTC), you just need to provide composition times in your fragmented mp4. So whatever library you are using for muxing, make sure to set composition times which are the difference between presentation and decoder timestamps.
– user1390208
Jan 3 at 16:38
MSE in Chrome can handle b-frames just fine (unlike WebRTC), you just need to provide composition times in your fragmented mp4. So whatever library you are using for muxing, make sure to set composition times which are the difference between presentation and decoder timestamps.
– user1390208
Jan 3 at 16:38
Thanks for the idea @user1390208. Can u suggest a standard muxing library that handles cts properly
– Kiran Raj
Jan 7 at 6:32
Thanks for the idea @user1390208. Can u suggest a standard muxing library that handles cts properly
– Kiran Raj
Jan 7 at 6:32
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003015%2fplay-raw-h264-live-stream-in-browser%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003015%2fplay-raw-h264-live-stream-in-browser%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You will need to mux your h.264 stream into an MP4/ISO BMFF container, and then use MediaSource Extensions to play it back. You mentioned you tried this... can you show the code you tried?
– Brad
Jan 2 at 17:25
Yes i tried it. I used this project github.com/xevokk/h264-converter to do the muxing. It does not play well in chrome due to the fact that chrome decoder refers decoding timestamp instead of presentation timestamp for decoding b-frames.
– Kiran Raj
Jan 3 at 13:46
MSE in Chrome can handle b-frames just fine (unlike WebRTC), you just need to provide composition times in your fragmented mp4. So whatever library you are using for muxing, make sure to set composition times which are the difference between presentation and decoder timestamps.
– user1390208
Jan 3 at 16:38
Thanks for the idea @user1390208. Can u suggest a standard muxing library that handles cts properly
– Kiran Raj
Jan 7 at 6:32