我現在要通過ffmpeg獲取大華攝像頭視頻流并下載成mp4,但我在cmd窗口運行下面命令的時候,發現報錯:
D:\Java\ffmpeg\ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe -y -i rtsp://admin:123@xxx.xxx.xxx.xxx/cam/realmonitor?channel=1&subtype=0 -c copy -map 0 -t 20 output.mp4
其實原因很簡單,就是因為特殊字符&未進行URLCode編碼導致。
我們把&字符換成%26就可以了。