Sample Header Ad - 728x90

Linux I/O issue? Multiple FFMPEG saving streams as HLS, lose segments despite low CPU and Memory consumption

0 votes
1 answer
422 views
I'm capturing an RTMP stream as HLS (saving playlist files) using FFMPEG wihout any stream processing, merely copying it. Thanks to such setup I'm able to run tens of processes (I've tried 80 at most), with memory and CPU consumption not exceeding 30%. This is my command:
ffmpeg -i  -hls_init_time 10 -hls_time 10 -hls_list_size 0 -f hls -strftime 1 -hls_segment_filename '%H-%M-%S-%s.ts' -hls_flags split_by_time -codec:v copy -codec:a copy ./play$(date -d "today" +"%M%S-%s").m3u8
Unfortunately, as the number of processes grows, I start losing some HLS segments (HLS consists of a playlist file, and segments composing that file). For example the HLS plays fine from 0:00 until 0:40, but then freezes at 0:40 for 10s (my segments are 10s long) and unfreezes at 0:50. With 20 FFMPEG processes running, the loss rate is about 5%, at 80 processes its close to 50%. I'm performing those benchmarks at AWS EC2 instances using Ubuntu 22.x, and various machine types. No matter the machine type, the error's frequency remains the same, thus I assume it's not CPU or Memory related. I suspect that's something related to I/O and file writes, either an EC2 or Ubuntu setup. Any ideas?
Asked by Yyyeey (1 rep)
Jan 21, 2024, 02:14 PM
Last activity: Jan 27, 2024, 07:53 AM