3

I'm trying to use Mac OS X 10.6's mediastreamsegmenter to take the audio input of my mac and turn it into a stream that I could listen to on the iPhone.

I've read this and the related man page. But when I do something like this:

mediastreamsegmenter -s 3 -D -f /tmp/stream localhost:8080

No files appear in the 'stream' directory and when I try and use QuickTime Player X to connect to localhost:8080, no go.

What am I missing here?

Cœur
  • 37,241
  • 25
  • 195
  • 267
jeffehobbs
  • 1,198
  • 1
  • 9
  • 11

1 Answers1

13

According to the tech note that describes the mediastreamsegmenter tool:

This tool receives an MPEG-2 transport stream over a UDP network connection or from stdin and divides it into a series of small media segments of equal duration. It then creates an index file containing references to the individual media segments.

This means that you will need to have a UDP server running on the machine that you want to do the capture on, that is capable of pushing out the data in a MPEG2 transport stream.

I wasn't able to find anything freely available that captures from a mic input, but here is a series of steps to see a working live streaming that will stream from your iSight.

Before you start, you will need the latest version of VLC.

Setup Streaming Server

  1. Start VLC and select File -> Open Capture Device...
  2. Select the Capture tab and choose iSight in the dropdown
  3. Make sure the Streaming/Saving checkbox is enabled
  4. Click the Setting... button and configure as in the screencap below: alt text
  5. Click OK, but don't click the Open button just yet
  6. Go to System Preferences, click on the Sharing icon and make sure Web Sharing is turned on.
  7. Go to your home folder and in the Sites folder create a new folder called for example streaming
  8. In Terminal type mediastreamsegmenter -s 3 -D -f /Users/your-user-name/Sites/stream/ 127.0.0.1:2222 and press enter. Make sure to replace your-user-name with your short user name. If you don't know what that is, type whoami in the Terminal
  9. In VLC click Open

If all goes well after a few seconds you should see messages like this:

Dec  7 2010 22:46:37.696: Finalized /Users/name/Sites/stream/fileSequence27.ts
Dec  7 2010 22:46:37.741: received 276360 written bytes 260380 skipped 15792 pat/pmt skipped 15792
Dec  7 2010 22:46:48.504: Finalized /Users/name/Sites/stream/fileSequence28.ts
Dec  7 2010 22:46:49.263: received 371112 written bytes 356636 skipped 15792 pat/pmt skipped 15792

Stream

To test that everything is working:

  1. Open QuickTime X
  2. File -> Open URL
  3. Type in http://localhost/~name/stream/prog_index.m3u8
  4. Click Open

On an iPhone just open MobileSafari and go to the the same URL, e.g. http://your.ip.address/~name/stream/prog_index.m3u8

Pang
  • 9,564
  • 146
  • 81
  • 122
martineno
  • 2,623
  • 17
  • 14
  • This worked like a charm for video -- I could not get sound to work out of the iSight preset in VLC, however. Does anyone know of a reasonably straightforward way to encode live audio similarly to the first part of this walkthrough? – jeffehobbs Jan 30 '11 at 14:41
  • Does anyone know where the streaming tools have gone? When I go to https://developer.apple.com/resources/http-streaming/ and click on the download link, I just get a pointer to MakeRefMovie 2.2.1. I downloaded that, but it doesn't have any of the media programs. – Victor Miller Jun 02 '12 at 23:51
  • Hm. When I click on the link and after logging in I get both the Make Ref Movie as well as HTTP Streaming Tools. You need to be registered Apple Developer Center person. Not sure if you need the paid membership. – martineno Jun 03 '12 at 00:23
  • just get audio pid change to 44 when trying to do audio – Lucas Goossen Dec 16 '13 at 22:31