[FFmpeg-user] trouble with serving rtsp

Daniel Schultze kinglag at gmail.com
Sat Oct 25 03:05:22 CEST 2014


Hello All,

 I'm trying to serve an mp4 video over rtsp but for some reason ffplay
will not play the video stream. I am at a loss about what to do next.
Please advise on how I can view the stream via rtsp.

# O/S info
$ uname -r
3.16.6-200.fc20.x86_64

######
# ffserver.conf
######

HTTPPort 8080
RTSPPort 8554

HTTPBindAddress 0.0.0.0
RTSPBindAddress 0.0.0.0

MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000

CustomLog -

<Feed mycam1.ffm>
        ACL allow localhost
        ACL allow 127.0.0.1
        ACL allow 192.168.0.0 192.168.255.255
</Feed>

<Stream mycam1>
        NoAudio
        Format rtsp
        Feed mycam1.ffm
</Stream>

######
# ffserver output
# built from 2.4.2 source release (2.1.5 was originally tried with the
same errors)
######
$ ./ffserver -v verbose
ffserver version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct 24 2014 17:26:26 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-7)
  configuration: --enable-nonfree
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
Fri Oct 24 17:46:37 2014 FFserver started.

# ffmpeg stream connect
Fri Oct 24 17:49:04 2014 127.0.0.1 - - [GET] "/mycam1.ffm HTTP/1.1" 200 4175
# $ ffplay -v debug rtsp://localhost:8080/mycam1
Fri Oct 24 17:49:17 2014 127.0.0.1 - - [OPTIONS] " " 200 0
# ffplay -v debug rtsp://localhost:8554/mycam1
Fri Oct 24 17:49:26 2014 127.0.0.1 - - [DESCRIBE]
"rtsp://localhost:8554/mycam1 RTSP/1.0" 200 157
# $ ffplay -v debug http://localhost:8554/mycam1
Fri Oct 24 17:52:16 2014 127.0.0.1 - - [GET] "/mycam1 HTTP/1.1" 200 89
# $ ffplay -v debug http://localhost:8080/mycam1
Fri Oct 24 17:53:13 2014 [rtsp @ 0x2a60370]Codec for stream 0 does not
use global headers but container format requires global headers
Fri Oct 24 17:53:13 2014 [rtsp @ 0x2a60370]Codec for stream 1 does not
use global headers but container format requires global headers
Fri Oct 24 17:53:13 2014 [tcp @ 0x2a68600]Connection to
tcp://:554?timeout=0 failed (Connection refused), trying next address
Fri Oct 24 17:53:13 2014 [tcp @ 0x2a68600]Connection to
tcp://:554?timeout=0 failed: Connection refused
Fri Oct 24 17:53:13 2014 Error writing output header for stream
'mycam1': Input/output error
Fri Oct 24 17:53:13 2014 127.0.0.1 - - [GET] "/mycam1 HTTP/1.1" 200 79

######
# ffprobe
######
$ ffprobe cam1.mp4
ffprobe version 2.1.5 Copyright (c) 2007-2014 the FFmpeg developers
  built on Jul  8 2014 20:44:17 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass
--enable-libcdio --enable-libcelt --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads
--disable-static --enable-shared --enable-gpl --disable-debug
--disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cam1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : IP Camera Video
    encoder         : Lavf55.19.104
    comment         : videoMain
  Duration: 00:44:31.00, start: 0.000000, bitrate: 389 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1280x720, 389 kb/s, 1 fps, 1 tbr, 16384 tbn, 2 tbc (default)
    Metadata:
      handler_name    : VideoHandler

######
# ffmpeg
# rpm fusion release
######

$ ffmpeg -r 1 -i /tmp/cam1.mp4 -f lavfi -i aevalsrc=0 -c:a pcm_s16le
-vcodec copy -strict -2 http://127.0.0.1:8080/mycam1.ffm
ffmpeg version 2.1.5 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul  8 2014 20:44:17 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass
--enable-libcdio --enable-libcelt --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads
--disable-static --enable-shared --enable-gpl --disable-debug
--disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/cam1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : IP Camera Video
    encoder         : Lavf55.19.104
    comment         : videoMain
  Duration: 00:44:31.00, start: 0.000000, bitrate: 389 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1280x720, 389 kb/s, 1 fps, 1 tbr, 16384 tbn, 2 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #1, lavfi, from 'aevalsrc=0':
  Duration: N/A, start: 0.000000, bitrate: 2822 kb/s
    Stream #1:0: Audio: pcm_f64le, 44100 Hz, mono, dbl, 2822 kb/s
Output #0, ffm, to 'http://127.0.0.1:8080/mycam1.ffm':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : IP Camera Video
    creation_time   : now
    comment         : videoMain
    encoder         : Lavf55.19.104
    Stream #0:0: Audio: aac, 22050 Hz, mono, fltp, 128 kb/s
    Stream #0:1(und): Video: h264 (avc1 / 0x31637661), yuv420p,
1280x720, q=2-31, 389 kb/s, 1 fps, 1000k tbn, 1 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #1:0 -> #0:0 (pcm_f64le -> aac)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help


######
# ffplay
# attempt 1/4
$ ffplay -v debug rtsp://localhost:8080/mycam1
ffplay version 2.1.5 Copyright (c) 2003-2014 the FFmpeg developers
  built on Jul  8 2014 20:44:17 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass
--enable-libcdio --enable-libcelt --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads
--disable-static --enable-shared --enable-gpl --disable-debug
--disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[tcp @ 0x7fb3a4001620] Connection to tcp://localhost:8080?timeout=0
failed (Connection refused), trying next address
rtsp://localhost:8080/mycam1: Invalid data found when processing input

######
# ffplay
# attempt 2/4
$ ffplay -v debug rtsp://localhost:8554/mycam1
ffplay version 2.1.5 Copyright (c) 2003-2014 the FFmpeg developers
  built on Jul  8 2014 20:44:17 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass
--enable-libcdio --enable-libcelt --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads
--disable-static --enable-shared --enable-gpl --disable-debug
--disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[tcp @ 0x7f8fa4001620] Connection to tcp://localhost:8554?timeout=0
failed (Connection refused), trying next address
[rtsp @ 0x7f8fa40008c0] method DESCRIBE failed: 404 Not Found
[rtsp @ 0x7f8fa40008c0] CSeq: 2
Date: Sat, 25 Oct 2014 00:49:26 GMT

rtsp://localhost:8554/mycam1: Invalid data found when processing input

######
# ffplay
# attempt 3/4
ffplay -v debug http://localhost:8554/mycam1
ffplay version 2.1.5 Copyright (c) 2003-2014 the FFmpeg developers
  built on Jul  8 2014 20:44:17 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass
--enable-libcdio --enable-libcelt --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads
--disable-static --enable-shared --enable-gpl --disable-debug
--disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[tcp @ 0x7f3ee0005720] Connection to tcp://localhost:8554 failed
(Connection refused), trying next address
[http @ 0x7f3ee0001620] HTTP error 505 RTSP Version not Supported
http://localhost:8554/mycam1: Input/output error

######
# ffplay
# attempt 4/4
$ ffplay -v debug rtsp://localhost:8554/mycam1
ffplay version 2.1.5 Copyright (c) 2003-2014 the FFmpeg developers
  built on Jul  8 2014 20:44:17 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass
--enable-libcdio --enable-libcelt --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads
--disable-static --enable-shared --enable-gpl --disable-debug
--disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[tcp @ 0x7f8fa4001620] Connection to tcp://localhost:8554?timeout=0
failed (Connection refused), trying next address
[rtsp @ 0x7f8fa40008c0] method DESCRIBE failed: 404 Not Found
[rtsp @ 0x7f8fa40008c0] CSeq: 2
Date: Sat, 25 Oct 2014 00:49:26 GMT

rtsp://localhost:8554/mycam1: Invalid data found when processing input


More information about the ffmpeg-user mailing list