我有来自苹果的这个公共HLS流:
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
它有以下内容:
curl http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=688301
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0640_vod.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=165135
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0150_vod.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=262346
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0240_vod.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=481677
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/0440_vod.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1308077
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/1240_vod.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1927853
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/1840_vod.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=2650941
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/2540_vod.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=3477293
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/3340_vod.m3u8
现在我想创建一个 Kinesis Video Stream 生产者。我首先创建一个新的 AWS Linux 2 EC2 实例。我正在使用以下脚本引导此实例:
./install-script -a -d -j $MAX_NUM_PARALLEL
我对文件中指定的命令没有任何运气install-script-ami
。删除-a
如下为我做了它:./install-script -d -j $MAX_NUM_PARALLEL
。当我运行它时,它搅动了 10 分钟然后失败了。这里的修复是使用以下命令安装 c++:
yum install gcc-c++
所以我重新运行了install-script
它,它继续在它停止的地方。再过 20 分钟左右,安装完成,我收到以下提示:
[100%] Built target kvs_producer_plugin_rtsp_demo
**********************************************************
Success in building the Kinesis Video Streams Producer SDK !!!
**********************************************************
Now you can set the environment variables before running the sample applications
by running source set_kvs_sdk_env.sh
Also, you may want to add to the following environment variables to set it permanently
in /root/.bashrc or /root/.bash_profile or /root/.zshrc
最后,我采购了 envars:
source set_kvs_sdk_env.sh
现在我终于要尝试阅读 HLS 流...
gst-launch-1.0 http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8 ! hlsdemux ! tsdemux ! queue ! video/x-h264 ! h264parse ! qtmux ! filesink
WARNING: erroneous pipeline: no source element for URI "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"
这是我收到警告的时候。在这一点上,我真的很接近,但卡住了。最终我想运行这个命令:
gst-launch-1.0 $STREAM_URL ! hlsdemux ! tsdemux ! queue ! video/x-h264 ! kvssink stream-name=$STREAM_NAME storage-size=512 access-key=$AWS_ACCESS_KEY_ID secret-key=$AWS_SECRET_ACCESS_KEY aws-region="us-east-1"
我在这里做错了什么?为什么WARNING: erroneous pipeline: no source element for URI
我使用的每个 HLS URL 都会收到警告?