Need help transcoding Red5 RTMP stream to MPEG2-TS

浪尽此生 提交于 2019-12-06 07:18:18

This invocation is what I successfully use to convert a red5 live stream into m3u8 HLS format with TS files:

ffmpeg -re -i "rtmp://domain/oflaDemo/test live=1" -hls_time 10 -hls_wrap 7 -hls_list_size 3 -f hls test.m3u8

Option "-hls_list_size 3" takes care there are 3 TS files listed in the m3u8 file. Option "-hls_wrap 7" takes care the .TS files are automatically removed after 7 files.

So there is no need for other tools, ffmpeg can do the complete job for you. If you do not specify option "-hls_wrap" the complete stream will be saved in TS files of 10 seconds (-hls_time 10).

By the way, I use ffmpeg 1.2.1 on CentOS v5.8 compiled with rtmpdump v2.3 and the latest x264 lib from git://git.videolan.org/x264.git with the following configuration options:

./configure --enable-librtmp --enable-libx264 --enable-gpl

If you'd like to continue using Red5 for your streaming, you could try my HLS plugin, the source may be found here: https://github.com/Red5/red5-hls-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!