linux - RTMP_ReadPacket,读取RTMP包头失败 rtmp ://a. rtmp.youtube.com/live2: Unknown error occurred

标签 linux ubuntu ffmpeg stream rtmp

这是我尝试运行的脚本,我相信问题出在这里:

#!/bin/bash


GIF=/home/stream1/85012216.gif
STREAM_KEY=thisisasecret
URL=rtmp://a.rtmp.youtube.com/live2
FPS=30
KEYINT=$(expr $FPS \* 3)

$FFMPEG -f alsa -ac 2 -i hw:Loopback,1,0 -fflags +genpts -r $FPS -i $GIF \
-vcodec libx264 -x264opts keyint=$KEYINT:min-keyint=$KEYINT:scenecut=-1 -b:v 1000k \
-preset veryfast -pix_fmt yuv420p -s 854x480 \
-c:a libfdk_aac -b:a 96k -ar 44100 \
-f flv $URL

错误:

ffmpeg version N-92337-g8e50215b5e Copyright (c) 2000-2018 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
configuration: --enable-shared --enable-gpl --enable-nonfree --enable-pthreads --enable-postproc --enable-libtheora --enable-version3 --enable-libx264 --enable-libfdk-aac --disable-stripping --disable-encoder=libschroedinger --enable-librtmp --enable-gnutls --enable-avfilter --enable-libfreetype --disable-decoder=amrnb --enable-fontconfig --disable-mips32r2 --disable-mipsdspr2 --disable-htmlpages --disable-podpages --disable-altivec --enable-libass --enable-omx --enable-omx-rpi libavutil 56. 23.100 / 56. 23.100 libavcodec 58. 36.100 / 58. 36.100 libavformat 58. 21.100 / 58. 21.100 libavdevice 58. 6.100 / 58. 6.100 libavfilter 7. 43.100 / 7. 43.100 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 libpostproc 55. 4.100 / 55. 4.100 Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, alsa, from 'hw:Loopback,1,0': Duration: N/A, start: 1541258646.286883, bitrate: 1536 kb/s Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Input #1, gif, from '/home/stream1/85012216.gif': Duration: N/A, bitrate: N/A Stream #1:0: Video: gif, bgra, 500x281, 16.67 fps, 16.67 tbr, 100 tbn, 100 tbc RTMP_ReadPacket, failed to read RTMP packet header rtmp://a.rtmp.youtube.com/live2: Unknown error occurred

系统详情:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

最佳答案

-f flv $URL 应该是 -f flv $URL/$STREAM_KEY

关于linux - RTMP_ReadPacket,读取RTMP包头失败 rtmp ://a. rtmp.youtube.com/live2: Unknown error occurred,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53132716/

相关文章:

c++ - Linux 终端中 C++ 的奇怪输出

linux - 将参数传递给 awk 脚本文件

linux - 将新文件上传到服务器时出现 500 内部错误

javascript - 从 docker 容器内的 Node 服务器访问 ubuntu localhost

linux - Ubuntu 13.10,Golang构建运行,终端报错bash : ./filename : Permission denied

linux - Ubuntu VM 上 git pull 出现致命 : Out of memory, malloc 失败错误

python - 在 Google Cloud Functions 上执行 shell 脚本

ffmpeg - 为什么ffmpeg会导出黑色视频?

python - python3中platform.dist和platform.linux_distribution的替代方案是什么

video - 如何优化 FFMPEG/编辑视频?