cvlc 无法播放 rtsp(omxplayer 可以)

cvlc cannot play rtsp (omxplayer instead can)

收到大华语音串流link:可以用omxplayer,但是vlc 不能播放:

rtsp://user:pass@ipadd:554/cam/realmonitor/channel=1&subtype=1

这是 vlc 的输出:

VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[000055b9be2245b0] main libvlc debug: VLC media player - 3.0.16 Vetinari
[000055b9be2245b0] main libvlc debug: Copyright © 1996-2021 the VideoLAN team
[000055b9be2245b0] main libvlc debug: revision 3.0.13-8-g41878ff4f2
[000055b9be2245b0] main libvlc debug: configured with ./configure  '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-debug' '--config-cache' '--disable-update-check' '--enable-fast-install' '--docdir=/usr/share/doc/vlc' '--with-binary-version=3.0.16-1' '--enable-a52' '--enable-aa' '--enable-aribsub' '--enable-avahi' '--enable-bluray' '--enable-caca' '--enable-chromaprint' '--enable-chromecast' '--enable-dav1d' '--enable-dbus' '--enable-dca' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gles2' '--enable-gnutls' '--enable-harfbuzz' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libxml2' '--enable-lirc' '--enable-mad' '--enable-matroska' '--enable-mod' '--enable-mpc' '--enable-mpg123' '--enable-mtp' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-opus' '--enable-pulse' '--enable-qt' '--enable-realrtsp' '--enable-samplerate' '--enable-sdl-image' '--enable-sftp' '--enable-shine' '--enable-shout' '--enable-skins2' '--enable-sndio' '--enable-soxr' '--enable-spatialaudio' '--enable-speex' '--enable-svg' '--enable-svgdec' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vdpau' '--enable-vnc' '--enable-vorbis' '--enable-x264' '--enable-x265' '--enable-zvbi' '--with-kde-solid=/usr/share/solid/actions/' '--disable-aom' '--disable-crystalhd' '--disable-d3d11va' '--disable-decklink' '--disable-directx' '--disable-dsm' '--disable-dxva2' '--disable-fdkaac' '--disable-fluidlite' '--disable-freerdp' '--disable-goom' '--disable-gst-decode' '--disable-libtar' '--disable-live555' '--disable-macosx' '--disable-macosx-avfoundation' '--disable-macosx-qtkit' '--disable-mfx' '--disable-microdns' '--disable-opencv' '--disable-projectm' '--disable-schroedinger' '--disable-sparkle' '--disable-srt' '--disable-telx' '--disable-vpx' '--disable-vsxu' '--disable-wasapi' '--enable-alsa' '--enable-dc1394' '--enable-dv1394' '--enable-libplacebo' '--enable-linsys' '--enable-nfs' '--enable-udev' '--enable-v4l2' '--enable-wayland' '--enable-libva' '--enable-vcd' '--enable-smbclient' '--disable-oss' '--enable-mmx' '--enable-sse' '--disable-neon' '--disable-altivec' '--disable-omxil' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security ' 'OBJCFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security'
[000055b9be2e1700] main audio output debug: looking for audio output module matching "any": 6 candidates
[000055b9be2e1700] vlcpulse audio output debug: using library version 14.2.0
[000055b9be2e1700] vlcpulse audio output debug:  (compiled with version 14.2.0, protocol 34)
[000055b9be2e1700] vlcpulse audio output debug: connected locally to /run/user/1000/pulse/native as client #10650
[000055b9be2e1700] vlcpulse audio output debug: using protocol 34, server protocol 34
[000055b9be2e1700] pulse audio output debug: adding sink 1: alsa_output.pci-0000_00_1f.3.analog-stereo (Built-in Audio Analog Stereo)
[000055b9be2e1700] pulse audio output debug: adding sink 2: ec_ref (Built-in Audio Analog Stereo (echo cancelled with Built-in Audio Analog Stereo))
[000055b9be2e1700] pulse audio output debug: adding sink 16: alsa_output.pci-0000_01_00.1.hdmi-stereo-extra3 (GM107 High Definition Audio Controller [GeForce 940MX] Digital Stereo (HDMI 4))
[000055b9be2e1700] main audio output debug: using audio output module "pulse"
[000055b9be2caff0] main playlist debug: keeping audio output
[000055b9be310c40] main interface debug: looking for interface module matching "dbus,none": 19 candidates
[000055b9be310c40] dbus interface debug: listening on dbus as: org.mpris.MediaPlayer2.vlc
[000055b9be310c40] main interface debug: using interface module "dbus"
[000055b9be3154c0] main interface debug: looking for interface module matching "hotkeys,none": 19 candidates
[000055b9be3154c0] main interface debug: using interface module "hotkeys"
[000055b9be315e90] main interface debug: looking for interface module matching "globalhotkeys,none": 19 candidates
[000055b9be310c40] dbus interface debug: Getting All properties
[000055b9be310c40] dbus interface debug: Getting All properties
[000055b9be315e90] main interface debug: using interface module "xcb_hotkeys"
[000055b9be3177f0] main interface debug: looking for interface module matching "dummy": 19 candidates
[000055b9be3177f0] dummy interface: using the dummy interface module...
[000055b9be3177f0] main interface debug: using interface module "dummy"
[000055b9be2caff0] main playlist debug: processing request item: null, node: Scaletta, skip: 0
[000055b9be2caff0] main playlist debug: rebuilding array of current - root Scaletta
[000055b9be2caff0] main playlist debug: rebuild done - 1 items, index -1
[000055b9be2caff0] main playlist debug: starting playback of new item
[000055b9be2caff0] main playlist debug: resyncing on rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1
[000055b9be2caff0] main playlist debug: rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1 is at 0
[000055b9be2caff0] main playlist debug: creating new input thread
[00007ff0bc000c80] main input debug: Creating an input for 'rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1'
[000055b9be2caff0] main playlist debug: requesting art for new input thread
[00007ff0bc000c80] main input debug: using timeshift granularity of 50 MiB
[00007ff0bc000c80] main input debug: using default timeshift path
[00007ff0bc000c80] main input debug: `rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1' gives access `rtsp' demux `any' path `user:pass@address:554/cam/realmonitor/channel=1&subtype=1'
[00007ff0b0000fa0] main input source debug: creating demux: access='rtsp' demux='any' location='user:pass@address:554/cam/realmonitor/channel=1&subtype=1' file='(null)'
[00007ff0b0001160] main demux debug: looking for access_demux module matching "rtsp": 16 candidates
[00007ff0a8000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[000055b9be2caff0] main playlist debug: processing request item: null, node: Scaletta, skip: 0
[000055b9be2caff0] main playlist debug: rebuilding array of current - root Scaletta
[000055b9be2caff0] main playlist debug: rebuild done - 1 items, index -1
[000055b9be2caff0] main playlist debug: starting playback of new item
[000055b9be2caff0] main playlist debug: resyncing on rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1
[000055b9be2caff0] main playlist debug: rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1 is at 0
[000055b9be2caff0] main playlist debug: creating new input thread
[00007ff0bc000c80] main input debug: Creating an input for 'rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1'
[000055b9be2caff0] main playlist debug: requesting art for new input thread
[00007ff0bc000c80] main input debug: using timeshift granularity of 50 MiB
[00007ff0bc000c80] main input debug: using default timeshift path
[00007ff0bc000c80] main input debug: `rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1' gives access `rtsp' demux `any' path `user:pass@address:554/cam/realmonitor/channel=1&subtype=1'
[00007ff0b0000fa0] main input source debug: creating demux: access='rtsp' demux='any' location='user:pass@address:554/cam/realmonitor/channel=1&subtype=1' file='(null)'
[00007ff0b0001160] main demux debug: looking for access_demux module matching "rtsp": 16 candidates
[00007ff0a8000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007ff0a8000c20] lua meta fetcher debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/fetcher
[00007ff0a8000c20] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
[00007ff0a8000c20] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[00007ff0b0001160] main demux debug: no access_demux modules matched
[00007ff0a8000c20] main meta fetcher debug: no meta fetcher modules matched
[00007ff0b0001630] main stream debug: creating access: rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1
[00007ff0a8000c20] main art finder debug: looking for art finder module matching "any": 2 candidates
[00007ff0b0001630] main stream debug: looking for access module matching "rtsp": 29 candidates
[00007ff0a8000c20] lua art finder debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/art
[00007ff0a8000c20] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007ff0b0001630] satip stream debug: try to open 'rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1'
[00007ff0b0001630] satip stream debug: connect to host '10.168.5.138'
[00007ff0b0001630] main stream debug: net: connecting to 10.168.5.138 port 554
[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007ff0a8000c20] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007ff0a8000c20] main art finder debug: no art finder modules matched
[00007ff0b0001630] main stream debug: connection succeeded (socket = 11)
[00007ff0ac000e80] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007ff0b0001630] main stream debug: net: opening 0.0.0.0 datagram port 9164
[00007ff0ac000e80] lua meta fetcher debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/fetcher
[00007ff0b0001630] main stream debug: net: opening 0.0.0.0 datagram port 9165
[00007ff0ac000e80] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
[00007ff0ac000e80] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[00007ff0ac000e80] main meta fetcher debug: no meta fetcher modules matched
[00007ff0ac000e80] main art finder debug: looking for art finder module matching "any": 2 candidates
[00007ff0ac000e80] lua art finder debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/art
[00007ff0ac000e80] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007ff0ac000e80] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007ff0ac000e80] main art finder debug: no art finder modules matched
[00007ff0b0001630] satip stream error: Failed to setup RTSP session
[00007ff0b0001630] main stream debug: net: connecting to 10.168.5.138 port 554
[00007ff0b0001630] main stream debug: connection succeeded (socket = 11)
[00007ff0b0001630] access_realrtsp stream warning: Cseq mismatch, got 1, assumed 0
[00007ff0b0001630] access_realrtsp stream debug: rtsp connected
[00007ff0b0001630] access_realrtsp stream warning: only real/helix rtsp servers supported for now
[00007ff0b0001630] main stream debug: no access modules matched
[00007ff0bc000c80] main input error: L'ingresso non può essere aperto
[00007ff0bc000c80] main input error: VLC non è in grado di aprire il MRL 'rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1'. Controlla il registro per i dettagli.
[000055b9be2caff0] main playlist debug: dead input
[000055b9be2caff0] main playlist debug: changing item without a request (current 0/1)
[000055b9be2caff0] main playlist debug: nothing to play

主要问题是 omxplayer 已被弃用,但在加载 10 秒后播放效果很好。 有人可以让我明白为什么 vlc 根本没有吗?

Debian 中为 live555 提供支持的库在今年 2 月被删除,这影响了所有下游发行版,包括但不限于 RPi OS 和 Ubuntu:

https://askubuntu.com/a/1363113

2 个活动版本是 2020.01.19-1 和 2018.11.26-1.1,Live555 此后已将 GPL 许可证 header 添加到有问题的文件中,但 RFC 问题仍然存在。

现在您可能只想下载最新的 Live555 源代码并编译它……它不起作用。 VLC 引用的函数名称和结构发生了变化,因此 VLC 不会针对源代码进行编译。您需要获取旧版本,我专门使用了这个版本,它是 2020 年的调整快照,发生在 mod阻止 VLC 编译的通知之前:

https://github.com/rgaufman/live555

你想要的配置是./genMakefiles linux-with-shared-libraries,我不知道是否需要,但由于我的系统是x86-64位,所以我先在编译器选项中添加了-m64

编译安装后,我继续编译VLC,将根Live555文件夹放入VLC extras文件夹后添加'--enable-live555''--with-live555-tree=extras/live555-master',但是VLC编译失败,结果Live555 的 make install 不会将所有需要的 header 文件复制到 VLC 所在的位置。它们作为 4 个子文件夹放入 /usr/local/include/,实际的库放入 /usr/local/lib/。添加正确的 CXX/CPP 标志将使它看起来像放置它们的位置,但是我将它们全部放在一个文件夹中并使用了 1 个标志。

我还必须 '--disable-mod' 解决我没有兴趣修复的依赖版本问题,因为我不使用 modplug 或任何 mod 文件。

50分钟后...VLC编译成功!然而,它期望 Live555 的库位于 /usr/lib/ 而不是 /usr/local/lib/,因为编译花费了很长时间,我很好地将库链接或复制到预期的文件夹中,然后VLC 在链接到新文件时与 RTSP 一起工作。或者,如果您需要加载相机源,您可以选择保留原始 VLC 和 运行 直接新文件。

我有同样的问题,vlc 不支持 rtsp。我找到了两个解决方案。

1 - 使用 snap 版本 sudo snap install vlc => rtsp 正在运行。

/snap/bin/vlc rtsp://...

2 - 重建 vlc。我用这个教程来帮助我:https://wiki.videolan.org/UnixCompile/ 我在 ./configure 上遇到了一些问题,所以我安装了一些非强制性的包..但我不知道是哪一个..所以我列出了我在测试期间安装的所有包。

sudo apt-get build-dep vlc vlc-plugin-qt phonon4qt5-backend-vlc

sudo apt-get install libqscintilla2-qt5-dev libqt5charts5-dev qtdeclarative5-dev libqt5gstreamer-dev libqt5opengl5-dev phonon4qt5-backend-vlc libqt53dcore5 qtquickcontrols2-5-dev

git clone git://git.videolan.org/vlc.git

cd vlc

./bootstrap

cd contrib

mkdir native

cd native

../bootstrap

make (stop with error : protoc system version 3.12.4 and required version 3.1.0 do not match)

cd ../../

./configure --prefix=/usr/local  --enable-merge-ffmpeg  --enable-live555

make

现在我有了一个支持 rtsp 的 vlc。