【问题标题】:Gstreamer Tee with different capabilities on each branchGstreamer Tee 在每个分支上具有不同的功能
【发布时间】:2017-08-25 02:09:46
【问题描述】:

我有一个类似的 gstreamer 管道。

                              Queue -> videoscale -> videosink
                             /
appsrc -> h264_decoder -> Tee 
                             \ 
                              Queue -> jpegenc -> multifilesink

在解码器板上的功能方面,Tee 是如何工作的?是否可以在两个分支上设置不同的能力?

具体来说,是否可以设置两个不同的帧率? Filesink 以 1 fps 存储,videosink 以 30 fps 显示。

我正在使用以下命令行进行测试。

gst-launch-1.0 -e \
    filesrc location=${1} ! queue ! qtdemux name=d d.video_0 ! h264parse ! avdec_h264 ! tee name=t \
                       t. ! queue ! videoscale ! 'video/x-raw,width=(int)960,height=(int)540' ! autovideosink \
                       t. ! queue ! 'video/x-raw,framerate=1/1' ! jpegenc ! multifilesink location=out/img1_%03d.jpeg

但我收到“内部数据流错误”和“原因未链接”。

【问题讨论】:

  • 如果您有一个带有一组参数的解码器和另一个带有其他一组参数的解码器 - 那么您有两个解码器,对吗?将 tee 放在 appsrc 之后并使用两个 h264_decoder。
  • @Velkan 我想做的是解码一次,但从中获取一帧放入文件中。所以我想在解码器后面放一个 tee,第一个分支只会将解码后的帧显示为正常的解码显示管道,但第二个分支只会将其中一个帧存储到文件中。

标签: gstreamer tee gst-launch


【解决方案1】:

问题是您在管道的每个分支上要求不同的帧速率。

您忘记实例化一个为您提供 1/1 帧速率的元素,正如您的录制分支所期望的那样。 videorate 完成了这项工作。

这是我建议的工作管道:

gst-launch-1.0 -e \
    filesrc location=${1} ! queue ! qtdemux name=d d.video_0 ! h264parse ! avdec_h264 ! tee name=t \
                       t. ! queue ! videoscale ! 'video/x-raw,width=(int)960,height=(int)540' ! autovideosink \
                       t. ! queue ! videorate ! 'video/x-raw,framerate=1/1' ! jpegenc ! multifilesink location=out/img1_%03d.jpeg

【讨论】:

  • 现在我明白了,该功能必须由某些元素处理,avdec_h264 无法处理此问题。谢谢,这对我有用。
猜你喜欢
  • 2013-12-18
  • 1970-01-01
  • 1970-01-01
  • 2011-03-25
  • 1970-01-01
  • 2019-10-22
  • 1970-01-01
  • 2020-07-11
  • 1970-01-01
相关资源
最近更新 更多