ffmpeg returns “method SETUP failed: 404 Not Found

2020-04-14 08:11发布

问题:

We're using ffmpeg (build ffmpeg-20190628-098ab93-win32-static) to take a snapshot from camera RTSP streams on a Win 10 system. On some cameras, we're getting this error:

[rtsp @ 06813ac0] method SETUP failed: 404 Not Found
rtsp://username:password@example.com: Server returned 404 Not Found

Here's an example command we use:

ffmpeg -y -i rtsp://username:password@example.com -vframes 1 -pix_fmt yuvj420p 
  -vf select='eq(pict_type\,I)' -q:v 1 _test.jpg

However, VLC can load the same stream (we can't use VLC, though) from the same machine. Additionally, we've opened the firewall to ffmpeg (it popped up the two firewall dialogs and we allowed it through).

We've found posts on the DESCRIBE error but nothing on SETUP. Any help is appreciated. Thank you.

Update: In VLC, that RTSP stream asks for credentials twice for some reason. Wondering if that's the cause.

回答1:

The solution was here by @AmitSharma: We needed to wrap the RTSP address in double-quotes.

This didn't work:

ffmpeg -y -i rtsp://username:password@example.com -vframes 1 -pix_fmt yuvj420p 
  -vf select='eq(pict_type\,I)' -q:v 1 _test.jpg

We used this and it worked like a charm:

ffmpeg -y -i "rtsp://username:password@example.com" -vframes 1 -pix_fmt yuvj420p 
  -vf select='eq(pict_type\,I)' -q:v 1 _test.jpg