Closed stokie-ant closed 3 years ago
Interesting. Are you sure that netsed
does not perform conversion UDP->TCP?
I don't think netsed works like that. Besides, the image is now glitch free. If the connection between netsed and the camera was still udp the glitching would still be there
Can you provide two motion logs with d -7
and two corresponding wireshark dumps: one for not working case and one that works with netsed?
I have filtered the pcket captures to the camera with the issue (camera4, Allan Room). Notice that both network captures, packet 12 is the same except that with netsed the exchange succeeds. This is because the substitution is done on the local interface. I have included a capture of the local interface. Look at packet 12, you'll see the substitution of AVP; with AVP/TCP;
direct-no-netsed.pcapng.gz direct-no-netsed.motion.log using-netsed.pcapng.gz using-netsed.motion.log local-between-motion-netsed.pcapng.gz
Yes, now that looks like a workaround. While ffmpeg tries to follow the protocol, there is currently no way to force TCP if the camera explicitly does not return TCP in DESCRIBE. We could add the workaround into the documentation Thanks!
+1 Been trying to figure out why my cam doesn't work and this explains it all too well. Please document the workaround somewhere in the motion docs.
@stokie-ant TIL netsed!
+1 Been trying to figure out why my cam doesn't work and this explains it all too well. Please document the workaround somewhere in the motion docs.
@stokie-ant TIL netsed!
Glad to help. Just out of interest, what make/model do you have? Mine is a Sricam sp012. I think it might be a good idea to compile a list somewhere of non compliant devices this does or does not work for
+1 Been trying to figure out why my cam doesn't work and this explains it all too well. Please document the workaround somewhere in the motion docs. @stokie-ant TIL netsed!
Glad to help. Just out of interest, what make/model do you have? Mine is a Sricam sp012. I think it might be a good idea to compile a list somewhere of non compliant devices this does or does not work for
I'm working with a YooSee SD-M5 Doorbell camera which seems to be based on:
closed via #1275
I am sharing how I solved this exact issue for my Yoosee IP camera.
I hope it will help someone else. Sorry for the long answer but that's to make as clear as possible to everybody.
https://stackoverflow.com/q/66280861/1207193
In summary: I modified the ffmpeg/libavformat/rtsp.c
source code and rebuilt custom FFMPEG libraries that works for my Yoosee camera. Not breaking any functionality.
Since in my case I can't (or don't want to) use another process over it like with the netsed solution.
This is not a bug in motion and not a bug in ffmpeg. In fact ffmpeg is doing what it is supposed to do. It's more a bug in the camera.
ffmpeg sends the setup request with the header:
But the camera replies with:
ffmpeg sees no tcp, thinks the camera is trying to drop to udp and bails.
The previous workaround was to set
netcam_use_tcp off
to force udp but, as the manual says:I don't know if some cameras are incapable of rtsp over tcp but a workaround I found to force use of tcp is to run a local instance of netsed and point the netcam_url at this instead Ex, instead of:
netcam_url rtsp://192.168.0.51:554/onvif1
use:
netcam_url rtsp://127.0.0.1:554/onvif1
Start netsed to substitude AVP; with AVP/TCP;
netsed tcp 554 192.168.0.51 554 's/AVP;/AVP%2FTCP;'
Maybe the docs can refer to this workaround