m3u8 and ts files are deleted after a while

I'm using ffmpeg to convert mp4 files to hls files using the following command:

ffmpeg -i /var/mp4s/gua.mp4 -strict -2 -f hls /mnt/hls/index.m3u8

But after a few seconds, the .m3u8 and .ts files are automatically deleted. How to prevent them from deleting?

1 Answer

Nginx cleans up the files by default, so we need to disable this function by adding hls_cleanup off;:

application myapp { live on; hls on; hls_path /tmp/hsls; hls_cleanup off;
}

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like