GStreamer通过UDP流音频和视频,以便能够在VLC上播放 [英] GStreamer stream audio and video via UDP to be able to playback on VLC

查看:995
本文介绍了GStreamer通过UDP流音频和视频,以便能够在VLC上播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过UDP通过Gstreamer传输音频和视频,但是在VLC上播放仅返回没有音频的视频.目前,我正在使用Big Buck Bunny的样本,并确认它确实有音频.我计划将来使用Snowmix将媒体馈送到Gstreamer输出.

I am trying to stream audio and video via Gstreamer via UDP but playback on VLC only returns video without audio. Currently I am using a sample of Big Buck Bunny and have confirmed that it does have audio. I am planning to use Snowmix to feed media to Gstreamer output in the future.

从文件源通过UDP流传输到VLC上的播放,我目前通过以下方式执行:

Streaming from file source via UDP to playback on VLC I currently perform by:

gst-launch-1.0 -v uridecodebin uri=file:///home/me/files/Snowmix-0.5.1/test/big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! queue ! videoconvert ! x264enc ! mpegtsmux ! queue ! udpsink host=230.0.0.1 port=4012 sync=true

这使我可以在Windows计算机上的VLC中打开网络流,以接收数据包并仅播放视频.

which allows me to open a network stream in VLC on my Windows machine to receive packets and only plays video.

我的命令中缺少什么?

推荐答案

如RSATom先前所述,管道中缺少音频.

As RSATom stated previously, the audio is missing from the pipeline.

接下来是正确的视频和音频管道(使用相同的输入文件测试):

The correct pipeline for video and audio is the next (tested with the same input file):

gst-launch-1.0 -v uridecodebin name=uridec uri=file:///home/usuario/Desktop/map/big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! queue ! videoconvert ! x264enc ! video/x-h264 ! mpegtsmux name=mux ! queue ! udpsink host=127.0.0.1 port=5014 sync=true uridec. ! audioconvert ! voaacenc ! audio/mpeg ! queue ! mux.

请记住,在这种情况下,您将重新编码源视频文件中的所有内容,这意味着CPU占用率很高.另一种选择是从输入文件中解复用内容,然后再次不进行编码(使用h264parseaacparse)进行多路复用.

Remember that in this case you're re-encoding all the content from the source video file, which means high CPU consumption. Other option would be to demux the content from the input file and mux again without encoding (using h264parse and aacparse).

这篇关于GStreamer通过UDP流音频和视频,以便能够在VLC上播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆