简体   繁体   English

解决GStreamer管道冻结问题

[英]Troubleshoot GStreamer pipeline freezing

Currently I working on android app which will play and record video form remote source 目前,我正在研究android应用,它将播放和录制远程形式的视频

My pipeline looks like this 我的管道看起来像这样

videotestsrc do-timestamp=true ! videoscale add-borders=false ! capsfilter ! videoflip method=0 ! tee name=split 
    split. ! queue ! videoconvert ! glupload ! glshader ! autovideosink async=false !
    split. ! queue ! identity drop-probability=0 ! videoconvert ! timeoverlay ! x264enc key-int-max=10 ! h264parse ! splitmuxsink location=/sdcard/test-%d.mp4

Only problem stat I see in logs 我在日志中看到的唯一问题统计

video_buffer_pool_set_config:<videobufferpool1> no caps in config

I'm not asking to fix my pipeline, I just wanna understand it there any common algorithm how to troubleshoot this kind of freeze? 我不是要修复管道,我只是想了解它,那里有任何通用算法如何解决这种冻结问题?

The best tool you'll have is probably the GST_DEBUG_BIN_TO_DOT_FILE macro, in gstdebugutils.h. 最好的工具可能是GST_DEBUG_BIN_TO_DOT_FILE宏。 It'll show your pipeline and the state of each element. 它会显示您的管道和每个元素的状态。 It does require you to set the GST_DEBUG_DUMP_DOT_DIR environment variable. 它确实需要您设置GST_DEBUG_DUMP_DOT_DIR环境变量。

Then you run a command like this to create a PNG or some other image file from the dot. 然后运行这样的命令,从该点创建PNG或其他图像文件。

dot -Tpng pipeline.dot -o pipeline.png

On our desktop systems we usually package all this up into a command we can add to our programs. 在我们的桌面系统上,我们通常将所有这些打包成一个命令,我们可以将其添加到程序中。 I'm not sure what your best route is in Android. 我不确定您最好的路线是在Android中。 Perhaps there are some additional APIs there that can help. 也许那里还有一些其他API可以提供帮助。

After you identify your problem elements, use the GST_DEBUG environment variable to add additional logging. 确定问题元素后,使用GST_DEBUG环境变量添加其他日志记录。 For example if you have an x264enc error, use: 例如,如果您遇到x264enc错误,请使用:

GST_DEBUG=2,x264enc:5

That'll set the logging level to error for everything except x264enc which will be debug level. 这会将除x264enc以外的所有内容的日志记录级别设置为错误,它将作为调试级别。

Also if you run a debugger you can usually look through all the threads and find which element is hanging. 另外,如果您运行调试器,通常可以浏览所有线程并找到挂起的元素。

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

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