我使用nginx构建流服务器,并可以使用以下方法将MP4推到rtmp流中:
ffmpeg -re -i /mnt/hls/m7.mp4 -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict -2 -f flv rtmp://127.0.0.1/live现在我想用rtsp格式推送它:
ffmpeg -re -i /mnt/hls/m7.mp4 -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live遇到的错误信息:
[tcp @ 0x55c7d6a157c0] Connection to tcp://127.0.0.1:554?timeout=0 failed: Connection refused
Could not write header for output file #0 (incorrect codec parameters ?): Connection refused
Error initializing output stream 0:0 --
[aac @ 0x55c7d65b6500] Qavg: nan
[aac @ 0x55c7d65b6500] 1 frames left in the queue on closing
Conversion failed!发布于 2022-05-07 04:24:56
不是seems that you remove or missing the correct encoding value。
没有rtsp服务器构建在我的vps上,只有rtmp服务器在我的vp上安装在nginx中。
url="https://github.com/aler9/rtsp-simple-server/releases/download/v0.18.2/rtsp-simple-server_v0.18.2_linux_amd64.tar.gz"
curl -L $url -O
tar -xzf rtsp-simple-server_v0.18.2_linux_amd64.tar.gz
./rtsp-simple-server现在,我们可以使用ffmpeg将rtsp流推到服务器上:
ffmpeg -re -i /mnt/hls/m7.mp4 -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live它很好用!
https://serverfault.com/questions/1100299
复制相似问题