Raspberry Pi 如何将 RTSP 流 h265 转换为 h264

Raspberry Pi how to convert RTSP stream h265 to h264

我正在尝试将 H265 rtsp 流转换为 H264。

ffmpeg -rtsp_transport tcp -i 'rtsp://admin:admin123@192.168.1.42:554/stream2' -f lavfi -i aevalsrc=0 -vcodec copy -acodec aac -map 0:0 -map 1:0 -c:v libx264 -pix_fmt yuv420p -shortest -strict experimental -f flv rtmp://localhost:1935/live/stream

当我使用此命令时出现此错误。

[tcp @ 0x23f13b0] Connection to tcp://localhost:1935 failed: Connection refused
[rtmp @ 0x23f1270] Cannot open connection tcp://localhost:1935
rtmp://localhost:1935/live/stream: Connection refused

如果 FFmpeg 应作为服务器,您必须添加参数 -listen 1

ffmpeg -i 'rtsp://admin:admin123@192.168.1.42:554/stream2' {...} -f flv -listen 1 rtmp://localhost:1935/live/stream