Opened 4 weeks ago

Last modified 2 weeks ago

#6287 new defect

HLS: error with no sync m3u8 playlist file and chunks

Reported by: krs_vital Owned by:
Priority: important Component: avformat
Version: git-master Keywords: hls regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


ffmpeg version:

[root@stream-1 ~]# ffmpeg
ffmpeg version N-84010-ge2adbcb Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 5.3.1 (GCC) 20160406 (Red Hat 5.3.1-6)
configuration: --libdir=/usr/lib64
libavutil 55. 48.100 / 55. 48.100
libavcodec 57. 83.100 / 57. 83.100
libavformat 57. 66.104 / 57. 66.104
libavdevice 57. 3.100 / 57. 3.100
libavfilter 6. 76.100 / 6. 76.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100

Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

hls streaming string:

/usr/local/bin/ffmpeg -probesize 2000k -fifo_size 512k -buffer_size 256k -overrun_nonfatal 1 -i udp:// -sn -dn -vcodec copy -acodec aac -hls_allow_cache 0 -hls_base_url /ts/1KANAL_HD/ -hls_list_size 5 -hls_time 5 -hls_flags delete_segments+omit_endlist -map 0 -r 50 -copyts -g 1 -ignore_unknown -shortest -avoid_negative_ts make_zero -fflags +genpts -use_localtime 1 -hls_segment_filename /hls/ts/1KANAL_HD/stream_%Y%m%d-%s.ts /hls/pl/1KANAL_HD.m3u8

playlist file:

[root@stream-2 1KANAL_HD]# cat ./1KANAL_HD.m3u8

first problem is:
bad param is: #EXT-X-MEDIA-SEQUENCE:0

second problem is:
[root@stream-2 1KANAL_HD]# ls -l
итого 202576
-rw-r--r-- 1 root root 5610860 Apr 3 16:31 stream_20170403-1491211857.ts
-rw-r--r-- 1 root root 6053600 Apr 3 16:31 stream_20170403-1491211862.ts
-rw-r--r-- 1 root root 4212704 Apr 3 16:31 stream_20170403-1491211868.ts
-rw-r--r-- 1 root root 4167584 Apr 3 16:31 stream_20170403-1491211873.ts
-rw-r--r-- 1 root root 3556584 Apr 3 16:31 stream_20170403-1491211877.ts
-rw-r--r-- 1 root root 4489440 Apr 3 16:31 stream_20170403-1491211882.ts
-rw-r--r-- 1 root root 4538132 Apr 3 16:31 stream_20170403-1491211887.ts
-rw-r--r-- 1 root root 6555748 Apr 3 16:31 stream_20170403-1491211892.ts
-rw-r--r-- 1 root root 5907336 Apr 3 16:31 stream_20170403-1491211897.ts
-rw-r--r-- 1 root root 162323336 Apr 3 16:34 stream_20170403-1491211902.ts

last string contains to big chunk!!!

about once a day, sometimes such a problem that the chunks stop being generated and ffmpeg starts to write everything in one file, but the playlist continues to be updated and the chunks in it are recorded. The new are not created, as all is written in one file. And in the nginx logs written error that file not found. The server runs about 250 threads ffmpeg. But mostly this error occurs with HD streams.

Change History (8)

comment:1 Changed 4 weeks ago by cehoyos

To make this a valid ticket, provide an input file that allows to reproduce the issue and the command line you tested together with the complete, uncut console output.

comment:4 Changed 2 weeks ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords hls regression added
  • Priority changed from normal to important
  • Version changed from unspecified to git-master

comment:5 Changed 2 weeks ago by cehoyos

Did you provide an input file?

comment:6 Changed 2 weeks ago by krs_vital

input files after hls chunking here

note, that problem appears in approximately 27 hours after ffmpeg start encoding.
and in 90% cases it happens on HD channels.

zip arhive consist of chunks and m3u8 playlist generated by ffmpeg, but inside playlist links to chunks not the same, because ffmpeg updates playlist normally, but new .ts files not were created and stream write to one file.

comment:7 Changed 2 weeks ago by krs_vital

Now recorded channel, where all HLS chunks are not done, it creates only 1 file and the playlist is not updated. Perhaps these 2 problems are somehow connected.

link to file:

ffmpeg command:
/usr/local/bin/ffmpeg -fifo_size 8192 -buffer_size 8192 -overrun_nonfatal 1 -i udp:// -sn -dn -c copy -hls_allow_cache 0 -hls_base_url /ts/MIR_HD/ -hls_list_size 5 -hls_time 5 -hls_flags delete_segments+omit_endlist -map 0 -r 50 -async 1 -vsync 1 -g 1 -ignore_unknown -shortest -avoid_negative_ts 0 -fflags +genpts -hls_segment_filename /hls/ts/MIR_HD/stream_%d.ts /hls/pl/MIR_HD.m3u8

comment:8 Changed 2 weeks ago by krs_vital

another observation:

ffmpeg stops to create chunks and begins to write in 1 file, strictly following the same sequence, in my case I use %d for generating file names, and the problem starts between 19050 and 19100 (stream_19050.ts, most often 19077 and 19078 sequence). Then the threads are manually restarted and again the problem occurs in the same place. I use a chunk of 5 seconds, if you count, the problem occurs using 19050*5 = 92500 seconds, which is about 26 hours. Less frequently the problem appeared through half this time.

Note: See TracTickets for help on using tickets.