GStreamer。从 udp 播放原始 h264

时间:2021-07-02 08:32:14

标签: gstreamer h.264 gstreamer-1.0

我从某个相机获取原始 h264 流,我需要使用 gst 播放它。 起初我试图将流保存到文件中(使用我自己的应用程序,它只是将流写入文件)并使用 filesrc 付款:

gst-launch-1.0 filesrc location="file path" ! video/x-h264 ! h264parse ! avdec_h264 ! videoconvert ! videorate ! video/x-raw,framerate=30/1 ! autovideosink

这行得通。然后我尝试从 udpsrc 播放:

gst-launch-1.0 udpsrc port=1234 ! video/x-h264 ! h264parse ! avdec_h264 ! videoconvert ! videorate ! video/x-raw,framerate=30/1 ! autovideosink

并得到下一个错误(从相机开始流后):

<块引用>

ERROR: from element /GstPipeline:pipeline0/GstCapsFilter:capsfilter0: 过滤器上限没有完全指定输出格式 附加调试信息: gstcapsfilter.c(453): gst_capsfilter_prepare_buf(): /GstPipeline:pipeline0/GstCapsFilter:capsfilter0: 输出上限不固定:video/x-h264, width=(int)[ 1, 8192 ], height=(int)[ 1, 8192 ], framerate=(fraction){ 30/1, [ 0/1, 2147483647/ 1 ] } 执行在 0:00:04.234834646 之后结束

我是 GST 新手。 请帮帮我)))

1 个答案:

答案 0 :(得分:0)

解决办法:

gst-launch-1.0 -v udpsrc port=5000 ! h264parse ! avdec_h264 ! videoconvert ! videorate ! video/x-raw,framerate=30/1 ! autovideosink

对于实时流:

gst-launch-1.0 -v udpsrc port=5000 ! h264parse ! avdec_h264 ! videoconvert ! autovideosink
相关问题