You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i was curious how i would approach the remux into mp4?
Currently i am reading the data via WebSocket and is being sent over mpegts and I want to add this into a HTMLMediaElement via the SourceBuffer API but i need to demux and then remux in to mp4 to allow for this, as far as i know.
The text was updated successfully, but these errors were encountered:
Here's the code I'm using to do this. The only down side is I am currently having to hard-code the frame rate.
let debug = true;
function startup() {
// JMuxer will re-mux the H.264 video stream into the MediaSource object
const jmuxer = new JMuxer({
node: 'videoElement',
mode: 'video',
flushingTime: 1000,
fps: 30,
debug
});
// Use Demuxer.TSDemux to demux the MPEG-TS transport stream, then pass the H.264 video stream to JMuxer
let videoStreamID;
var demuxer = new Demuxer.TSDemux({ debug });
demuxer.on('DEMUX_DATA', function(e) {
// Find the first H.264 stream
if (!videoStreamID) {
if (e.stream_type === h264StreamType) {
videoStreamID = e.pid;
}
}
if (videoStreamID && e.pid === videoStreamID && e.pes && e.pes.data_byte) {
jmuxer.feed({ video: e.pes.data_byte });
}
});
// Open WebSocket connection to the video relay server
const ws = new WebSocket(wsURL);
ws.binaryType = "arraybuffer";
ws.onmessage = function(event) {
demuxer.push(event.data, {});
};
}
Hi, i was curious how i would approach the remux into mp4?
Currently i am reading the data via WebSocket and is being sent over mpegts and I want to add this into a HTMLMediaElement via the SourceBuffer API but i need to demux and then remux in to mp4 to allow for this, as far as i know.
The text was updated successfully, but these errors were encountered: