HLS streaming works well in iOS browser(real time mid-stream),
But in most of Android browser, the streaming always starts from the beginning(First Ts file when streaming started).
Android System:4.0,4.4,etc..
Detail for FFmpeg command : Pull RTMP streaming, then use segment to transfer that into TS splits.
ffmpeg -re -i rtmp://ipaddress/live/streamname
-codec:a libfaac -b:a 96k -af volume=1 -ac 2 -ar 44100
-f segment
-segment_time 5
-segment_list_flags live
-segment_list /path/to/m3u8
-segment_format mpegts /path/to/ts
Detail for m3u8 file
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:6
#EXTINF:5.000278,
file0000.ts
#EXTINF:5.013356,
file0001.ts4
HLS Player:Ckplayer + m3u8 plugins
Does anyone else meet this problem?
As Aergistal said in comment.
The lastest ffmpeg supports hls
directly.
So just use -f hls
instead of -f segment
.
Then problem solved.
If we use -f segment
#EXT-X-MEDIA-SEQUENCE
will always be 0
.So that Android devices will always start from the first TS file.
If we use -f hls
-hls_list_size
to define the number of TS files in m3u8 file.#EXT-X-MEDIA-SEQUENCE
will update automatically.And then it works well.