由于“无效的JPEG文件结构:两个SOF标记”

时间:2016-08-26 15:48:12

标签: udp gstreamer

我使用以下命令通过网络从摄像头接收UDP流:

gst-launch-1.0 udpsrc port=53247 ! jpegdec ! xvimagesink sync=false

我可以在几秒钟内正确接收来自摄像头的视频流,但视频会停止,并显示以下错误消息:

** (gst-launch-1.0:7888): CRITICAL **: gst_adapter_push: assertion 'GST_IS_BUFFER (buf)' failed
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason error (-5)
Execution ended after 0:00:08.152866431
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

有关该流的唯一信息如下:

数据格式:UDP包/ JPEG

图片分辨率:VGA(640 x 480)

帧速率:30 fps

我设法获得有关我的错误的更多信息,将--gst-debug-level=2参数添加到我的命令中。

显示的附加警告消息如下:

0:00:11.518477156  6569      0x2577940 WARN            videodecoder gstvideodecoder.c:3443:_gst_video_decoder_error:<jpegdec0> error: Failed to decode JPEG image
0:00:11.518555417  6569      0x2577940 WARN            videodecoder gstvideodecoder.c:3445:_gst_video_decoder_error:<jpegdec0> error: Decode error #60: Invalid JPEG file structure: two SOF markers
0:00:11.519470502  6569      0x2577990 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
0:00:11.519569256  6569      0x2577990 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason error (-5)

我的命令有什么问题?

1 个答案:

答案 0 :(得分:0)

我终于根据本文的修改找到了解决问题的方法:

Play two webcams in MJPG format simultaneously using gstreamer

功能命令如下(没有调试选项):

k <- k %>% group_by(id) %>%
  mutate(index = row_number()) %>%
  spread(id, value) 

选项gst-launch-1.0 udpsrc port=53247 ! 'image/jpeg,width=640,height=480,framerate=30/1' ! jpegparse ! jpegdec ! autovideosink sync=false 使我的视频在一段时间后滞后,所以我选择了do-timestamp=true选项