revmischa / rtsp-server

Lightweight RTSP/RTP streaming media server
https://metacpan.org/release/RTSP-Server
427 stars 111 forks source link

Can't connect to rtsp server from client. #35

Closed JeffIPV closed 4 years ago

JeffIPV commented 4 years ago

I am able to successfully stream to the server however once I try to view the stream from vlc on my pc I get this error.

pi@iot:~/rtsp-server $ ffmpeg -i http://127.0.0.1/api/gfx/stream.jpg -pix_fmt yuv420p -vcodec libx264 -maxrate 1M -bufsize 2M -tune zerolatency -preset faster -r 5 -f rtsp rtsp://127.0.0.1:5545/stream
ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mpjpeg, from 'http://127.0.0.1/api/gfx/stream.jpg':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1024x768, 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0xab3d20] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0xa9af90] using cpu capabilities: ARMv6 NEON
[libx264 @ 0xa9af90] profile High, level 3.1
[libx264 @ 0xa9af90] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=4 lookahead_threads=4 sliced_threads=1 slices=4 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=250 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1000 vbv_bufsize=2000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Source connection from 127.0.0.1:57806
Got method OPTIONS
Got method ANNOUNCE
Got source announcement for rtsp://127.0.0.1:5545/stream
Mounted /stream
Got method SETUP
Got SETUP request for stream 0
Creating new stream 0
Got method RECORD
Got record for mountpoint /stream
Starting RTP listeners
 |-- stream 0
 |---- port 20000
 |---- port 20001
Output #0, rtsp, to 'rtsp://127.0.0.1:5545/stream':
  Metadata:
    encoder         : Lavf57.56.101
    Stream #0:0: Video: h264 (libx264), yuv420p, 1024x768, q=-1--1, 5 fps, 90k tbn, 5 tbc
    Metadata:
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 1000000/0/0 buffer size: 2000000 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
Source connection from 10.1.7.4:32972ime=00:00:02.20 bitrate=N/A dup=0 drop=41 speed=0.0444x
Got method OPTIONS
Got method DESCRIBE
Got method SETUP
Got SETUP request for stream 0
SETUP request for /stream/streamid=0, but the mountpoint is in use
Returning error 455: Method Not Valid In This State
Got EOF on listener
Source connection from 10.1.7.4:32973
Got method SETUP
Use of uninitialized value $stream_id in concatenation (.) or string at lib/RTSP/Server/Source/Connection.pm line 162.
Got SETUP request for stream
SETUP request for /stream, but the mountpoint is in use
Returning error 455: Method Not Valid In This State
Got method TEARDOWN
frame=   14 fps=0.3 q=13.0 size=N/A time=00:00:02.60 bitrate=N/A dup=0 drop=46 s                                                                                                                               frame=   14 fps=0.2 q=13.0 size=N/A time=00:00:02.60 bitrate=N/A dup=0 drop=46 s                                                                                                                               frame=   24 fps=0.2 q=14.0 size=N/A time=00:00:04.60 bitrate=N/A dup=0 drop=88 speed=0.0422x

VLC errors say

Connection failed:
VLC could not connect to "10.1.7.191:8080".
Your input can't be opened:
VLC is unable to open the MRL 'rtsp://10.1.7.191:8080/stream'. Check the log for details.
Connection failed:
VLC could not connect to "10.1.7.191:8080".
Your input can't be opened:
VLC is unable to open the MRL 'rtsp://10.1.7.191:8080/stream.sdp/streamid=0,'. Check the log for details.
Connection failed:
VLC could not connect to "10.1.7.191:5545".
Connection failed:
VLC could not connect to "10.1.7.191:5545".
JeffIPV commented 4 years ago

Nevermind. Port mismatch use 554 on client!