Video Gstreamer插件不处理I420格式
我正在使用Gstreamer将视频文件流式传输到Video Gstreamer插件不处理I420格式,video,encoding,streaming,gstreamer,Video,Encoding,Streaming,Gstreamer,我正在使用Gstreamer将视频文件流式传输到shmsink,然后使用udpsink输出到网络,但仅当从shmsrc读取时caps指定的格式为BGRA时才会这样做 以下是我的管道: sudo gst-launch-1.0 filesrc location=/home/me/files/Snowmix-0.5.1/test/big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! decodebin ! shmsink socket-path=/tmp/fee
shmsink
,然后使用udpsink
输出到网络,但仅当从shmsrc
读取时caps指定的格式为BGRA
时才会这样做
以下是我的管道:
sudo gst-launch-1.0 filesrc location=/home/me/files/Snowmix-0.5.1/test/big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! decodebin ! shmsink socket-path=/tmp/feed1-control-pipe shm-size=10000000 wait-for-connection=0
此管道读取指定的文件并将其输出到共享内存接收器
sudo GST_DEBUG=mpegtsmux:5 gst-launch-1.0 shmsrc socket-path=/tmp/feed1-control-pipe do-timestamp=true is-live=true ! 'video/x-raw, format=I420, max-input-size=200000, width=320, height=720, framerate=25/1' ! videoconvert ! x264enc ! mpegtsmux ! udpsink host=192.168.78.10 port=4012 sync=true
此管道从共享内存源读取数据,并尝试通过UDP进行输出。在上面的管道中,我们可以看到我将视频的格式指定为I420
,这实际上是视频文件的编码。然而,mpegtsmux
插件似乎没有交互,它应该将流重新格式化为mpeg
传输流
将格式从I420
更改为BGRA
,即使文件本身编码为I420
,也可以让我们看到mpegtsmux
插件上的交互。视频输出,可以在VLC上播放,但格式明显错误,播放异常
注意:上面的管道指定了width=320
和height=720
的分辨率,因为使用BGRA
将其增加到正常width=1280
和height=720
会导致以下错误:
WARNING: from element /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: Internal GStreamer error: code not implemented. Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Additional debug info:
gstvideofilter.c(292): gst_video_filter_transform (): /GstPipeline:pipeline0/GstVideoConvert:videoconvert0:
invalid video buffer received
将正常分辨率与I420
一起使用不会产生上述错误,但不会再次使流通过管道中的mpegtsmux
插件
为什么从
shmsrc
读取时标识为I420
的流不能成功通过我的管道?与x264enc
或videoconvert
和I420
是否存在兼容性问题?使用gst-inspect-1.0 shmsrc查询组件shmsrc
返回:
Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
ANY
建议它能够接收任何格式,包括I420
。我们还知道,videoconvert
支持输入I420
。因此,我认为您的流的格式是RGBA
。如果文件格式化为I420
,则可能decodebin
元素会将其转换为RGBA