ffmpeg 命令到 GStreamer 管道以获取 srtp 流

ffmpeg command to GStreamer pipeline for srtp stream

我想将这个工作的 ffmpeg 命令转换为 GStreamer 管道,但我无法让它工作。尝试使用 srtpenc 将密钥设置为缓冲区和 udpsink 的十六进制表示以及目标主机和端口集。

我目前的命令:

ffmpeg -re -i <<rtspurl>> -map 0:0 -vcodec h264_omx -pix_fmt yuv420p \
  -r 30 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 300k \
  -bufsize 300k -payload_type 99 -ssrc <<ssrc>> \
  -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 \
  -srtp_out_params <<base64key>> srtp://<<targetip>>:<<targetport>>?rtcpport=<<targetport>>&localrtcpport=<<targetport>>&pkt_size=1378

一些参考资料:

类似于:

gst-launch-1.0 uridecodebin uri=<<rtsp url>> ! videoconvert ! videoscale ! \
  videorate ! video/x-raw, height=720, width=1270, framerate=30/1 ! \
  omxh264enc b-frames=0 target-bitrate=300000 ! \
  rtph264pay pt=99 mtu=1378 ssrc=<<ssrc>> ! srtpenc key=<<key in hex>> ! \
  udpsink host=<<targetip>> port=<<targetport>>

为了将来参考,这是我最后使用的管道:

gst-launch-1.0 rtspsrc location=<<rtsp url>> latency=0 ! \
  videoconvert ! \
  videoscale ! \
  videorate ! \
  video/x-raw, height=<<height>>, width=<<width>>, framerate=<<fps>>/1 !\
  v4l2h264enc ! \
  rtph264pay pt=99 mtu=1378 ssrc=<<ssrc>> ! \
  srtpenc key=<<key in hex>> ! \
  udpsink host=<<targetip>> port=<<targetport>>

需要帮助将 FFmpeg 命令转换为 GStreamer 命令,请

ffmpeg -i m3u8 url -c copy -bsf:a aac_adtstoasc -t 00:00:10 001stream.mp4