kyriesent / node-rtsp-stream

Stream any RTSP stream and output to websocket for consumption by jsmpeg (https://github.com/phoboslab/jsmpeg). HTML5 streaming video! Requires ffmpeg.
MIT License
451 stars 166 forks source link

blurry video stream #39

Closed akashhnag closed 4 years ago

akashhnag commented 5 years ago

This particular version (0.0.8) gives blurry videos. The problem gets solved if I use version 0.0.5.

kyriesent commented 5 years ago

Hm, not sure how to diagnose this. My quickest guess would be a change in ffmpeg options; the data coming through should otherwise be the same.

JSMPEG should also be decoding roughly the same.

Do you have a sample video stream to point to that you've seen this happen with?

decioschmitt commented 5 years ago

This particular version (0.0.8) gives blurry videos. The problem gets solved if I use version 0.0.5.

I had the same issue.

pooyasa commented 5 years ago

Had the same problem with distorted picture on 0.0.8 and downgraded it to 0.0.5. I managed to load buckbunny on 0.0.5 but The problem with it, is it cannot connect to my camera. though 0.0.8 and vlc player work perfectly.

Here's the error: [rtsp @ 0x1ad7410] Nonmatching transport in server reply rtsp://[USER]:[Password]@192.168.1.100:554/onvif2: Invalid data found when processing input RTSP stream exited with error

pooyasa commented 5 years ago

This is how it looks image

TKasperczyk commented 5 years ago

This is how it looks image

I'm also having this problem. The ffmpeg process in my case looks like this: ffmpeg -rtsp_transport tcp -thread_queue_size 512 -r 30 -i rtsp://1.2.3.4:554/profile2 -f mpegts -codec:v mpeg1video -stats -r 30 -

To test if it's a problem on the ffmpeg part, I started this process manually outside of node, changed the output to output.mp4 and then played the file through VLC. Everything looked fine. I guess there's something wrong either with mpeg1muxer on the server side or jsmpeg on the client side.

Update

I've fixed it. This 901dc1e9cff8a30c20b422522d3806578e25cf56 commit was supposed to add compatibility with the latest jsmpeg. Using mpegts causes video artifacts. Just remove these two options to make it work.

--- node_modules/node-rtsp-stream/mpeg1muxer.js.old
+++ node_modules/node-rtsp-stream/mpeg1muxer.js
@@ -28,8 +28,6 @@
     "-i",
     this.url,
     '-f',
-    'mpegts',
-    '-codec:v',
     'mpeg1video',
     // additional ffmpeg options go here
     ...this.additionalFlags,
kyriesent commented 4 years ago

Thanks again @TKasperczyk !

jhanmarc commented 4 years ago

Thank you @TKasperczyk !

Aditya-Ace commented 4 years ago

Finally, It worked. Why didn't I come here before! Thanks alot.