This topic provides answers to frequently asked questions about LiveChannel.
Process of stream ingest
For more information, see PutLiveChannel and PutLiveChannelStatus.
What do I do if the generated M3U8 object does not contain all data that is ingested to the LiveChannel?
Cause: Based on the default rules of the HTTP Live Streaming (HLS) protocol, the generated M3U8 object contains only the last three TS objects.
Solution: Call the PostVodPlaylist operation to converge the TS objects generated within the specified time range into the M3U8 object.
- The value of
EndTime
must be greater than the value ofStartTime
. The duration between EndTime and StartTime must be less than one day. - OSS queries all TS objects that are generated by the streams ingested to all specified LiveChannels within the specified time range and converges these objects into an M3U8 playlist object.
What do I do if the M3U8 object failed to be generated?
Cause: Data in the stream is not completely ingested to Object Storage Service (OSS).
Solution: Capture packets on the client to check whether the "publish success" message is returned. This message indicates that the data in the stream is completely uploaded to OSS. If the message is returned but the M3U8 object is not generated, analyze the packets sent from the client to locate the cause.
What do I do if the client cannot ingest a stream to OSS?
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=LTAlujianb****&Signature=qwh31xQsanmao6ygCFJgo****%3D&playlistName=playlist.m3u8
- Use the original command to ingest a stream without setting additional parameters.
- If ampersands (&) are included in the URL used to ingest a stream, enclose the URL
with quotation marks (""). 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=LTAlujianb****&Signature=qwh31xQsanmao6ygCFJgo****%3D&playlistName=playlist.m3u8"
. - Use OBS to ingest a stream to check whether the problem is caused by FFMpeg.
If the latency of the ingested stream is high, adjust the values of the FragDuration and FragCount parameters when you call the PutLiveChannel operation.
What do I do if lag occurs when I playback the generated M3U8 object?
If the value of Type is HLS, when the duration of the video or audio data in the current
TS object reaches the value of FragDuration
, OSS generates a new TS object when the next key frame is received. OSS waits for the next key frame for
a specific time period (calculated by max(2*FragDuration, 60s)
) before OSS creates the next TS file. If the next key frame is not received within
the period, OSS creates a new TS object and uses the new TS object to store data in
the stream. In this case, lag occurs.
What do I do if no audio or video data is included in the generated M3U8 object?
Cause:
- The
AVC header
orAAC 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 ofsequence header
is too short. - The size of
Message
of the audio data exceeds the cache size. - Audio or video data specified by the
codec_ctx
parameter is incorrect.
What do I do if the video uploaded to OSS by using FFMpeg does not contain audio data?
Solution:
- 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.