参考这个link,要求完全相同。
i) 如何在 AM5728 中压缩音频(与视频相关)?
am5728 没有音频编码硬件,所以你们都要做软件编码,gstreamer 有 avenc_aac 插件来做。
ii) 如何对这些单独压缩的视频和音频进行编码
并发送到 RTP(网络),保持音频与视频同步?我们来到了
跨各种插件。
以下是一个简单的管道,它在端口 10000 上使用 ip 192.168.1.186 向客户端发送音频和视频,您可以根据自己的方便更改 ip 以及端口:
gst-launch-1.0 -vv v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw,format=(string)YUY2,width=1280,height=720,framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! 'video/x-raw,format=NV12,width=1920,height=1080' ! queue ! ducatih264enc bitrate=6000 ! h264parse ! queue ! mpegts. alsasrc ! queue ! avenc_aac ! compliance=-2 ! aacparse ! mpegts. mpegtsmux name=mpegts ! rtpmp2tpay ! udpsink host=192.168.1.186 port=10000
对于接收者:
gst-launch-1.0 -e -v udpsrc port=10000 caps="application/x-rtp\,.." ! rtpjitterbuffer ! rtpmp2tdepay ! tsdemux name=demux demux. ! queue ! h264parse ! avdec_h264 ! videoconvert ! autovideosink demux. ! queue ! aacparse ! avdec_aac ! audioconvert ! autoaudiosink
注意: udpsink0.GstPad:sink: 接收者大写的大写需要填写发送方打印的大写