Troubleshoot abnormal stream ingest

更新时间:
复制 MD 格式

Scenarios

ApsaraVideo Live pushes Real-Time Messaging Protocol (RTMP) video streams from an ingest client to the live center. The ingest client can be an ingest tool or the Push SDK. The live center is the ingest URL provided by ApsaraVideo Live, such as video-center.alivecdn.com. For more information about ingest methods, see Ingest settings and operations. However, stream ingest may fail even if you follow the instructions. This document describes common stream ingest issues and provides troubleshooting steps.

Troubleshooting

  • Incorrect client ingest method

    • Check whether the URL and Stream Name in your stream settings are correct.

      Note

      The settings for Open Broadcaster Software (OBS) are used as an example. Your actual settings may vary.

      The URL includes the live center and the AppName. The stream name includes the StreamName and QueryString parameters. These parameters include the vhost parameter and, if authentication is enabled, the auth_key parameter.

      Set Stream Type to Custom Streaming Server. In URL, enter the ingest URL, for example, rtmp://push.aliyunlive.com/app/. In Stream Name, enter the stream name with the authentication key, for example, stream?auth_key=xxx.

    • Check the settings of the client ingest tool. Common ingest tools include OBS, ffmpeg, and Adobe Flash Media Live Encoder. You can use these tools to test whether stream ingest is working correctly. If stream ingest is successful, check for issues with your original ingest method.

      Note

      For more information about OBS ingest settings, see OBS ingest tool.

      If other ingest tools work correctly, the issue is with your client settings. Compare the settings, identify any differences, and adjust them.

  • Non-compliant audio and video encoding

    ApsaraVideo Live requires H.264 for video streams and Advanced Audio Coding (AAC) for audio streams. Ensure that your encoding formats meet these requirements. If they do not, issues may occur with different streaming protocols.

    Use the following ffmpeg command to check the stream encoding format.

    ffmpeg -i rtmp://[$Your_Domain]/[$App_Name]/[$Stream_Name]
    • [$Your_Domain]: Your ingest domain.

    • [$App_Name]: The AppName in the ingest URL.

    • [$Stream_Name]: The StreamName in the ingest URL.

    Confirm that your stream encoding format meets the requirements.

    D:\Common Tools\ffmpeg\bin>ffmpeg -i rtmp://xxx/AppName/StreamName
    ffmpeg version N-79143-g8ff0f6a Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 5.3.0 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --ena
    ble-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
    --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enabl
    e-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
    ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
    ble-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enabl
    e-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-l
    ibvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-lib
    webp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enab
    le-libzing --enable-lzma --enable-decklink --enable-zlib
      libavutil      55. 19.100 / 55. 19.100
      libavcodec     57. 30.100 / 57. 30.100
      libavformat    57. 29.101 / 57. 29.101
      libavdevice    57.  0.101 /  57.  0.101
      libavfilter     6. 40.102 /  6. 40.102
      libswscale      4.  0.100 /  4.  0.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Metadata:
      Server          Tengine
      width           720.00
      height          540.00
      displayWidth    720.00
      displayHeight   540.00
      duration        0.00
      framerate       24.00
      videodatarate   300.00
      videocodecid    7.00
      audiodatarate   62.00
      audiocodecid    10.00
      via             liveproxy010182174197.eu6,livesource010182170179.eu6,liv
    esource010182170179.eu6,liveproxy010182169150.eu6,cache13.l2nu17-1[328,75,444,MI
    SS],cache19.l2nu17-1[444,-1,655,MISS],cache7.cn396[713,52,805,MISS],cache6.cn396
    [805,2,1006,MISS]
      begints         23258.00
      alilive_streamid  dc xxx.cn/AppName/StreamName
      videocodecreal  0.00
      key_ts:
    Input #0, flv, from 'rtmp://dc xxx.cn/AppName/StreamName':
      Metadata:
        Server          : Tengine
        displayWidth    : 720
        displayHeight   : 540
        fps             : 24
        profile         :
        level           :
        via             : liveproxy010182174197.eu6,livesource010182170179.eu6,lives
    ource010182170179.eu6,liveproxy010182169150.eu6,cache13.l2nu17-1[328,75,444,MISS
    ],cache19.l2nu17-1[444,-1,655,MISS],cache7.cn396[713,52,805,MISS],cache6.cn396[8
    05,2,1006,MISS]
        begints         : 23258
        alilive_streamid: dc xxx.cn/AppName/StreamName
        videocodecreal  : 0
      Duration: 00:00:00.00, start: 20.843000, bitrate: N/A
        Stream #0:0: Video: h264 (High), yuv420p, 720x540 [SAR 1:1 DAR 4:3], 307 kb/
    s, 24.42 fps, 24 tbr, 1k tbn, 48 tbc
        Stream #0:1: Audio: aac (LC), 22050 Hz, stereo, fltp, 63 kb/s
  • Concurrent ingest limit reached

    The ApsaraVideo Live service limits the number of live domains for each user and the number of concurrent ingest streams for a single domain. A single account can create up to 20 live domains. If the live center is in Beijing, Shanghai, or Shenzhen, each accelerated domain name supports up to 300 concurrent original (untranscoded) live streams by default. Each live domain is limited to 300 concurrent ingest streams. For other live centers, each accelerated domain name supports up to 50 concurrent original (untranscoded) live streams by default. If the number of concurrent ingest streams exceeds the limit, stream ingest will fail.

    Additionally, if real-time transcoding is configured for the AppName and the live center is in Beijing, Shanghai, or Shenzhen, each domain supports up to 300 concurrent transcoded streams. This means a single domain can output a maximum of 300 transcoded streams at the same time. For other live centers, each domain supports up to 50 concurrent transcoded streams. If the number of concurrent ingest streams exceeds this limit, stream ingest will fail.

    To view the current number of concurrent ingest streams, see Manage live streams.

    Note

    For more information about stream ingest limits and how to increase them, see Limits.

  • Stream Ingest Is Disabled for This Live Stream

    ApsaraVideo Live lets you disable stream ingest for a specific AppName and StreamName. If an ingest URL is on the blacklist, stream ingest will fail. If a stream ingest fails, verify that the ingest URL is not on the blacklist.

    To resume the live stream:

    • On the Streams page in the console, click Enable in the row of the target live stream.

    • Call the ResumeLiveStream operation to resume the live stream.

  • Authentication failed

    After you enable authentication, both the ingest and streaming URLs for the domain must include the auth_key parameter. If the authentication parameter has expired or the signature parameter is incorrect, stream ingest will fail. For more information, see Ingest and streaming URL authentication.

  • Network error

    The ingest client pushes the live stream to the live center over RTMP. A problem along this network path can cause stream ingest to fail. Check the following two items first:

    • On the ingest client, ping the ingest URL to test for packet loss. If packet loss occurs, contact your ISP to investigate.

    • On the ingest client, use the telnet command to test whether you can connect to port 1935 of the ingest domain. If the connection fails, try testing from a different network environment to determine whether the issue is with your on-premises network.

  • Ingest timestamp uses an extension field

    Client ingest adds two timestamps to each video and audio frame: presentation timestamp (pkt_pts) and decoding timestamp (pkt_dts). Use the ffprobe command to view them. For example: ffprobe -show_frames rtmp://live.zhibotest.com/AppName/StreamName. A sample result is shown as follows:

    If the pkt_pts or pkt_dts timestamp (in milliseconds) exceeds 31 bits when converted to binary, client incompatibility issues may occur. width and height indicate the video resolution. pict_type indicates the frame type (video frames are classified as B, P, or I frames; only video frames have this property).

    [/FRAME]
    [FRAME]
    media_type=video
    stream_index=1
    key_frame=0
    pkt_pts=100766
    pkt_pts_time=100.766000
    pkt_dts=100766
    pkt_dts_time=100.766000
    best_effort_timestamp=100766
    best_effort_timestamp_time=100.766000
    pkt_duration=33
    pkt_duration_time=0.033000
    pkt_pos=255797
    pkt_size=10406
    width=1280
    height=720
    pix_fmt=yuv420p
    sample_aspect_ratio=N/A
    pict_type=B
    coded_picture_number=23
    display_picture_number=0
    interlaced_frame=0
    top_field_first=0
    repeat_pict=0
    color_range=unknown
    color_space=unknown
    color_primaries=unknown
    color_transfer=unknown
    chroma_location=left
    [/FRAME]
    [FRAME]
    media_type=audio

    The timestamp can be converted to a binary value. If the timestamp is larger than 24 bits, check on the ingest client whether a video frame exceeds the maximum size and contains multiple chunks. If it does, modify the ingest client to add the timestamp to each chunk. Alternatively, you can resolve the issue by forcing a smaller pts value.

  • Other issues

    If none of the preceding methods resolve the issue, submit a ticket. For information about how to submit a ticket, see Contact us. Provide the following information so that our technical support engineers can help you resolve the issue:

    • Ingest URL and streaming URL.

    • Ingest method, including the tool used and the procedure.

    • The error message that appears on the ingest client when the stream ingest fails.

    • A screenshot of the result from pinging the IP address of the ingest domain.

    • A screenshot of the result from using telnet to connect to port 1935 of the ingest domain.