gstreamer - 通过 RTSP 发送 jpeg 图像(运动 jpeg) - gStreamer

标签 gstreamer rtsp v4l2

您好,我正在尝试使用 gstreamer 构建视频流管道,但我很难使其工作。我有一个支持 MJPG 的相机,因此我想将 jpeg 图像传递到 jpegparse 并使用 rtpjpegpay 转换为 rtp。

./test-launch --gst-debug=3 '(v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96)'

对于接收端,我尝试了 VLC 播放器,但没有成功打开文件。我不确定为什么 - 这是否意味着上面的语法不正确?

有人可以帮忙吗?

我试过了

examples$ ./test-launch --gst-debug=3 '(v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96)'
stream ready at rtsp://127.0.0.1:8554/test

0:00:05.121994463 207540 0x56458325ef60 ERROR           GST_PIPELINE grammar.y:453:gst_parse_element_set: could not set property "pt" in element "pay0" to "96)"
0:00:05.122054890 207540 0x56458325ef60 WARN                 default grammar.y:1137:priv_gst_parse_yyerror: Error during parsing: syntax error, unexpected $end
0:00:05.122069622 207540 0x56458325ef60 ERROR           GST_PIPELINE grammar.y:1061:priv_gst_parse_yyparse: syntax error
0:00:05.122084053 207540 0x56458325ef60 ERROR           GST_PIPELINE grammar.y:1177:priv_gst_parse_launch: Unrecoverable syntax error while parsing pipeline (v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96)

** (test-launch:207540): CRITICAL **: 10:45:40.048: could not parse launch syntax ((v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96)): could not set property "pt" in element "pay0" to "96)"

** (test-launch:207540): CRITICAL **: 10:45:40.048: could not create element
0:00:05.122267325 207540 0x56458325ef60 ERROR             rtspclient rtsp-client.c:660:find_media: client 0x5645832698b0: can't create media
0:00:05.122341856 207540 0x56458325ef60 ERROR             rtspclient rtsp-client.c:2210:handle_describe_request: client 0x5645832698b0: no media
0:00:05.136507367 207540 0x56458325ef60 ERROR           GST_PIPELINE grammar.y:453:gst_parse_element_set: could not set property "pt" in element "pay0" to "96)"
0:00:05.136559774 207540 0x56458325ef60 WARN                 default grammar.y:1137:priv_gst_parse_yyerror: Error during parsing: syntax error, unexpected $end
0:00:05.136578684 207540 0x56458325ef60 ERROR           GST_PIPELINE grammar.y:1061:priv_gst_parse_yyparse: syntax error
0:00:05.136603260 207540 0x56458325ef60 ERROR           GST_PIPELINE grammar.y:1177:priv_gst_parse_launch: Unrecoverable syntax error while parsing pipeline (v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96)

** (test-launch:207540): CRITICAL **: 10:45:40.062: could not parse launch syntax ((v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96)): could not set property "pt" in element "pay0" to "96)"

** (test-launch:207540): CRITICAL **: 10:45:40.062: could not create element
0:00:05.136801958 207540 0x56458325ef60 ERROR             rtspclient rtsp-client.c:660:find_media: client 0x5645832699a0: can't create media
0:00:05.136884822 207540 0x56458325ef60 ERROR             rtspclient rtsp-client.c:1993:handle_setup_request: client 0x5645832699a0: media '/test' not found

我已删除name=pay0 pt=96

./test-launch --gst-debug=3 '(v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay )'

这是新错误

./test-launch --gst-debug=3 '(v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay )'
stream ready at rtsp://127.0.0.1:8554/test
0:00:04.905440270 207392 0x7f10b8002800 WARN          v4l2bufferpool gstv4l2bufferpool.c:809:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:06.060292605 207392 0x7f10b8002800 FIXME             rtpjpegpay gstrtpjpegpay.c:751:gst_rtp_jpeg_pay_handle_buffer:<rtpjpegpay0> unhandled marker 0xff
0:00:06.060304923 207392 0x7f10b8002800 FIXME             rtpjpegpay gstrtpjpegpay.c:751:gst_rtp_jpeg_pay_handle_buffer:<rtpjpegpay0> unhandled marker 0x00
0:00:06.060308114 207392 0x7f10b8002800 FIXME             rtpjpegpay gstrtpjpegpay.c:751:gst_rtp_jpeg_pay_handle_buffer:<rtpjpegpay0> unhandled marker 0x00
0:00:06.060311498 207392 0x7f10b8002800 FIXME             rtpjpegpay gstrtpjpegpay.c:751:gst_rtp_jpeg_pay_handle_buffer:<rtpjpegpay0> unhandled marker 0x00
0:00:06.060314299 207392 0x7f10b8002800 FIXME             rtpjpegpay gstrtpjpegpay.c:751:gst_rtp_jpeg_pay_handle_buffer:<rtpjpegpay0> unhandled marker 0x00

最佳答案

给你。 你错过了我关于空间的评论.. 您需要在 ( 之后和 )

之前使用空格
$ ./builddir/subprojects/gst-rtsp-server/examples/test-launch '( v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600 ! jpegparse ! rtpjpegpay name=pay0 pt=96 )'
stream ready at rtsp://127.0.0.1:8554/test

当我从 vlc 打开它时,这实际上对我有用,没有错误。

您忘记提及您使用: https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c

关于gstreamer - 通过 RTSP 发送 jpeg 图像(运动 jpeg) - gStreamer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66166929/

相关文章:

c - DQBUF 的 ioctl 的 V4L2 无效参数

gstreamer - 使用 Gstreamer 压缩 H264 流

java - 从扩展 RTP 数据包头解码 unix 时间戳以计算延迟

javascript - 如何开发网络浏览器插件而不是 NPAPI(大多数浏览器已弃用)?

OpenCV - 在版本 3.4 中使用 FFMPEG 通过 RTSP 流式传输 H264

v4l2 - modprobe : ERROR: could not insert 'v4l2loopback' : Unknown symbol in module, 或未知参数(参见 dmesg)

c++ - Yocto OpenCV w/GStreamer 安装问题

macos - mac上的gstreamer错误

opengl - 如何使用 gstreamer crates 从 BufferRef 中提取 GL 纹理 ID?

c++ - v4l2 很简单的例子