location /hls {
root /tmp;
}
...
application mystream {
live on;
hls on;
hls_path /tmp/hls;
hls_base_url http://localhost:8080/hls/;
}
Here's the contents of HLS playlist for mystream stream
$ cat /tmp/hls/mystream.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:15
#EXT-X-DISCONTINUITY
#EXTINF:9.333,
http://localhost:8080/hls/mystream-0.ts
#EXTINF:7.167,
http://localhost:8080/hls/mystream-1.ts
#EXTINF:5.417,
http://localhost:8080/hls/mystream-2.ts
#EXTINF:5.500,
http://localhost:8080/hls/mystream-3.ts
#EXTINF:15.166,
http://localhost:8080/hls/mystream-4.ts
#EXTINF:9.584,
http://localhost:8080/hls/mystream-5.ts
#EXTINF:9.333,
http://localhost:8080/hls/mystream-6.ts
Hi,
ReplyDeleteIs there a way to check whether a stream is active (being pulished live) ?
Thing is, I want make a ip camera mjpeg stream pull and publish as rtmp (using ffmepg) only when first viewer for stream comes in
Thanks
is record_lock right way or the stats xml?
ReplyDeleteThere's no way to start exec when first client comes in and kill it when the last one leaves. You can only pull RTMP stream with "pull" directive.
ReplyDeleteI am doing the pull using ffmpeg and not from rtmp module. I pushing this mjpeg as rtmp
ReplyDeleteffmpeg -i http://ip/cgi/x.mjpeg -flv rtmp://localhost/app/stream
found a solution via a perl wrapper and using my own lock file for each unique stream.
Thanks
Roman,
ReplyDeleteWould it be possible to generate an "EVENT" type hls playlist? where EXT-X-MEDIA-SEQUENCE remains 0,
and new segments are appended to playlist in hls_continuous mode?
#EXT-X-PLAYLIST-TYPE:EVENT header is needed as well
Thanks
I think that's a good idea. I will implement it.
DeleteDoes this implemented?
Delete