嗨,我正在尝试构建一个使用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
发布于 2021-02-13 11:46:21
这就对了。你错过了我关于太空的评论。您需要在(
之后和)
之前使用空格
$ ./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
https://stackoverflow.com/questions/66166929
复制相似问题