

The %d will be replaced with the current sequence number. The last argument passed to ffmpeg is the path to where the segments should be written it contains a format specifier ( %d) similar to those supported by the printf function in C. We can specify the segment duration with the -segment_time option. We use ffmpeg‘s segment muxer to segment the video. "/Library/WebServer/Documents/vod/fileSequence%d.ts"

segment_list "/Library/WebServer/Documents/vod/prog_index.m3u8" \ Here’s the equivalent of the command above using ffmpeg: $ ffmpeg -y \ Given a video as input, it will divide it into segments and create a playlist for us. However, recent versions of ffmpeg can also output HLS compatible files. Unfortunately, Apple’s tools will only work on a Mac. This command takes the video ( sample.mov) and writes out the segments and the playlist to the /Library/WebServer/Documents/vod directory. Here’s an example using mediafilesegmenter: $ mediafilesegmenter -f /Library/WebServer/Documents/vod sample.mov In the book I use Apple’s HTTP Live Streaming tools to do this. To stream video with HLS, you need to divide your video into segments of a fixed duration and add them to a playlist.
