disqus4u Latest Questions

How can I record Ant Media streams as HLS files and prevent them from getting overwritten?


In my Ant Media setup, a streamId is reused but when I republish it there is an overwrite of the previously recorded HLS files.

The mp4 files are the only ones getting the timestamps. but not the recorded .ts or m3u8 files. When there is network disruptions, it affects stopping and starting the stream in short duration.

How can I fix or configure this?

Related Questions

  1. This answer was edited.

    This issue can be approached in two scenarios:

    • You can add the new .ts files to previously recorded files to form a single recording

    This means that the .ts files that share the same streamId could be appended to the same .m3u8 file. You can achieve this by editing and adding the  hlsflag setting to the red5-web.properties file located un the following path

    nano /usr/local/antmedia/webapps/app-name/WEB-INF/web.properties 

    You will need to replace app-name with the actual name of your streaming application i.e. LiveApp, WebRTC, or any other name assigned to the custom streaming application you’ve created in Ant Media web panel.

    Once you’ve opened the web.properties, add the hlsflag setting as follows:


    For HLS recording, make sure that the below properties are also added


    After this editing, you can restart Ant Media server using this command:

    sudo service antmedia restart
    • Record the stream with the same streamId but without appending it to old files

    In case you don’t want the .ts files to be appended to the previous recordings, you can simply activate the date and timestamp feature for HLS video files. This is possible if you’re running Ant Media versions 2.5.3 and higher by adding the following property:


    Now, the results will be as follows:

Leave an answer

Leave an answer