Raspberry Pi how to convert RTSP stream h265 to h264

2k views Asked by At

I am trying to convert H265 rtsp stream to H264.

ffmpeg -rtsp_transport tcp -i 'rtsp://admin:[email protected]: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

When I use this command it gives this error.

[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
1

There are 1 answers

0
martinr92 On BEST ANSWER

If FFmpeg should act as a server you must add the parameter -listen 1.

ffmpeg -i 'rtsp://admin:[email protected]:554/stream2' {...} -f flv -listen 1 rtmp://localhost:1935/live/stream