Ullaakut / RTSPAllTheThings

Deprecated RTSP media server -- Use github.com/aler9/rtsp-simple-server instead.
Apache License 2.0
275 stars 72 forks source link

Ubuntu Server when try connect to rtsp got 503 #8

Closed sea-kg closed 7 years ago

sea-kg commented 7 years ago

Server Side:

$ gst-launch-1.0 --gst-version GStreamer Core Library version 1.8.3

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial

Run camera_emulation_server

$ sudo ./camera_emulation_server -l 185.53.169.* -b 554

And after I try on client side:

 $ ffplay rtsp://185.53.169.*:554/live.sdp

But got:

method DESCRIBE failed: 503 Service Unavailable
rtsp://185.53.169.*:554/live.sdp: Server returned 5XX Server Error reply

Can you help me what's wrong?

Ullaakut commented 7 years ago

I think using a wildcard in the address argument is probably the reason why this doesn't work. Why did you try using a wildcard here when launching your CES?

jstoja commented 7 years ago

Hello @sea-kg ! I think that you're trying to bind and address 185.53.169.* to avoid exposing it to another subnet, but we're not handling wildcards for bind addresses (because it is incomplete and would mean that we need to know the network mask too).

What you can try is setting the whole IP address of the machine you're using. This would bind correctly to the machine ;) For example:

sudo ./camera_emulation_server -l 185.53.169.42 -b 554

Let us know if it works!

sea-kg commented 7 years ago

Hello @jstoja,

Yes of course I set full address. I just masked my ip address in comment up))) ok. last part of ip-address 102 - you can try connect.

And I can say that before I do same but in local network - and it work but on real server - not work.

Please tell me know if you will be need more information.

jstoja commented 7 years ago

Can you check that you're actually correctly binding to the address and port? (with netstat -ntpl) I just tried and it worked.

root@m1# ./camera_emulation_server -l 192.168.8.27 -b 554
root@m1# netstat -tnpl | grep 554
tcp        0      0 192.168.8.27:554           0.0.0.0:*               LISTEN      10344/camera_emulat

root@m2# ffplay rtsp://192.168.8.27:554/live.sdp
[...]
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
jstoja commented 7 years ago

I also can see that you have 500 errors, do you have some logs on the camera_emulation_server ?

sea-kg commented 7 years ago

I already checked firewall... ;)

$ sudo netstat -tnpl | grep 554
tcp        0      0 185.53.169.102:554      0.0.0.0:*               LISTEN      8969/camera_emulati

It's all that applciation printed:

$ sudo ./camera_emulation_server -l 185.53.169.102 -b 554
Launching stream with the following pipeline: ( videotestsrc ! video/x-raw,width=352,height=288,framerate=25/1 ! queue !x264enc threads=0 key-int-max=25 speed-preset=superfast ! rtph264pay name=pay0 pt=96 )
Stream ready at rtsp://185.53.169.102:554/live.sdp
Ullaakut commented 7 years ago

(I added the bug log even though we don't know yet if the issue comes from our software or from the network configuration, to make it easier for users that might experience the same problem to find it later)

Ullaakut commented 7 years ago

@sea-kg Try setting the GST_DEBUG environment variable to 3 on the machine that runs CES, and restart CES, then show us the ouput (it will probably be super long but no worries)

sea-kg commented 7 years ago

Hello @Ullaakut Log started on try connection by client:

# export GST_DEBUG="*:3" && ./camera_emulation_server -l 185.53.169.102 -b 554 > camera.log
0:00:03.051770861  9862      0x1df8ca0 ERROR           GST_PIPELINE grammar.y:716:priv_gst_parse_yyparse: no element "x264enc"
0:00:03.051851455  9862      0x1df8ca0 ERROR           GST_PIPELINE grammar.y:801:priv_gst_parse_yyparse: link has no sink [source=@0x7f2224014010]
0:00:03.054493550  9862      0x1df8ca0 ERROR           GST_PIPELINE grammar.y:801:priv_gst_parse_yyparse: link has no source [sink=@0x7f2224014370]
0:00:03.054994995  9862      0x1df8ca0 WARN        rtspmediafactory rtsp-media-factory.c:1184:default_create_element: recoverable parsing error: no element "x264enc"
0:00:03.068097940  9862 0x7f221c020c00 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:03.068382655  9862 0x7f221c020d40 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<appsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:03.068868299  9862 0x7f221c020800 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<appsrc1:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:03.074815780  9862 0x7f221c020c00 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:03.074865729  9862 0x7f221c020c00 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason not-linked (-1)
0:00:03.075017141  9862 0x7f221c020c00 WARN                   queue gstqueue.c:992:gst_queue_handle_sink_event:<queue0> error: Internal data flow error.
0:00:03.075173804  9862 0x7f221c020c00 WARN                   queue gstqueue.c:992:gst_queue_handle_sink_event:<queue0> error: streaming task paused, reason not-linked (-1)
0:00:03.075065135  9862 0x7f22240072d0 WARN               rtspmedia rtsp-media.c:2164:default_handle_message: 0x7f2224025410: got error Internal data flow error. (gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:media-pipeline/GstBin:bin0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason not-linked (-1))
0:00:03.075307769  9862      0x1df8ca0 WARN               rtspmedia rtsp-media.c:2459:wait_preroll: failed to preroll pipeline
0:00:03.075344643  9862      0x1df8ca0 WARN               rtspmedia rtsp-media.c:2749:gst_rtsp_media_prepare: failed to preroll pipeline
0:00:03.075327589  9862 0x7f22240072d0 WARN               rtspmedia rtsp-media.c:2164:default_handle_message: 0x7f2224025410: got error Internal data flow error. (gstqueue.c(992): gst_queue_handle_sink_event (): /GstPipeline:media-pipeline/GstBin:bin0/GstQueue:queue0:
streaming task paused, reason not-linked (-1))
0:00:03.080577928  9862      0x1df8ca0 ERROR             rtspclient rtsp-client.c:729:find_media: client 0x1e3d8c0: can't prepare media
0:00:03.080832263  9862      0x1df8ca0 ERROR             rtspclient rtsp-client.c:2239:handle_describe_request: client 0x1e3d8c0: no media
Gegonz commented 7 years ago

Hi @sea-kg,

The error is: 0:00:03.054994995 9862 0x1df8ca0 WARN rtspmediafactory rtsp-media-factory.c:1184:default_create_element: recoverable parsing error: no element "x264enc"

We were missing a dependency in the readme: gstreamer1.0-plugins-ugly Readme was updated accordingly. Thanks for your feedback

Gegon

Ullaakut commented 7 years ago

Issue https://github.com/EtixLabs/CES/issues/10 will contribute to make everything easier by not having any other dependency that docker.

I consider this issue fixed, please let us know if gegon's solution doesn't fix your problem.

sea-kg commented 7 years ago

Thanks! Now is work!

Ullaakut commented 7 years ago

A pleasure, thank you for using CES :) Don't hesitate to tell us if you have other issues!