Unable to upload YouTube live from Gstreamer or ffmpeg

I’m trying to streaming to YouTube RTMP from HLS(Kinesis video streaming) or MP4 data.

from videotestsrc, successfully works

STREAM_URL="rtmp://a.rtmp.youtube.com/live2/****"
gst-launch-1.0 \
        videotestsrc is-live=1 \
        ! videoconvert \
        ! "video/x-raw, width=1280, height=720, framerate=25/1" \
        ! queue \
        ! x264enc bitrate=2000 byte-stream=false key-int-max=60 bframes=0 aud=true tune=zerolatency ! "video/x-h264,profile=main" \
        ! flvmux streamable=true name=mux \
        ! rtmpsink location="${STREAM_URL} app=live2" \
        audiotestsrc \
        ! voaacenc bitrate=128000 \
        ! mux.

Failed: from HLS Streaming

# SOURCE_URL="https://b-87178fb5.kinesisvideo.ap-northeast-1.amazonaws.com/hls/v1/getHLSMasterPlaylist.m3u8?SessionToken=****"

gst-launch-1.0 -v \
    souphttpsrc location=$SOURCE_URL \
    ! hlsdemux \
    ! decodebin \
    ! videoconvert \
    ! "video/x-raw, width=1280, height=720, framerate=25/1" \
    ! queue \
    ! x264enc bitrate=2000 byte-stream=false key-int-max=60 bframes=0 aud=true tune=zerolatency ! "video/x-h264,profile=main" \
    ! flvmux streamable=true name=mux \
    ! rtmpsink location="${STREAM_URL} app=live2" \
    audiotestsrc \
    ! voaacenc bitrate=128000 \
    ! mux.

Error: no ‘moov’ atom within the first 10 MB

Failed: from MP4

SOURCE_MP4="./wave.mp4"

# tcp
ffmpeg -re -i $SOURCE_MP4 -codec copy -rtsp_transport tcp -f rtsp ${STREAM_URL}
# udp (same result)
# ffmpeg -re -i $SOURCE_MP4 -codec copy -f rtsp ${STREAM_URL}
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './wave.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41isomavc1
    creation_time   : 2021-04-15T04:54:06.000000Z
  Duration: 00:00:18.75, start: 0.000000, bitrate: 2489 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2488 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
    Metadata:
      creation_time   : 2021-04-15T04:54:06.000000Z
      handler_name    : L-SMASH Video Handler
      encoder         : AVC Coding

No error, but live not start.

Failed: from MP4

gst-launch-1.0 \
    filesrc location="${SOURCE_MP4}" \
    ! qtdemux \
    ! queue ! h264parse ! video/x-h264,format=avc,alignment=au \
    ! decodebin \
    ! videoconvert \
    ! "video/x-raw, width=1280, height=720, framerate=25/1" \
    ! queue \
    ! x264enc bitrate=2000 byte-stream=false key-int-max=60 bframes=0 aud=true tune=zerolatency ! "video/x-h264,profile=main" \
    ! flvmux streamable=true name=mux \
    ! rtmpsink location="${STREAM_URL} app=live2" \
    audiotestsrc \
    ! voaacenc bitrate=128000 \
    ! mux.
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: Internal data stream error.
Additional debug info:
qtdemux.c(6605): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

What’s the system environment? OS?

thanks

NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"

gst-launch-1.0 version 1.16.2
GStreamer 1.16.2
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

ffmpeg version 4.2.4-1ubuntu0.1

DeepStream does not support UBuntu 20.04 yet

also not working

NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.