You are not logged in.

#1 2020-07-26 18:23:18

gearhead
Member
Registered: 2018-03-24
Posts: 56

[Solved][ffmpeg] does not play rtsp stream

I am trying to get mpd to play an rtsp audio stream. mpd uses ffmpeg for these streams, or so it appears, so I am tyying to get it to play, first, in ffmpeg. A bit of research and it seems to be capable of it. If I use vlc or mpv, I can watch a local video stream form my camera. If I try that same stream in ffmpeg, I get an error. If I play the audio stream in vlc it plays fine.

in VLC, if I put this link in as a 'Network Stream', I can hear the stream playing (no video):

rtsp://wowza.radia.cz:1935/CRo/DDur.stream

If I try to play it with ffmpeg, I get this:

$ ffplay -v debug -nodisp -rtsp_flags listen -i rtsp://wowza.radia.cz:1935/CRo/DDur.stream
ffplay version n4.3.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[tcp @ 0x7fafb0003000] No default whitelist setKB sq=    0B f=0/0
[rtsp @ 0x7fafb0000bc0] Unable to open RTSP for listening0B f=0/0
rtsp://wowza.radia.cz:1935/CRo/DDur.stream: Cannot assign requested address
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

If I try a local video address, I get the same result. This link in vlc or mpv plays fine:

rtsp://admin:xxxx@192.168.2.252:554/11

If I try it in ffmpeg, I get the same error:

$ ffplay -v debug -rtsp_flags listen -i rtsp://admin:xxxx@192.168.2.252:554/11
ffplay version n4.3.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Initialized opengl renderer.
[tcp @ 0x7fada0003000] No default whitelist set
[rtsp @ 0x7fada0000bc0] Unable to open RTSP for listening
rtsp://admin:xxxx@192.168.2.252:554/11: Cannot assign requested address

Do I need to re-build ffmpeg with another flag set? Am I doing something wrong on the command line?

Last edited by gearhead (2020-07-26 18:37:12)

Offline

#2 2020-07-26 18:36:45

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: [Solved][ffmpeg] does not play rtsp stream

Forget it. I figured it out, finally. IN case someone runs across this, the solution for my audio stream was to change the CLI input:
I finally was able to get a connection this way:

ffplay -nodisp "rtsp://wowza.radia.cz:1935/CRo/DDur.stream"

Now to figure out why I cannot in MPD

Offline

#3 2020-07-26 21:56:28

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: [Solved][ffmpeg] does not play rtsp stream

I was able to play that with:

ffplay rtsp://wowza.radia.cz:1935/CRo/DDur.stream

mplayer rtsp://wowza.radia.cz:1935/CRo/DDur.stream

mpv rtsp://wowza.radia.cz:1935/CRo/DDur.stream

Also:

rtmpdump -r rtsp://wowza.radia.cz:1935/CRo/DDur.stream -o test

file test
test: Macromedia Flash Video

ffprobe test
...
Input #0, flv, from 'test':
  Metadata:
    StreamTitle     : 
  Duration: 00:00:31.91, start: 0.000000, bitrate: 83 kb/s
    Stream #0:0: Audio: aac (HE-AAC), 44100 Hz, stereo, fltp

Offline

#4 2020-07-27 00:20:27

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: [Solved][ffmpeg] does not play rtsp stream

yep, but when tried on a headless install, it fails because ffplay wants to use a screen:

Could not initialize SDL - No available video device
(Did you set the DISPLAY variable?)

Offline

#5 2020-07-27 16:57:15

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: [Solved][ffmpeg] does not play rtsp stream

I was curious so I checked my notes. I opened a tty and was able to play that stream, and I think one that has video, with:

#!/usr/bin/bash

#mplayer -vo fbdev2 -vf scale=160:120 rtsp://wowza.radia.cz:1935/CRo/DDur.stream

ffmpeg -re -i rtsp://wowza.radia.cz:1935/CRo/DDur.stream -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0

ffmpeg output to /dev/fb0 played that classical music in tty.

ffmpeg has a thousand settings. Does that help.

Last edited by teckk (2020-07-27 16:58:04)

Offline

#6 2020-07-28 10:35:35

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: [Solved][ffmpeg] does not play rtsp stream

I tried

ffplay "rtsp://wowza.radia.cz:1935/CRo/DDur.stream"

several times, it always worked (nice music btw).
However, yesterday I tried in in another tty and while it kept on playing & updating the text on screen, the keyboard was completely disabled, I couldn't switch back into Xorg and evtl. had to shut down hard.
Any idea how I could've avoided that?

Offline

#7 2020-07-28 21:24:48

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: [Solved][ffmpeg] does not play rtsp stream

There aren't too many rtsp streams around anymore to check against.

Here is one
https://www.wowza.com/html/mobile.html

This works in X, audio and video.

mplayer rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

ffplay rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

I opened another tty

test.sh

#!/usr/bin/bash

mplayer -vo fbdev2 -vf scale=300:-0 rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

That runs as user on an AMD machine. I did the same on an Intel machine and I had to be root to get perm to fbdev2. I don't know what I have different on the 2 machines.

In tty, this plays audio, no video, and just like you, no keyboard to stop.

ffplay rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

I can access frambuffer with

ffmpeg -re -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0

Last edited by teckk (2020-07-28 21:25:12)

Offline

#8 2020-07-29 11:08:01

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: [Solved][ffmpeg] does not play rtsp stream

teckk wrote:

In tty, this plays audio, no video, and just like you, no keyboard to stop.

ffplay rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

How did you get out of it?

Offline

#9 2020-07-29 12:23:42

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: [Solved][ffmpeg] does not play rtsp stream

Hard poweroff. I did not try and see if keyboard returned when the stream was done.

ffplay -autoexit -t 00:00:10 <file>

Offline

#10 2020-07-29 12:32:21

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: [Solved][ffmpeg] does not play rtsp stream

^ Thanks for the confirmation.
IMHO ffplay is an analysis tool, not to be used as a media player, and permitted to be prone to such problems, I just wanted to make sure that I'm not missing anything obvious.
I can try the -autoexit thing in a second (after logging out here).

Offline

#11 2020-07-29 12:37:04

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: [Solved][ffmpeg] does not play rtsp stream

Here is a .pdf of ffplay documentation that I made a couple years back if you want it.

du -ch ffplaydoc.pdf
1.2M   ffplaydoc.pdf
1.2M   total

md5sum ffplaydoc.pdf
4300da619cf4a81572e241458d76b4d8 ffplaydoc.pdf

curl -F 'file=@ffplaydoc.pdf' https://0x0.st
https://0x0.st/ixBr.pdf

Offline

#12 2020-07-29 12:44:57

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: [Solved][ffmpeg] does not play rtsp stream

https://0x0.st/ixBr.pdf
Only ffplay, not ffmpeg?
How does this differ from the content here: https://ffmpeg.org/ffplay.html ?
I can see it's much larger.
It says nothing about which version it's for?

Offline

#13 2020-07-29 12:52:46

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: [Solved][ffmpeg] does not play rtsp stream

ffplay has some of it's own switches as I recall, different from ffmpeg. Kind of hard to find docs on ffplay. ffmpeg is well documented.

The version? I don't know, that doc it still relevant for ffplay.

Offline

Board footer

Powered by FluxBB