takanoha
takanoha

Reputation: 353

Send jpeg images (motion jpeg) through RTSP - gStreamer

Hi I am trying to build a video streaming pipeline using gstreamer and I have a hard time making it work. I have a camera that supports MJPG so I want to pass jpeg image to jpegparse and convert to rtp with rtpjpegpay.

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

For the receiver side I tried VLC player but had no luck opening the file. I am not sure why - does this mean the syntax above is incorrect ?

Can someone please help ?

I tried

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

I have removed name=pay0 pt=96.

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

This is the new error

./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

Upvotes: 2

Views: 6772

Answers (1)

nayana
nayana

Reputation: 3932

There you go. You missed my comment regarding space.. You need to use spaces after ( and before )

$ ./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

This actually works for me when I open it from vlc, no errors.

You forgot to mention that you use: https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c

Upvotes: 5

Related Questions