【问题标题】:sending video and its audio to RTP(network) using gstreamer framework使用 gstreamer 框架将视频及其音频发送到 RTP(网络)
【发布时间】:2018-02-15 05:31:44
【问题描述】:

我对 gstreamer 非常陌生,我想将视频及其音频从摄像头发送到 RTP(网络)。

我使用“AM5728”作为我们的处理器,它将视频和音频分别作为输入,视频将在 AM5728 中使用 H.264 进行压缩。

现在我的问题是 i) 如何在 AM5728 中压缩音频(与视频相关)?

ii) 如何对这些单独压缩的视频和音频进行编码并发送到 RTP(网络),使音频与视频保持同步?我们遇到了各种插件。

有没有专门的插件。

【问题讨论】:

    标签: video-streaming gstreamer h.264 rtp


    【解决方案1】:

    参考这个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: 接收者大写的大写需要填写发送方打印的大写

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-12
      • 2013-02-25
      • 1970-01-01
      相关资源
      最近更新 更多