Gstreamer 使用gst启动播放原始视频

Gstreamer 使用gst启动播放原始视频,gstreamer,vlc,gst-launch,Gstreamer,Vlc,Gst Launch,我已经使用FileLink创建了一个原始视频文件,我可以使用以下命令使用vlc播放该文件 vlc --demux rawvideo --rawvid-fps 24 --rawvid-width 1920 --rawvid-height 816 --rawvid-chroma I420 /home/user/Videos/out.yuv 但是, gst-launch-1.0 filesrc location=/home/user/Videos/out.yuv ! video/x-raw,fo

我已经使用FileLink创建了一个原始视频文件,我可以使用以下命令使用vlc播放该文件

 vlc --demux rawvideo --rawvid-fps 24 --rawvid-width 1920 --rawvid-height 816 --rawvid-chroma I420 /home/user/Videos/out.yuv
但是,

 gst-launch-1.0 filesrc location=/home/user/Videos/out.yuv ! video/x-raw,format=I420,height=816,width=1920,framerate=24 ! autovideoconvert ! autovideosink
抛出错误

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstCapsFilter:capsfilter0: Filter caps do not completely specify the output format
Additional debug info:
gstcapsfilter.c(348): gst_capsfilter_prepare_buf (): /GstPipeline:pipeline0/GstCapsFilter:capsfilter0:
Output caps are unfixed: EMPTY
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

有没有解决此错误的线索?

有两个问题。首先,帧率应该是一个分数,所以应该使用24/1而不是24

第二个问题是,filesrc将读取的文件块不是帧的预期大小,因此帧不会与gstreamer缓冲区对齐。您可以使用filesrc的blocksize属性传递帧的正确字节大小(宽度*高度*每像素字节数),也可以只使用videoparse元素

 gst-launch-1.0 filesrc location=/home/user/Videos/out.yuv ! videoparse width=1920 height=816 framerate=24/1 format=2 ! autovideoconvert ! autovideosink

查看“gst-inspect-1.0 videoparse”了解其可用属性

谢谢您的回答!看起来
framerate=24
也适合我!