【问题标题】:Interlaced mpeg2 video with avenc_mpeg2video gstreamer使用 avenc_mpeg2video gstreamer 隔行扫描 mpeg2 视频
【发布时间】:2021-05-01 12:27:55
【问题描述】:

以下 GStreamer 管道生成带有 mpeg2 视频轨道的 mpeg2ts。

gst-launch-1.0 videotestsrc pattern=ball num-buffers=900 ! "video/x-raw, format=(string)I420, \
width=(int)704, height=(int)576, framerate=(fraction)25/1" ! avenc_mpeg2video ! \
mpegtsmux ! filesink location=test.ts

我需要对视频进行隔行扫描,但是在添加隔行扫描组件时,我得到:

gst-launch-1.0 videotestsrc pattern=ball num-buffers=900 ! "video/x-raw, format=(string)I420, \
width=(int)704, height=(int)576, framerate=(fraction)25/1" ! interlace ! avenc_mpeg2video ! \
mpegtsmux name=mux ! filesink location=test.ts
WARNING: erroneous pipeline: could not link interlace0 to avenc_mpeg2video0

这对我来说很奇怪,因为这两个组件似乎都支持例如I420 在他们的垫子上。我尝试在 interlace 和 avenc_mpeg2video 之间添加各种 capsfilter,但无济于事 - 它只是无法以其他方式连接。我相信这两者应该兼容 - 有人可以解释为什么上述失败,甚至可以显示工作管道应该是什么样子吗?

【问题讨论】:

    标签: gstreamer interlacing


    【解决方案1】:

    尝试将 avenc_mpeg2video 的alternate-scan 参数设置为1。不需要使用隔行扫描组件。这适用于 Gstreamer 1.19:

    gst-launch-1.0 videotestsrc pattern=ball num-buffers=900 ! "video/x-raw, format=(string)I420, \
    width=(int)704, height=(int)576, framerate=(fraction)25/1" ! avenc_mpeg2video alternate-scan=1 ! \
    mpegtsmux ! filesink location=test.ts
    

    您可以使用以下命令查看 avenc_mpeg2video 的参数:

    gst-inspect-1.0 avenc_mpeg2video
    

    【讨论】:

      猜你喜欢
      • 2021-06-20
      • 1970-01-01
      • 2013-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 2019-02-10
      • 1970-01-01
      相关资源
      最近更新 更多