If you follow the steps in Best Practice > CSS Push but fail to publish streams, check the common reasons for publishing failure listed in this document to troubleshoot the issue.
Publishing can succeed only if your domain name has a CNAME record that points to a Tencent Cloud address. You can check whether a publishing domain name created has a CNAME record in the CNAME column in Domain Management.
If your domain name does not have a CNAME record, you can add one for it by following the steps in Configuring CNAME for Domain Name.
RTMP publishing uses the 1935 port by default. If the port is not open in the firewall of the network you use for testing, you will be unable to connect to the server. You can check whether this is what caused your publishing failure by switching to another network, for example, 4G.
Some clients may be too cautious about
txTime. For example, they may set
txTime to 5 minutes from the current time to prevent traffic theft. This is unnecessary given the presence of the
txSercet signature. If the validity period is too short, if a host is disconnected during a live stream, he or she may be unable to resume publishing due to the expiration of the publishing URL.
You are advised to set
txTime to 12 or 24 hours from the current time, longer than an average live streaming session.
To ensure security, Tencent Cloud requires configuring hotlink protection for all push URLs and rejects all hotlink protection URLs that have expired or are miscalculated. If a push is rejected, the LVB SDK will throw a PUSH_WARNING_SERVER_DISCONNECT event.
See Best Practice > CSS Push for how to get reliable publishing URLs.
A publishing URL can be used by only one client at a time. A second client trying to publish using the URL will be rejected by Tencent Cloud. You can log in to the CSS console and check whether a stream is already being published in Stream Management > Live Streams. You can also check whether a stream is disabled in Disabled Streams.
-2error occurs when I call
V2TXLivePusherto publish streams?
-2 error may occur in the following cases:
trtc://streams in LiteAVSDK_Smart. Only LiteAV_All and LiteAV_Enterprise support the TRTC protocol. LiteAVSDK_Smart does not.
startPush. For how to splice publishing URLs, please see Publishing/Playback URL.
V2TXLiveMode_RTCmode is selected during initialization of the player, but an
rtmp://URL is passed in.