Play raw h264 live stream in browser












2















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!










share|improve this question


















  • 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
















2















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!










share|improve this question


















  • 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














2












2








2








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!










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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














  • 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












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
});


}
});














draft saved

draft discarded


















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
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas