我已经使用filesink创建了一个原始视频文件,我可以使用以下命令使用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 ...有什么线索可以解决这个错误吗?
发布于 2014-12-12 04:24:51
有两个问题。首先,帧速率应该是一个分数,所以您应该使用24/1而不是24。
第二个问题是filesrc将读取的文件块不是帧的预期大小,因此帧不会与gstreamer缓冲区对齐。您可以使用filesrc的blocksize size属性来传递帧的正确字节大小(width * height * bytes per pixel),也可以只使用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“以了解其可用属性
https://stackoverflow.com/questions/27419113
复制相似问题