使用 gstreamer 通过树莓派流式传输 RTSP。无法输出音频

时间:2021-03-08 17:09:56

标签: video gstreamer rtsp amazon-kinesis

所以我在 raspberry pi 上使用 gstreamer 从本地网络上的摄像头拉出 RTSP 流,然后将内容推送到 amazon kinesis。视频有效,但音频丢失。

我知道 rtsp 流有音频,因为我可以使用 VLC 从 IP 摄像机直接查看它。但是当它通过流光时,音频会被剥离。在尝试测试它时,我将内容发送到带有文件接收器的文件。文件已创建,但只有视频。没有音频。

gst-launch-1.0  -e rtspsrc location="rtsp://Test:Test@192.168.1.18/live" short-header=TRUE ! rtph264depay ! video/x-h264, format=avc,alignment=au ! h264parse ! mp4mux ! filesink location=./file.mp4

我尝试了一些我在 stackoverflow 上找到的东西,但它不起作用。当我尝试结束流时,它无限期地挂在“等待 EOS ...”上,当我再次尝试停止它时,它会停止,但输出文件的大小为 0。

gst-launch-1.0  -e rtspsrc location="rtsp://Test:Test@192.168.1.18/live" short-header=TRUE ! rtph264depay ! video/x-h264, format=avc,alignment=au ! h264parse ! mp4mux ! filesink location=./file.mp4

我尝试启用的实际 kinesis 命令是这样的。

gst-launch-1.0 rtspsrc location="rtsp://192.168.1.10/live"  ! rtph264depay ! h264parse ! kvssink <some additional kinesis parameters>

1 个答案:

答案 0 :(得分:0)

终于搞定了。

这就是在树莓派上包含 alaw 音频源所需要的。

gst-launch-1.0 rtspsrc name=src location="rtsp://Pass:Word@192.168.1.22/live" short-header=true do-timestamp=true ! rtph264depay ! h264parse ! kvssink name=sink stream-name="name" access-key="key" secret-key="secret aws-region="region" frame-timecodes=false src. ! rtppcmadepay ! alawdec ! audioresample ! audioconvert ! voaacenc ! aacparse ! queue ! sink.