Apple
UserpicLVH Video Segmenter
Posted by Moxietype

First you’ll need to install Apple’s HTTP Live Streaming Developer Tools from the Apple Developer website. To segment a video, the only one of these tools you’ll need is the mediafilesegmenter command line program. You’ll know if it’s installed or not by going to the Terminal, typing mediaf, and hit TAB.

If installed it should autocomplete. Press Return and you should get a list of all the options for the mediafilesegmentor. There’s lots of options but we’re only interested in this:

 

 -f | --file-base=  : path at which to store index and media files

 

Obviously from the list of options there’s lots more you can do, but for basic segmentation for streaming this is all you need.

Now type in mediafilesegmenter -f and drag and drop into the Terminal window the folder in which you want the segmented files to be put. Then drag and drop your .mp4 file into the Terminal window. Finally, hit Return.

In my case the entire command line looked like this:

 

 mediafilesegmenter -f /Users/Chris/Desktop/test/segment_example  /Users/Chris/Desktop/test/thePianist.mp4

 

Relative paths will work here as well, so if I had navigated to the “test” folder and manually typed the relative paths it would have looked like this:

 

 mediafilesegmenter -f segment_example thePianist.mp4

File Extension

MIME Type

.m3u8

vnd.apple.mpegURL

.ts

video/MP2T

.mp4

video/mp4

To check if a video stream is valid, call mediastreamvalidator with the URL of the playlist. If you run the following command, you should see something like this:

$ mediastreamvalidator


Return to Home