Opened 12 months ago

Last modified 12 months ago

#11669 new defect

Compatibility issue with RTMP push from Dahua cameras

Reported by: mms Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: RTMP dahua
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

Dahua cameras do not send a videocodecid in the RTMP handshake metadata. FFMPEG in -listen mode currently fails to accept video streams from these cameras, it disconnects. This would be a workaround fix.

When videocodecid is missing, one simple workaround is to check for width metadata which the camera does send and proceed as if the videocodecid was sent, assuming h264. This was done with this library, line 35 reader.go:

https://github.com/bluenviron/mediamtx/pull/2298/commits/1d5994e75f3668e15405b16d0a217d84ffc613b8

Perhaps a way for ffmpeg to take parameters and run in a non-strict mode, taking default values hints for codec from the command line would be best general solution.

No ideal solution here, in the end it means millions of cameras out there (that will not be updated) are unusable with ffmpeg.

How to reproduce:
Run ffmpeg in -listen mode for rtmp connections and watch the connection drop right away when a Dahua camera connects.

Change History (5)

comment:1 by mms, 12 months ago

Priority: normalimportant

comment:2 by quinkblack, 12 months ago

Priority: importantnormal

Without the camera, I don't know how to move forward.

comment:3 by mms, 12 months ago

I can set my camera to sent the stream to whatever url is provided. Let me know.

comment:4 by quinkblack, 12 months ago

Does it work to use the camera as RTMP server? Use ffmpeg/ffplay as RTMP client, e.g.,
ffplay rtmp://camera_ip...

comment:5 by mms, 12 months ago

This is regarding RTMP push. If ffmpeg is the client then rtsp/rtmp likely does work. The idea here is that port forwarding isn't needed which is why rtmp push is supported by ip cameras.

Note: See TracTickets for help on using tickets.