Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armbian no RTSP support #930

Closed
skidoo23 opened this issue Aug 1, 2020 · 20 comments
Closed

Armbian no RTSP support #930

skidoo23 opened this issue Aug 1, 2020 · 20 comments

Comments

@skidoo23
Copy link
Contributor

skidoo23 commented Aug 1, 2020

Bug report

Describe the bug

MPD is compiled with ffmpeg support but rtsp is not listed as supported protocol. See mpd --version below.

Expected Behavior

List and support rtsp.

Actual Behavior

$ mpc add rtsp://wowza.radia.cz:1935/CRo/DDur.stream
error adding rtsp://wowza.radia.cz:1935/CRo/DDur.stream: Unsupported URI scheme

Version

$ uname -a
Linux hostname 5.4.45-sunxi #20.05.3 SMP Wed Jun 10 12:09:20 CEST 2020 armv7l GNU/Linux

$ mpd --version
Music Player Daemon 0.22~git (v0.21.25-1041-gdbdf782e5)
Copyright 2003-2007 Warren Dukes [email protected]
Copyright 2008-2018 Max Kellermann [email protected]
This is free software; see the source for copying conditions. There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
simple proxy

Storage plugins:
local udisks

Neighbor plugins:
udisks

Decoders plugins:
[mad] mp3 mp2
[mpg123] mp3
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[opus] opus ogg oga
[sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
[audiofile] wav au aiff aif
[faad] aac
[mpcdec] mpc
[wavpack] wv
[modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
[mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
[sidplay] sid mus str prg P00
[wildmidi] mid
[fluidsynth] mid
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
[gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
[pcm]

Filters:
libsamplerate soxr

Tag plugins:
id3tag

Output plugins:
null fifo pipe alsa httpd

Encoder plugins:
null vorbis opus lame flac

Archive plugins:
[bz2] bz2
[zzip] zip
[iso] iso

Input plugins:
file io_uring archive alsa curl ffmpeg mms

Playlist plugins:
extm3u m3u pls xspf asx rss flac cue embcue

Protocols:
file:// alsa:// ftp:// ftps:// gopher:// http:// https:// mms:// mmsh:// mmst:// mmsu:// rtmp:// rtmps:// rtmpt:// rtmpts:// rtp:// scp:// sftp:// smb:// srtp://

Other features:
avahi dbus udisks epoll icu inotify systemd tcp un

Log

mpd --stdout --no-daemon --verbose

config_file: loading file /etc/mpd.conf
path: SetFSCharset: fs charset is:
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.6
opus: libopus 1.3
sndfile: libsndfile-1.0.28
simple_db: reading DB
curl: version 7.68.0
curl: with GnuTLS/3.6.14
avahi: Initializing interface
exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
avahi: Client changed to state 101
avahi: Client is CONNECTING
state_file: Loading state file /var/lib/mpd/state
client: [0] opened from 127.0.0.1:43000
client: [0] process command list
client: process command "add "rtsp://wowza.radia.cz:1935/CRo/DDur.stream""
exception: Unsupported URI scheme
client: command returned 3
client: [0] process command list returned 3
client: [0] closed

@leigh123linux
Copy link
Contributor

Does this work?

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

@skidoo23
Copy link
Contributor Author

skidoo23 commented Aug 1, 2020

Installed ffmpeg

$ ffplay rtsp://wowza.radia.cz:1935/CRo/DDur.stream
ffplay version 4.3-3+b2 Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 10 (Debian 10.2.0-3)
configuration: --prefix=/usr --extra-version=3+b2 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Could not initialize SDL - No available video device
(Did you set the DISPLAY variable?)

@skidoo23
Copy link
Contributor Author

skidoo23 commented Aug 1, 2020

Headless server. $ export DISPLAY=:0 did not help.

@leigh123linux
Copy link
Contributor

Try

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

If that fails post

ffmpeg -demuxers |grep rtsp

and

ffmpeg -muxers |grep rtsp

@skidoo23
Copy link
Contributor Author

skidoo23 commented Aug 1, 2020

$ ffplay -nodisp rtsp://wowza.radia.cz:1935/CRo/DDur.stream
ffplay version 4.3-3+b2 Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 10 (Debian 10.2.0-3)
configuration: --prefix=/usr --extra-version=3+b2 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
xcb_connection_has_error() returned true
[udp @ 0xab606970] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[udp @ 0xab616cb0] attempted to set receive buffer to size 393216 but it only ended up set as 360448

$ ffmpeg -demuxers |grep rtsp
ffmpeg version 4.3-3+b2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10 (Debian 10.2.0-3)
configuration: --prefix=/usr --extra-version=3+b2 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
D rtsp RTSP input

$ ffmpeg -muxers |grep rtsp
ffmpeg version 4.3-3+b2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10 (Debian 10.2.0-3)
configuration: --prefix=/usr --extra-version=3+b2 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
E rtsp RTSP output

@leigh123linux
Copy link
Contributor

leigh123linux commented Aug 1, 2020

The stream doesn't play here

playlist: play 0:"rtsp://wowza.radia.cz:1935/CRo/DDur.stream"
client: [0] command returned 0
exception: Failed to decode rtsp://wowza.radia.cz:1935/CRo/DDur.stream; Protocol not found
player: played "rtsp://wowza.radia.cz:1935/CRo/DDur.stream"
playlist: stop
client: [0] process command "status"

I have rtsp protocol listed

mpd --version
Music Player Daemon 0.21.25 (0.21.25)
Copyright 2003-2007 Warren Dukes <[email protected]>
Copyright 2008-2018 Max Kellermann <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient udisks nfs curl

Neighbor plugins:
 smbclient upnp udisks

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [faad] aac
 [wavpack] wv
 [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [sidplay] sid mus str prg P00
 [wildmidi] mid
 [fluidsynth] mid
 [adplug] amd d00 hsc laa rad raw sa2
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe alsa ao oss openal pulse jack httpd recorder

Encoder plugins:
 null vorbis opus lame twolame wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip
 [iso] iso

Input plugins:
 file archive alsa tidal qobuz curl ffmpeg smbclient nfs mms cdio_paranoia

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// tidal:// qobuz:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// nfs:// mms:// mmsh:// mmst:// mmsu:// cdda://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

mpd.conf


############################################################################
### begin of mpd configuration file
### created by `mpd-configure' (version 0.9.8) on 2019-01-14T20:06:51+00:00.
### see: https://gitlab.com/ronalde/mpd-configure/
############################################################################
## start processing `01_output-audio-alsa.conf'
audio_output {
	type             "alsa"
	name             "D10"
	device           "iec958:CARD=D10,DEV=0"
	auto_resample    "no"
	auto_format      "no"
	auto_channels    "no"
	replay_gain_handler "none"
    mixer_type       "disabled"
}
replaygain                 "off"
## done processing

## start processing `02_paths.conf'
music_directory                   "/home/leigh/Music"
log_file                          "/home/leigh/.config/mpd/mpd.log"
playlist_directory                "/home/leigh/.config/mpd/playlists"
pid_file                          "/home/leigh/.config/mpd/pid"
state_file                        "/home/leigh/.config/mpd/state"
sticker_file                      "/home/leigh/.config/mpd/sticker"
save_absolute_paths_in_playlists  "no"
## done processing

## start processing `03_general.conf'
filesystem_charset    "UTF-8"
log_level             "default"
auto_update           "yes"
auto_update_depth     "4096"
## done processing

## start processing `04_client-limits.conf'
connection_timeout     "60"
max_connections        "10"
max_playlist_length    "16384"
max_command_list_size  "2048"
max_output_buffer_size "8192"
## done processing

## start processing `05_network.conf'
bind_to_address "0.0.0.0"
## done processing

## start processing `06_zeroconf.conf'
zeroconf_enabled    "no"
## done processing

decoder {
        plugin "wildmidi"
        enabled "no"
}

decoder {
    plugin          "hybrid_dsd"
    enabled         "no"
    }

input {
        plugin "qobuz"
        enabled "no"
}

input {
        plugin "tidal"
        enabled "no"
}

############################################################################
### end of mpd configuration file
############################################################################

ffplay can play it, note it switches from UDP to TCP to play.

ffplay rtsp://wowza.radia.cz:1935/CRo/DDur.stream
ffplay version 4.2.4 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rtsp @ 0x7fc0f4000bc0] UDP timeout, retrying with TCP   0B f=0/0   
Input #0, rtsp, from 'rtsp://wowza.radia.cz:1935/CRo/DDur.stream':  
  Metadata:
    title           : DDur.stream
  Duration: N/A, start: 0.092018, bitrate: N/A
    Stream #0:0: Audio: aac (HE-AAC), 44100 Hz, stereo, fltp
   5.56 M-A:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

@MaxKellermann
Copy link
Member

What makes you believe this is specific to Armbian?

@skidoo23
Copy link
Contributor Author

skidoo23 commented Aug 3, 2020

You are right it. It applies to x86_64 Linux too.

@leigh123linux
Copy link
Contributor

I forgot to mention I was using x86_64

inxi -S
System:    Host: mpd.lan Kernel: 5.7.10-201.fc32.x86_64 x86_64 bits: 64 Desktop: Cinnamon 4.6.6 
           Distro: Fedora release 32 (Thirty Two)

@doronbehar
Copy link

I also experience this issue here on x86_64, NixOS. I get protocol not found and mpd --version | grep rtsp lists rtsp:// as a supported protocol. Running with --verbose doesn't yield much more information.

@MaxKellermann
Copy link
Member

The fix is to remove RTSP from the list of supported protocols, unfortunately. MPD expects input plugins to provide a stream of data, but FFmpeg implements RTSP as a demuxer plugin and not protocol handler (https://ffmpeg.org/ffmpeg-protocols.html#rtsp), which MPD cannot support currently.

@doronbehar
Copy link

I don't know a thing about demuxing / streaming. But, it's a bit surprising, because I was able to use ffplay to play a rtsp stream, following the commands here:

https://github.com/aler9/rtsp-simple-server#installation-and-basic-usage

@MaxKellermann
Copy link
Member

True, because ffplay uses all FFmpeg features, while this MPD plugin can only use FFmpeg's URL plugins.
MPD's declaration of RTSP was wrong, and if you want RTSP, MPD needs a new feature (as a different type of plugin).

@leigh123linux
Copy link
Contributor

leigh123linux commented Sep 16, 2020

True, because ffplay uses all FFmpeg features, while this MPD plugin can only use FFmpeg's URL plugins.
MPD's declaration of RTSP was wrong, and if you want RTSP, MPD needs a new feature (as a different type of plugin).

You don't need ffplay, ffmpeg can do it directly

get device number from

 pactl list short sinks
1	alsa_output.usb-Topping_D10-00.analog-stereo	module-alsa-card.c	s32le 2ch 96000Hz	SUSPENDED
3	alsa_output.pci-0000_00_0e.0.hdmi-stereo	module-alsa-card.c	s16le 2ch 48000Hz	IDLE
ffmpeg -i rtsp://wowza.radia.cz:1935/CRo/DDur.stream -f pulse -device 3 whatever_name
ffmpeg -i rtsp://wowza.radia.cz:1935/CRo/DDur.stream -f pulse -device 1 stream
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-liblensfun --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libglslang --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect
  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
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[rtsp @ 0x559324d707c0] UDP timeout, retrying with TCP
Input #0, rtsp, from 'rtsp://wowza.radia.cz:1935/CRo/DDur.stream':
  Metadata:
    title           : DDur.stream
  Duration: N/A, start: 0.092018, bitrate: N/A
    Stream #0:0: Audio: aac (HE-AAC), 44100 Hz, stereo, fltp
Stream mapping:
  Stream #0:0 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, pulse, to 'stream':
  Metadata:
    title           : DDur.stream
    encoder         : Lavf58.45.100
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
    Metadata:
      encoder         : Lavc58.91.100 pcm_s16le
size=N/A time=00:00:42.81 bitrate=N/A speed=   1x

It connects quicker if you specify tcp for this stream.

ffmpeg -rtsp_transport tcp -i rtsp://wowza.radia.cz:1935/CRo/DDur.stream -f pulse -device 1 stream

@doronbehar
Copy link

Thanks @MaxKellermann & @leigh123linux for explaining. In general, I'd love to have some kind of ability to stream a media file from my desktop, to an mpd server, using mpc --host=server add protocol://my-ip/stream.

Besides RTSP, for which I found https://github.com/aler9/rtsp-simple-server which made the streaming setup somewhat easy, I wasn't able to setup something that works with the other supposedly supported protocols. I tried RTP with instructions from here and after trying to play the stream by mpd, it got stuck, and I don't know if it's the way I called ffmpeg.

P.S the gopher:// protocol has no mention in the internet besides in ffmpeg's source code.

@doronbehar
Copy link

It's cool that ffmpeg can be setup to stream these urls directly, but it could be awesome to be able to control it all via an mpd client such as ncmpcpp.

@MaxKellermann
Copy link
Member

I'll write a new decoder plugin for MPD 0.22 which uses FFmpeg demuxers like RTSP. Do you want to write a new issue requesting this feature?

@doronbehar
Copy link

I'll write a new decoder plugin for MPD 0.22 which uses FFmpeg demuxers like RTSP. Do you want to write a new issue requesting this feature?

That'd probably be helpful. Great :). I'm not sure I need to open a new issue, because I don't know if MPD is missing the feature I'm looking for. Basically, I'm only looking for an easy enough setup that will allow me to stream from a desktop to an MPD instance that's connected to my high end DAC and speakers.

For comparison, the curl based http:// plugin would require me to run a web server, and write a script that will modify it to stream an arbitrary file on the fly. With the other network protocols supported by ffmpeg's plugin, rtp://, rtmp://, rtmpt://, rtmps:// gopher:// I had no success either. Perhaps could you please setup a MWE that will demonstrate how to stream via any of these protocols to a MPD? I assume you tested it when you wrote this?

MaxKellermann added a commit that referenced this issue Sep 21, 2020
This implements the feature that was missing/broken in this bug
report: #930
@MaxKellermann
Copy link
Member

Done - the FFmpeg decoder plugin can now play rtsp:// directly, without the input plugin.

@doronbehar
Copy link

RTSP is supposed to be more advanced then RTP, according to this. Perhaps RTP support should be dropped in favor of RTSP? #959 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants