简体   繁体   中英

Troubleshoot GStreamer pipeline freezing

Currently I working on android app which will play and record video form remote source

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. 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.

Then you run a command like this to create a PNG or some other image file from the dot.

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. Perhaps there are some additional APIs there that can help.

After you identify your problem elements, use the GST_DEBUG environment variable to add additional logging. For example if you have an x264enc error, use:

GST_DEBUG=2,x264enc:5

That'll set the logging level to error for everything except x264enc which will be debug level.

Also if you run a debugger you can usually look through all the threads and find which element is hanging.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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