RTMP: Ignore FMLE start packet after flash publish. v7.0.129 (#4588)

We have discovered that some IP cameras send two publish packets in a
row.

The first packet is flash publish `publish('xxx')`
The second packet is FMLE publish `FCPublish('xxx|@setDataFrame()`

It seems that this is not processed correctly on the SRS side. In fact,
the stream is simply deinitialized, and republish is simply not
supported in this case.

As a fix, I suggest simply ignoring the FMLE publish packet after the
flash publish.

<img width="720" alt="screen"
src="https://github.com/user-attachments/assets/2db806ab-71b9-4e7b-bcf9-c16ea12df671"
/>
This commit is contained in:
artem-smorodin-dacast 2025-11-27 17:28:46 +03:00 committed by GitHub
parent e59b30301a
commit 4101900daf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 8 deletions

View File

@ -7,6 +7,7 @@ The changelog for SRS.
<a name="v7-changes"></a>
## SRS 7.0 Changelog
* v7.0, 2025-11-27, Merge [#4588](https://github.com/ossrs/srs/pull/4588): RTMP: Ignore FMLE start packet after flash publish. v7.0.129 (#4588)
* v7.0, 2025-11-18, AI: API: Change pagination default count to 10, minimum 1. v7.0.128
* v7.0, 2025-11-14, AI: Fix race condition causing immediate deletion of new sources. v7.0.127 (#4449)
* v7.0, 2025-11-11, AI: WebRTC: Support optional msid attribute per RFC 8830. v7.0.126 (#4570)

View File

@ -1176,6 +1176,11 @@ srs_error_t SrsRtmpConn::handle_publish_message(SrsSharedPtr<SrsLiveSource> &sou
// for flash, any packet is republish.
if (info_->type_ == SrsRtmpConnFlashPublish) {
if (dynamic_cast<SrsFMLEStartPacket *>(pkt.get())) {
srs_warn("flash late FMLE start packet");
return err;
}
// flash unpublish.
// TODO: maybe need to support republish.
srs_trace("flash flash publish finished.");

View File

@ -9,6 +9,6 @@
#define VERSION_MAJOR 7
#define VERSION_MINOR 0
#define VERSION_REVISION 128
#define VERSION_REVISION 129
#endif

View File

@ -20,9 +20,9 @@
#include <srs_kernel_utility.hpp>
#include <srs_protocol_sdp.hpp>
#include <srs_protocol_utility.hpp>
#include <srs_utest_ai16.hpp>
#include <srs_utest_manual_kernel.hpp>
#include <srs_utest_manual_mock.hpp>
#include <srs_utest_ai16.hpp>
#ifdef SRS_FFMPEG_FIT
#include <srs_app_rtc_codec.hpp>