简体   繁体   English

当图像尺寸较大时,使用 shmsink 和 shmsrc 的 GStreamer 管道停止

[英]When the image size is large, the GStreamer pipeline using shmsink and shmsrc stops

I want to transfer large images through shared memory.我想通过共享 memory 传输大图像。 When I send a 4000x3000 pixel image using shmsink and shmsrc in GStreamer, the image stops after a few frames are displayed.当我在 GStreamer 中使用 shmsink 和 shmsrc 发送 4000x3000 像素图像时,图像会在显示几帧后停止。 However, it doesn't crash, just the image stops.但是,它不会崩溃,只是图像停止。 There are no error messages.没有错误消息。

This is the command for send.这是发送的命令。

gst-launch-1.0 v4l2src device=/dev/video0 \
! "video/x-raw,format=(string)YUY2,width=(int)640,height=(int)480,pixel-aspect-ratio=(fraction)1/1,framerate=(fraction)30/1" \
! videoscale \
! "video/x-raw, width=(int)4000, height=(int)3000" \
! shmsink socket-path=/tmp/foo

And this is command for receive.这是接收命令。

gst-launch-1.0 shmsrc socket-path=/tmp/foo \
! "video/x-raw,format=(string)YUY2,width=(int)4000,height=(int)3000,pixel-aspect-ratio=(fraction)1/1,framerate=(fraction)30/1" \
! xvimagesink

Here's what we tried.这是我们尝试过的。

  • Change the image size to 3600x2700 -> works correctly将图像大小更改为 3600x2700 -> 正常工作
  • Change the shmsink in the send pipeline to xvimagesink -> works correctly将发送管道中的 shmsink 更改为 xvimagesink -> 正常工作

I'm waiting for any advice.我正在等待任何建议。

It's solved.解决了。 I added the option "wait-for-connection=false" to shmsink to prevent it from stopping.我将选项“wait-for-connection=false”添加到 shmsink 以防止它停止。

The receive pipeline remains unchanged, but the send pipeline is now as follows.接收管道保持不变,但发送管道现在如下。

gst-launch-1.0 v4l2src device=/dev/video0 \
! "video/x-raw,format=(string)YUY2,width=(int)640,height=(int)480,pixel-aspect-ratio=(fraction)1/1,framerate=(fraction)30/1" \
! videoscale \
! "video/x-raw, width=(int)4000, height=(int)3000" \
! shmsink socket-path=/tmp/foo wait-for-connection=false

I didn't get the information from anywhere, I just changed all the options of shmsink and it worked by accident.我没有从任何地方获得信息,我只是更改了 shmsink 的所有选项,它意外地起作用了。

I don't know why it worked, so if you can tell me why, I'd appreciate it.我不知道它为什么起作用,所以如果你能告诉我为什么,我将不胜感激。

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

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