We have shared with you the method of capturing the RTMP protocol package and saving the video stream as H264. For details, please refer to: How to capture the RTMP protocol and save the video stream as H264 file. Since some users have the opposite requirement, that is, read H265 file to RTMP file, so this article will briefly introduce two ways to implement this requirement.

Method one:

This method is implemented by FFMPEG.

RTMP: RTMP: RTMP: RTMP: RTMP: RTMP

ffmpeg -re -stream_loop -1 -i save0904.h264 -vcodec copy -acodec copy -f flv -y rtmp://demo.easydss.com:10035/hls/w9SR_M9MR?sign=w9SR_M9MRz
Copy the code

Where -stream_loop stands for loop push, -1 stands for infinite loop.

Method 2:

With EasyRTMP, you can directly configure the 264 file path and RTMP stream address in the easyRtmp. ini configuration file, as shown in the following figure:

The effect of running the program is as follows: