Joost
Joost

Reputation: 113

HTTP stream without extension in MPMoviePlayerController

I'm currently letting VLC stream a WMV file while it converts the file live to H264 with MP3 audio. This means you get an URL with just an IP and a port (http://127.0.0.1:1234/). When I try to let MPMoviePlayerController stream this, it says it can't open that extension...

What should I do? I heard that you have to create a M3U8 file, but I have no idea how to do that.

Are there any solutions for this problem, or is there an alternative to MPMoviePlayerController?

Thanks in advance

Upvotes: 6

Views: 1767

Answers (1)

rhormaza
rhormaza

Reputation: 507

I just tried this and it worked to me...I don't know if it is exactly what you are looking for..

In a computer with VLC, I ran [1]:

/Applications/VLC.app/Contents/MacOS/VLC --intf=rc SOME_VIDEO \\
'--sout=#transcode{fps=25,vcodec=h264,venc=x264{aud,profile=baseline,level=30,\\
keyint=30,bframes=0,ref=1,nocabac},acodec=mp3,ab=56,audio-sync,deinterlace}:\\
standard{mux=ts,access=http,dst=192.168.80.26:8080/test.mp4}'

Now, if you do that you should be able to connect directly with any mediaplayer like VLC itself, but that, as you already said, didnt work with MPMoviePlayerController .. so what I did...I create the m3u8 file like this and I named "test.m3u8"

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10, 
http://192.168.80.26:8080/test.mp4

This file just is pointing to the stream, then I put this in a webserver such as apache... and it worked..i was able to watch the stream using MPMoviePlayerController... now i just have to figure out how to get out of there, as I just learning how to use MPMoviePlayerController and I dont know how to setup the "done" button :-)

btw...in the source code...the string I assigned to MPMoviePlayerController is something like this: NSString *path = @"http://192.168.80.26/~user/test.m3u8";

I dont know if this is most efficient or the right thing to do..but at least it works ;)

cya

Upvotes: 1

Related Questions