【问题标题】:playing a raw video using gst-launch使用 gst-launch 播放原始视频
【发布时间】:2014-12-11 09:16:07
【问题描述】:

我已经使用 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 ...

任何线索如何解决这个错误?

【问题讨论】:

    标签: gstreamer vlc gst-launch


    【解决方案1】:

    有 2 个问题。首先,帧率应该是一个分数,所以你应该使用 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 也适合我!
    猜你喜欢
    • 2015-05-30
    • 2011-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-30
    • 1970-01-01
    • 2013-06-16
    相关资源
    最近更新 更多