I've created a raw video file using filesink, I am able to play the file with vlc with the following command
我用文件墨水创建了一个原始视频文件,我可以用下面的命令用vlc播放文件。
vlc --demux rawvideo --rawvid-fps 24 --rawvid-width 1920 --rawvid-height 816 --rawvid-chroma I420 /home/user/Videos/out.yuv
But, with
但是,与
gst-launch-1.0 filesrc location=/home/user/Videos/out.yuv ! video/x-raw,format=I420,height=816,width=1920,framerate=24 ! autovideoconvert ! autovideosink
throws error
抛出错误
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 ...
Any clue how to resolve this error?
知道如何解决这个错误吗?
1 个解决方案
#1
6
There are 2 issues. First the framerate is expected to be a fraction, so you should use 24/1 instead of 24.
有两个问题。首先,framerate应该是一个分数,所以应该使用24/1而不是24。
The second problem is that the filesrc will read chunks of the file that are not the expected size of a frame, so frames won't be aligned with gstreamer buffers. You can either use filesrc's blocksize property to pass the correct bytes size of a frame (width * height * bytes per pixel) or you can just use videoparse element.
第二个问题是,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
Check "gst-inspect-1.0 videoparse" to learn about its available properties
检查“gst- inspection -1.0 videoparse”了解它的可用属性。
#1
6
There are 2 issues. First the framerate is expected to be a fraction, so you should use 24/1 instead of 24.
有两个问题。首先,framerate应该是一个分数,所以应该使用24/1而不是24。
The second problem is that the filesrc will read chunks of the file that are not the expected size of a frame, so frames won't be aligned with gstreamer buffers. You can either use filesrc's blocksize property to pass the correct bytes size of a frame (width * height * bytes per pixel) or you can just use videoparse element.
第二个问题是,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
Check "gst-inspect-1.0 videoparse" to learn about its available properties
检查“gst- inspection -1.0 videoparse”了解它的可用属性。