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
Hello @rudyryk, i took a look at the network dumps through Wireshark, and in particular at the pcap corresponding to the "bad" sample.
For the first two seconds, your camera just sends audio, without video. The first audio sample has a timestamp of "0" and was received at 0.73 seconds:
At 2.1 seconds, video starts to appear, but it has a timestamp of "0" instead of "2.1 seconds":
This video frame is associated with the audio frame that was sent with the same timestamp, that is zero, so the video frame received at 2.1 seconds it associated with the audio frame received at 0.73 seconds, and that is why video and audio are not synced correctly.
This mess is caused by the camera.
In my opinion you can mitigate the issue by using a workaround: in RTSP, contrarily to RTMP, timestamp has a starting value that is random and unique for each track, and a video frame received at X seconds is always associated with the audio frame received at X seconds, regardless of the timestamp field. Therefore, if you publish the stream to the server with RTMP, but you read this same stream with RTSP, the problem will disappear. You can even use FFmpeg to obtain a synced RTMP stream:
Which version are you using?
v1.3.1
Which operating system are you using?
Describe the issue
When publishing RTMP streams from Dahua cameras sometimes audio is delayed for about 1 second (more or less).
Describe how to replicate the issue
rtmp://<MediaMTX URL>/test-stream
ffplay -i rtmp://<MediaMTX URL>/test-stream
ffmpeg -i rtmp://<MediaMTX URL>/test-stream -c copy test-stream.mp4
Is the issue is not happening, try again.
Did you attach the server logs?
No
Did you attach a network dump?
Yes (will send by email)
The text was updated successfully, but these errors were encountered: