通过 RTSP - gStreamer 发送 jpeg 图像(motion jpeg)

Send jpeg images (motion jpeg) through RTSP - gStreamer

您好,我正在尝试使用 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

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

之前使用 spaces
$ ./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