This topic provides solutions for common problems that you may come across while you are using LiveChannel.

Push a stream to OSS LiveChannel

The following figure shows the process of pushing a stream to a LiveChannel, helping you investigate problems occurred when you push a stream to a LiveChannel.

For more information, see the following topics:

Case 1: The m3u8 file is missing.

Problem: The generated m3u8 file only contains the last 3 ts files by default. The m3u8 file conforms to the default rules of the HLS protocol.

Solution: Use PostVodPlaylist to converge the ts files generated in the specified time period into a m3u8 index file.
Note
  • The value of EndTime must be later than the value of StartTime. The duration between the EndTime and StartTime must be shorter than one day.
  • OSS queries all the ts files generated by the streams pushed to the specified LiveChannel in the specified time range and converges these files into a playlist.

Case 2: Failed to generate the m3u8 file

Problem: The m3u8 file is not successfully generated until the audio or video data is completely uploaded to OSS.

Solution: You can capture packets at the client side to check whether the "publish success" message is included, which indicates that the audio or video data is completely uploaded to OSS. If the message is included but the m3u8 file is not generated, you can analyze the packets sent from the client for root causes.

Case 3: The client cannot push a stream to OSS

Problem: The client fails to use ffmpeg to push a stream:
ffmpeg -re -i 0_20180525105430445.aac -acodec aac -strict -2 -f flv rtmp://xxx.oss-cn-beijing.aliyuncs.com/live/test_1000?Expires=1540458859&OSSAccessKeyId=LTAlujianb6C9z&Signature=qwh31xQsanmao6ygCFJgovNIg%3D&playlistName=playlist.m3u8
Solution:
  • We recommend you use the original command to push a stream without setting additional parameters.
  • If the "&" character is included in the URL used to push a stream, enclose the URL with quotation marks (""). For example: ffmpeg -re -i 0_20180525105430445.aac -acodec aac -strict -2 -f flv "rtmp://xxx.oss-cn-beijing.aliyuncs.com/live/test_1000?Expires=1540458859&OSSAccessKeyId=LTAlujianb6C9z&Signature=qwh31xQsanmao6ygCFJgovNIg%3D&playlistName=playlist.m3u8"
  • Use OBS to push a stream to check whether the problem is caused by ffmpeg.

Case 4: Lag problems occur when the m3u8 file is generated.

If the value of Type is HLS, when the duration of the video or audio data in the current ts file reaches the value of FragDuration, OSS generates a new ts file when receiving the next key frame. If OSS does not receive the next key frame with in a time period (calculated by max(2*FragDuration, 60s)), a new ts file is generated, which results lag in audio or video playing.

Case 5: No audio or video data is included in the generated m3u8 file.

This problem may be caused by the following reasons:

  • AVC header or AAC header is not sent. You can capture packets sent by the client to check whether the two headers are sent.
  • The length of RTMP message is shorter than 2, or the length of sequence header is too short.
  • The size of Message of the audio data exceeds the cache size.
  • codec_ ctx is important for the codec. If the audio or video data included in the parameter is incorrect, the m3u8 file may fail to be generated.

Case 6: The data upload to OSS by ffmpeg does not include audio data.

  • View the logs generated by ffmpeg to check whether aac_header is sent.
  • Capture the RTMP packets sent by the client to check whether aac_header is sent.