【发布时间】:2017-09-20 17:30:52
【问题描述】:
我目前一直在尝试使用 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 中有效。我试图从中获取流的相机是博世相机。
我已经在互联网上搜索和搜索,但我没有找到任何具体的解决方案。
有什么想法吗?
【问题讨论】:
-
编辑了完整的控制台输出。
-
此问题与the help center 中定义的主题无关。如果您不明白为什么,请在Meta Stack Overflow 寻求帮助。
-
同样的问题,我需要知道它来执行节点模块,有一种方法可以在 ffmpeg 中使用身份验证补丁我还没有找到..
-
更新时?这行得通吗?
-
其他一些问题:Does FFMPEG support RTSP authentication? - Stack Overflow 说您的解决方案可以正常工作。
标签: authentication ffmpeg rtsp digest