GStreamer将音频转码为AAC

时间:2018-08-22 08:52:01

标签: video-streaming gstreamer rtsp video-encoding

我有一个RTSP流,可以像这样使用GStreamer将其重新流化为HLS:

gst-launch-1.0 -v -e rtspsrc protocols=tcp location=rtsp://admin:1234@192.168.1.20:554/Streaming/channels/101  ! queue ! rtph264depay ! h264parse ! mpegtsmux  ! hlssink location="D:\\wamp\\www\\stream\\%06d.ts" playlist-location="D:\\wamp\\www\\stream\\play.m3u8" target-duration=5

RTSP流具有使用H.264编码的视频和原始音频(pcm_ulaw)。我的目标是将音频编码为AAC,以便HLS支持它。将! audioconvert ! voaacenc命令放入管道中以实现此目标的正确顺序是什么?

1 个答案:

答案 0 :(得分:1)

基本上,您在RTSP源和MPEGTS多路复用器之间有另一个分支。像这样:

gst-launch-1.0 -v -e rtspsrc protocols=tcp location=rtsp://admin:1234@192.168.1.20:554/Streaming/channels/101 name=rtsp ! queue ! rtph264depay ! h264parse ! mpegtsmux name=mux ! hlssink location="D:\\wamp\\www\\stream\\%06d.ts" playlist-location="D:\\wamp\\www\\stream\\play.m3u8" target-duration=5 rtsp. ! queue ! rtppcmudepay ! mulawdec ! audioconvert ! audioresample ! voaacenc ! aacparse ! mux.