Search code examples
ffmpegrtsp

unkonwn command failure occured when using ffmpeg to handle rtsp stream url


I want to use ffmpeg to grab a image from a rtsp stream,the command is as following:

ffmpeg -y -i rtsp://zigong.stream.xl02.cn:557/HongTranSvr?DevId=1b038d27-858c-46a1-b803-a2984af343df&Session=1b038d27-858c-46a1-b803-a2984af343df -vframes 1 do.jpg

but failed with bash:-vframes:unkonwn command. I guees it may be a lack of package,so I tried with a .mp4 video instead of rtsp stream:

ffmpeg -y -i hehe.mp4 -vframes 1 do.jpg

The result works fine...

Does the failure has something to do with my rtsp stream url? I can display it via VLC(a video player) so it's playable...


Solution

  • Place quotes around the URL:

    ffmpeg -y -i "rtsp://zigong.stream.xl02.cn:557/HongTranSvr?DevId=1b038d27-858c-46a1-b803-a2984af343df&Session=1b038d27-858c-46a1-b803-a2984af343df" -vframes 1 do.jpg