linux – Ffmpeg No such file or directory creating hls output

I am using ffmpeg to create a hls live stream with the following command

ffmpeg -i "rtmp://domain.com/stream/6" -c:v copy -c:a copy -f hls -y -preset superfast -hls_segment_type mpegts -hls_time 10 -hls_init_time 4 -hls_list_size 10 -hls_flags delete_segments+discont_start -hls_delete_threshold 1 -hls_segment_filename 'segment_%03d.ts' '/var/www/html/live/index.m3u8'

ffmpeg runs and starts no problem but then i get the following error

[hls @ 0x5603199e8840] Opening ‘segment_000.ts’ for writing [hls @
0x5603199e8840] Opening ‘/var/www/html/live/index.m3u8.tmp’ for
writing [hls @ 0x5603199e8840] failed to rename file
/var/www/html/live/index.m3u8.tmp to
/var/www/html/live/index.m3u8: No such file or directory

I have the latest version of ffmpeg installed. I have also checked and ffmpeg has full permissions and so does the folder where the stream is being saved to i have went as far as setting them to 777 still get the error

i am using nginx for the http server and its on a ubuntu server.

This is a local server protected by firewall in my basement so setting 777 is not a worry to me just to stop people saying you should never run as root or use 777 there is no way for anyone to even connect to this server all ips are blocked but one remote server and one local ip

Read more here: Source link