Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Command line 为什么gstreamer管道会停止?_Command Line_Video_Audio_Video Processing_Gstreamer - Fatal编程技术网

Command line 为什么gstreamer管道会停止?

Command line 为什么gstreamer管道会停止?,command-line,video,audio,video-processing,gstreamer,Command Line,Video,Audio,Video Processing,Gstreamer,这项工作: 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 我可以让它运行一段时间,杀死它,然后图腾gst.avi显示一张带有音调的漂亮测试卡

这项工作:

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
我可以让它运行一段时间,杀死它,然后
图腾gst.avi
显示一张带有音调的漂亮测试卡

但是,尝试做一些更有用的事情,比如

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
它只是显示

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
然后无限期地拖延


使用decodebin滚动获得版本的诀窍是什么?

您的管道似乎是正确的。然而,gst launch是一个有限的工具-我建议用python或ruby对管道进行编码,以便更好地调试。

啊哈。。。这正是我想要的:

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
队列元素(前导和尾随)确实显得至关重要

添加videoflip或

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

进入管道的视频部分时,所有工作都按预期进行。

当进行多路复用或解复用时,需要有缓冲区。这就是队列元素的作用。您可以通过指定队列中缓冲区的数量来进一步优化它。谢谢您的提示。事实证明,虽然上面的管道可以用于640x480视频,但我必须提高尾随视频队列的最大大小字节数,以使其不会与1280x720内容死锁。