我一直在尝试使用FFmpeg设置从RTSP到HLS的编码过程,大多数流都成功。
然而,对于具有摘要认证的流/摄像机,FFmpeg似乎失败了,经典的401 Unauthorized,如下:
ffmpeg -loglevel debug -i "rtsp://user:password@192.168.0.1/stream" /folder/output.m3u8
,并提供:
ffmpeg version N-85750-ga75ef15 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 61.100 / 55. 61.100
libavcodec 57. 93.100 / 57. 93.100
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 88.100 / 6. 88.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'rtsp://username:password@192.168.0.1/stream'.
Reading option '/folder/output.m3u8' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://username:password@192.168.0.1/stream2.
Successfully parsed a group of options.
Opening an input file: rtsp://username:password@192.168.0.1/stream.
[tcp @ 00000000025c3900] No default whitelist set
[rtsp @ 00000000025c2560] method OPTIONS failed: 401 Unauthorized
[rtsp @ 00000000025c2560] CSeq: 2
WWW-Authenticate: Digest realm="Use 'live' as User Name", nonce="2ae726f5557769220b780deb4f562226", algorithm=MD5, qop="auth"
rtsp://user:password@192.168.0.1/stream: Server returned 401 Unauthorized (authorization failed)
我已经检查过相机是否可访问,输入URI是否在VLC中工作。我试图从中获取流的相机是博世的。
我通过互联网搜索和搜索,但我没有找到任何具体的解决方案。
有什么想法吗?