使用 avconv 或 ffmpeg 流式传输到 rtmp

使用 avconv 或 ffmpeg 流式传输到 rtmp

我有一个 IP 网络摄像头 HiSilicon Hi3516C,我可以通过 Raspberry Pi 成功访问它。我可以使用以下命令获取静态图像:

avconv -i "rtsp://192.168.1.10:554" myfile.jpg

现在,我想将视频流式传输到 YouTube Live,而不是静态图像。我已经在我的 YouTube Live 帐户中配置了一个事件,并获得了流名称和 rtmp url。

到目前为止我已经尝试过:

avconv -re -i rtsp://192.168.1.10:554 -r 20 -b 750 -f flv rtmp://a.rtmp.youtube.com/live2/<mystreamName>

我收到一个错误:(RTMP_ReadPacket, failed to read RTMP packet header完整错误如下)

有什么提示或建议吗?我对视频格式、编解码器和流媒体了解甚少,所以欢迎任何帮助。如果有人知道要发出什么命令,我不介意使用 ffmpeg。


完整错误:

[h264 @ 0x15a7400] RTP: missed 138 packets                                                                                                                                                          
[h264 @ 0x15a7400] RTP: missed 177 packets                                                                                                                                                          
[h264 @ 0x15a7400] RTP: missed 111 packets                                                                                                                                                          
[h264 @ 0x15a7400] RTP: missed 276 packets                                                                                                                                                          
[h264 @ 0x15a7400] RTP: missed 213 packets                                                                                                                                                          
[h264 @ 0x15a7400] RTP: missed 242 packets                                                                                                                                                          
[rtsp @ 0x15a3700] max_analyze_duration reached                                                                                                                                                     
[rtsp @ 0x15a3700] Estimating duration from bitrate, this may be inaccurate                                                                                                                         
Guessed Channel Layout for  Input Stream #0.1 : mono                                                                                                                                                
Input #0, rtsp, from 'rtsp://192.168.1.10':
  Metadata:
    title           :
    comment         : minisdp
  Duration: N/A, start: 0.040000, bitrate: N/A
    Stream #0.0: Video: h264 (Main), yuv420p, 1920x1080, 7.33 fps, 1k tbr, 90k tbn
    Stream #0.1: Audio: [0][0][0][0] / 0x0000, 8000 Hz, mono
RTMP_ReadPacket, failed to read RTMP packet header                                                                                                                                                  
rtmp://a.rtmp.youtube.com/live2p/cyrilbiz.31vj-y6k5-thpg-5tme: Unknown error occurred 

YouTube 导入设置:

•   custom ingestion: bitrate 400kbps - 1000 kbps (360p)
•   encoder: Other encoder

网络摄像头规格:

Webcam: HiSilicon Hi3516C
Video Encoding
    •   H.264 baseline profile
    •   H.264 main profile Level 4.0
    •   MJPEG/JPEG baseline
Video Encoding Performance
    •   At most 2-megapixel resolution for H.264 encoding
    •   Real-time H.264&JPEG encoding of multiple types of streams: 1080p@30 fps+VGA@30 fps + JPEG snapshot 1080p@1 fps
    •   Supports constant bit rate (CBR) mode and variable bit rate (VBR) mode.
    •   Supports the output bit rate ranging from 32 Kbit/s to 40 Mbit/s.
    •   Encoding frame rate, ranging from 1/16 frame/s to 30 frame/s
    •   Eight ROIs
    •   OSD overlay of eight regions before encoding

相关内容