jsmpeg icon indicating copy to clipboard operation
jsmpeg copied to clipboard

new jsmpeg.js hanging

Open jana4cheyenne opened this issue 8 years ago • 3 comments

hi,

i played previous and new version of jsmpeg.js in the same page. the previous version work perfectly, but the new version show a black canvas at the beginning (more than 15 sec), and it start to play not smoothly. video of new version keep on hanging and update canvas several sec.

below is my setting for both streaming, could you please advise me what should i do? thanks.

linux server running two ffmpeg processes:

#for previous version jsmpeg: ffmpeg -i rtmp://127.0.0.1/live/stream -filter_complex "eq=contrast=1,unsharp=9:9:1" -f mpeg1video -b:v 350k -r 20 -s 320x180 http://127.0.0.1:443/old

#for new version jsmpeg: ffmpeg -i rtmp://127.0.0.1/live/stream -filter_complex "eq=contrast=1,unsharp=9:9:1" -f mpegts -codec:v mpeg1video -b:v 350k -r 20 -s 320x180 http://127.0.0.1:443/new

playing both streaming in the same html:

var ws_old = new WebSocket('ws://192.168.10.10:8080/old'); var cv_old = document.getElementById('cv_old'); var js_old = new jsmpeg(ws_old, {canvas:cv_old});

var cv_new = document.getElementById('cv_new'); var js_new = new JSMpeg.Player('ws://192.168.10.10:8080/new', {canvas:cv_new});

jana4cheyenne avatar Apr 26 '17 05:04 jana4cheyenne

Are you using the same NodeJS server for both? You need to use the updated websocket-relay.js with the current JSMpeg version. The old server version added a custom header for each packet that the new client wont understand.

If not, maybe there's some buffering in ffmpeg before it emits a new mpegts packet. I've had some success with -muxdelay 0.0001.

phoboslab avatar May 10 '17 22:05 phoboslab

many thanks. i will try it and report there.

jana4cheyenne avatar May 15 '17 03:05 jana4cheyenne

@jana4cheyenne I know this is an old thread, but did you ever resolve this issue? I'm running into a similar problem, and setting a muxdelay doesn't appear to help.

calvinwyoung avatar Jul 02 '19 22:07 calvinwyoung