scottlamb / retina

High-level RTSP multimedia streaming library, in Rust
https://crates.io/crates/retina
Apache License 2.0
218 stars 46 forks source link

Fatal: Wrong ssrc after 0 packets; expecting ssrc=Some(0000a0c6) seq=None (initial ssrc: true) #79

Closed nemosupremo closed 1 year ago

nemosupremo commented 1 year ago

I'm looking into an issue with a camera where it initially fails to start streaming because of a wrong ssrc. I believe this camera's RTSP impemntation is also buggy as mpv (via ffmpeg) throws a warning before finally playing the video:

 (+) Video --vid=1 (h264 1920x1080 15.000fps)
 (+) Audio --aid=1 (aac 1ch 48000Hz)
File tags:
 Title: h264.mp4
AO: [coreaudio] 48000Hz mono 1ch floatp
VO: [libmpv] 1920x1080 yuv420p
Invalid video timestamp: 0.377778 -> 0.040000 <--- warning
AV: 00:00:15 / 00:00:17 (90%) A-V:  0.000 ct:  0.338

I haven't done a deep dive in the packets yet, but I noticed that the issue only occurs once, at the start of the stream; and that removing the bail! alleviates the issue. My gut is telling me here that maybe we could ignore the ssrc mismatch if seen_packets is 0.