0

我已经用谷歌搜索了所有内容,但找不到解决问题的方法。如果有人有类似的需求并以某种方式解决,我会很高兴。

我通过以下命令流式传输到 RTMP 服务器。它从 HDMI 编码器捕获视频、裁剪、旋转视频。

gst-launch-1.0 -e v4l2src device=/dev/v4l/by-path/platform-fe801000.csi-video-index0 ! video/x-raw,format=UYVY,framerate=20/1 ! videoconvert ! videoscale ! video/x-raw, width=1280,height=720 ! videocrop top=0 left=0 right=800 bottom=0 ! videoflip method=counterclockwise ! omxh264enc ! h264parse!  flvmux name=mux streamable=true ! rtmpsink sync=true async=true location='rtmp://XXXXX live=true'

我想将音频添加到 Raspberry 上的现有麦克风。例如,我可以通过下面的管道将麦克风输入记录到 wav 文件。

gst-launch-1.0 alsasrc num-buffers=1000 device="hw:1,0" ! audio/x-raw,format=S16LE  ! wavenc  !  filesink location = a.wav

我的问题是;如何将音频添加到流到 RTMP 服务器的现有命令行中?而且,当我将音频捕获到文件时,会有很多噪音。我该如何避免?

谢谢

4

2 回答 2

0

我通过以下代码解决了噪音问题。但还是不太好。

“ffmpeg -ar 48000 -ac 1 -f alsa -i hw:1,0 -acodec aac -ab 128k -af 'highpass=f=200, lowpass=f=200' -f flv rtmp://XXXXX.XXXXXXX. XXXXX/LiveApp/"+ str(Id) + "-" + str(deviceId)+"-Audio"

于 2021-09-24T10:28:47.437 回答
0

我已经结合了音频和视频。但我仍然有音频噪音。

gst-launch-1.0 -e v4l2src device=/dev/v4l/by-path/platform-fe801000.csi-video-index0 ! video/x-raw,format=UYVY,framerate=20/1 ! videoconvert ! videoscale ! video/x-raw, width=1280,height=720 ! videocrop top=0 left=0 right=800 bottom=0 ! videoflip method=counterclockwise ! omxh264enc ! h264parse!  flvmux name=mux streamable=true ! rtmpsink sync=true async=true location='rtmp://XXXXXXXXXXXXXXXX' alsasrc device="hw:1,0" ! queue ! audioconvert ! audioresample ! audio/x-raw,rate=44100 ! queue ! voaacenc bitrate=128000 ! audio/mpeg ! aacparse ! audio/mpeg, mpegversion=4 ! mux.
于 2021-09-22T07:49:36.440 回答