-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert rtmp to HLS and only keep the audio in m3u8 format. #1641
Comments
Encounter the same problem.
|
1 similar comment
Encounter the same problem.
|
The HLS slicing of srs does not guarantee that every slice contains a keyframe, so you need to check whether the locally sliced ts slices can be played after being copied locally. Secondly, you need to check your streaming to see if the source stream file has sps, pps for every IDR of the video, and whether they are all complete. If any of them are missing, it will also not work.
|
Pushing two different streams will cause the player to freeze and refreshing will not restore it. It is likely a problem with the server's HLS switching. Reproduction path:
|
Confirm that it is a problem with the encoding header, because even if you manually process the m3u8, it will still take time, only keeping the ts of the new stream. Below is the original #EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:15
#EXT-X-DISCONTINUITY
#EXTINF:14.755, no desc
livestream-0.ts
#EXTINF:11.675, no desc
livestream-1.ts
#EXTINF:7.520, no desc
livestream-2.ts
#EXT-X-DISCONTINUITY
#EXTINF:12.266, no desc
livestream-3.ts
#EXTINF:12.386, no desc
livestream-4.ts
#EXTINF:7.480, no desc
livestream-5.ts Remove the slices before #EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:15
#EXTINF:12.266, no desc
livestream-3.ts
#EXTINF:12.386, no desc
livestream-4.ts
#EXTINF:7.480, no desc
livestream-5.ts It indicates that the issue is not with the m3u8 file, but with the ts file. Even directly playing Please refer to the attachment: live.tar.gz Use EasyICE to check Check
Check
Clearly, this encoding/decoding header is incorrect. The encoding/decoding information for the new stream is definitely different. In fact, it is still the information from the previous video. The encoding/decoding information for the new stream should be:
Comparing
|
After investigation, it was found that there was a bug introduced. Previously, in order to solve the issue of multiple SPS, only the first SPS was saved, and the subsequent SPS were discarded. However, this aspect did not take into account the situation where SPS could change. There are two formats that will parse SPS/PPS:
Both of these formats store the parsed codec information, one in the cache and the other in each video packet. To see where the parsed SPS/PPS is used, one is in RTMP to RTC conversion, and the other is in HLS.
Therefore, after re-pushing RTMP, there are issues with HLS/RTMP2RTC because it uses the SPS/PPS information. RTC/RTMP/FLV have no issues because they do not use this encoding/decoding information, and directly forward the updated SPS/PPS packets. RTMP also experiences screen flickering because it does not support updating SPS/PPS, which is different from the screen flickering issue in HLS/RTMP2RTC. RTMP2RTC refers to the conversion of RTMP to RTC.
|
Transcode RTMP to HLS and only keep the audio in the m3u8 file.
srs-3.0release
Replay
How to replay bug?
When switching video streaming, an issue occurs.
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: