简体   繁体   English

为什么这个gstreamer管道失速?

[英]Why does this gstreamer pipeline stall?

This works: 这有效:

gst-launch-0.10 \
videotestsrc ! ffmpegcolorspace ! 'video/x-raw-yuv' ! mux. \
audiotestsrc ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=1' ! mux. \
avimux name=mux ! filesink location=gst.avi

I can let it run for a while, kill it, and then totem gst.avi displays a nice test card with tone. 我可以让它运行一段时间,杀死它,然后totem gst.avi显示一个很好的测试卡与音调。

However, trying to do something more useful like 但是,尝试做一些更有用的事情

gst-launch-0.10 \
filesrc location=MVI_2034.AVI ! decodebin name=dec \
dec. ! ffmpegcolorspace ! 'video/x-raw-yuv' ! mux. \
dec. ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=1' ! mux. \
avimux name=mux ! filesink location=gst.avi

it just displays 它只是显示

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

and then stalls indefinitely. 然后无限期地停止。

What's the trick to get the version with decodebin rolling ? 使用decodebin滚动版本的诀窍是什么?

Aha... this does what I want: 啊啊...这就是我想要的:

gst-launch-0.10 \
filesrc location=MVI_2034.AVI ! decodebin name=dec \
dec. ! queue ! ffmpegcolorspace ! 'video/x-raw-yuv' ! queue ! mux. \
dec. ! queue ! audioconvert ! 'audio/x-raw-int,channels=1' ! audioresample ! 'audio/x-raw-int,rate=44100' ! queue ! mux. \
avimux name=mux ! filesink location=gst.avi

The queue elements (both leading and trailing) do appear to be crucial. 队列元素(前导和尾随)似乎确实至关重要。

Further experiments adding things like videoflip or 进一步的实验添加像videoflip或

videorate ! 'video/x-raw-yuv,framerate=25/1'

into the video part of the pipeline all work as expected. 进入管道的视频部分都按预期工作。

your pipeline seems to be correct. 你的管道似乎是正确的。 however, gst-launch is a limited tool - i would suggest coding the pipeline in python or ruby for better debugging. 然而,gst-launch是一个有限的工具 - 我建议用python或ruby编写管道以便更好地调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM