ffmpeg h264转码,并且使用rtps推流

ffmpeg h264转码,并且使用rtps推流

先说说rtmp推流:

ffmpeg推流rtmp:

各大网站都能很简单的找到
ffmpeg -i “rtsp://admin:[email protected]:554/ch1/main/av_stream” -vcodec copy -acodec copy -f flv “rtmp://127.0.0.1:1935/live/”

ffmpeg推流rtsp:
这个需要去到ffmpeg的官方文档才能找到
https://www.ffmpeg.org/ffmpeg-all.html#Examples-19


RTSP推流,实操:

LINUX环境

ffmpeg推流,特点:高延迟低消耗
推流rtsp
下载安装rtsp-server
https://github.com/revmischa/rtsp-server

启动后使用命令行推流
ffmpeg -max_delay 100 -r 25 -re -i “rtsp url(这里是拉流地址或者视频地址)” -b 700000 -rtsp_transport tcp -s 704*576 -vcodec h264 -f rtsp rtsp://localhost/test

-r 是你设置的帧数
-s是设置的图像大小
该命令可以解决h264转码后花屏的问题

WINDOWS环境

下载EasyDarwin开源流媒体服务器
https://github.com/EasyDarwin/EasyDarwin

启动后也是使用相同的命令进行推流

拉流方式: ffplay rtsp://localhost/test

VLC搭建rstp服务器
特点:低延迟高消耗

1)和上面一样开始rtps-server
2)参考此文章:https://blog.csdn.net/qq_29350001/article/details/77979355

你可能感兴趣的:(ffmpeg h264转码,并且使用rtps推流)