Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 17, 2008, 10:21 AM   #1
Fontano
macrumors member
 
Join Date: Jun 2008
Streaming Video using MPMoviePlayerController

For the last week or so, I have been trying to get MPMoviePlayerController working with streaming video feeds...

No luck.

I am using the MoviePlayer sample as the base...
And I have been working with the movieURL function, to change the source video.

I have been successfully at access video outside of the package, on the local hard drive, and on network access drives... but not streaming to an HTTP or an RTSP.

My latest attempt, was altering the line in movieURL (in MyViewController.m) to
NSString *moviePath = @"http://www.itc.virginia.edu/network/videotest/when-lg.mov";

When the app plays, I get an on screen of:
This Movie Could Not Be Played

The Debug/Log reports:
2008-07-17 10:20:12.194 MoviePlayer[4395:20b] ERROR! Please file a bug report!
2008-07-17 10:20:12.195 MoviePlayer[4395:20b] Could not play the movie http://www.itc.virginia.edu/network/...st/when-lg.mov. We received the AVController_ItemFailedToPlayNotification with info: Error Domain=NSOSStatusErrorDomain Code=-12783 UserInfo=0x1083d20 "This movie could not be played."


Any ideas on how to go getting this to work?
Fontano is offline   0 Reply With Quote
Old Oct 16, 2008, 06:13 AM   #2
cwoloszynski
macrumors member
 
Join Date: Jul 2005
Progress on this?

Any chance you figured this out? I am seeing the same pop-up but I don't get the notification you do? Would you be willing to share the Notification registration code you used to get it?
cwoloszynski is offline   0 Reply With Quote
Old Oct 16, 2008, 10:48 AM   #3
Fontano
Thread Starter
macrumors member
 
Join Date: Jun 2008
Quote:
Originally Posted by cwoloszynski View Post
Any chance you figured this out? I am seeing the same pop-up but I don't get the notification you do? Would you be willing to share the Notification registration code you used to get it?
I was able to access Movies via HTTP progressive download.
I have not returned to accessing a true streaming server, the files I have been able to access where complete video files on the server.

IIRC, I posted this when I was having a problem with the player.
Which ultimately ended up being an incompatibility issue with the DiVX codec/player being installed (The actual one from www.divx.com)

The other Problem I was having at the time, is that I didn't change the URL building to use a URL link instead of a local file.

However, at the end of the work, it did work in the simulator, but not the device. And priorities have shifted, so I haven't returned to getting the streaming video to play.
Fontano is offline   0 Reply With Quote
Old Nov 5, 2008, 02:38 AM   #4
developer.in
macrumors newbie
 
Join Date: Nov 2008
Quote:
Originally Posted by Fontano View Post
I was able to access Movies via HTTP progressive download.
I have not returned to accessing a true streaming server, the files I have been able to access where complete video files on the server.

IIRC, I posted this when I was having a problem with the player.
Which ultimately ended up being an incompatibility issue with the DiVX codec/player being installed (The actual one from www.divx.com)

The other Problem I was having at the time, is that I didn't change the URL building to use a URL link instead of a local file.

However, at the end of the work, it did work in the simulator, but not the device. And priorities have shifted, so I haven't returned to getting the streaming video to play.
Hi Fontano

Can you please explain how you achieved it? Are you saving the whole file locally and then playing it?
developer.in is offline   0 Reply With Quote
Old Nov 5, 2008, 06:11 AM   #5
CommanderData
macrumors regular
 
Join Date: Dec 2007
Quote:
Originally Posted by Fontano View Post
For the last week or so, I have been trying to get MPMoviePlayerController working with streaming video feeds...

No luck.

I am using the MoviePlayer sample as the base...
And I have been working with the movieURL function, to change the source video.

I have been successfully at access video outside of the package, on the local hard drive, and on network access drives... but not streaming to an HTTP or an RTSP.

My latest attempt, was altering the line in movieURL (in MyViewController.m) to
NSString *moviePath = @"http://www.itc.virginia.edu/network/videotest/when-lg.mov";

When the app plays, I get an on screen of:
This Movie Could Not Be Played

The Debug/Log reports:
2008-07-17 10:20:12.194 MoviePlayer[4395:20b] ERROR! Please file a bug report!
2008-07-17 10:20:12.195 MoviePlayer[4395:20b] Could not play the movie http://www.itc.virginia.edu/network/...st/when-lg.mov. We received the AVController_ItemFailedToPlayNotification with info: Error Domain=NSOSStatusErrorDomain Code=-12783 UserInfo=0x1083d20 "This movie could not be played."


Any ideas on how to go getting this to work?
Would you care to share code for what you've got so far? I think streaming video off a local network drive would be quite useful by itself... probably even more useful than internet streaming from HTTP. Especially when combined with the VPN access of the iPhone, where I could access many Gigabytes of my LAN content while traveling
CommanderData is offline   0 Reply With Quote
Old Nov 5, 2008, 06:22 AM   #6
jnic
macrumors 6502a
 
Join Date: Oct 2008
Location: Cambridge
I'm not the original poster, but here's the code I'm using MPMoviePlayer to "stream" (progressive download) movies over HTTP. It's extremely simple:

Code:
NSString *url = @"http://www.example.com/path/to/movie.mp4";
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
[moviePlayer play];
This often does not work in the simulator, but is always fine on the device. MPMoviePlayer does not appear to support RTSP.

Quote:
I think streaming video off a local network drive would be quite useful by itself...
For local files, just substitute the remote URL for a local one:

Code:
NSString *path = [bundle pathForResource:@"movie" ofType:@"mp4"];
NSString *url = [NSURL fileURLWithPath:path];
jnic is offline   0 Reply With Quote
Old Nov 5, 2008, 06:28 AM   #7
jnic
macrumors 6502a
 
Join Date: Oct 2008
Location: Cambridge
If you're still having problems then it may be due to the video format; MPMoviePlayer is very particular in what it will play.

See Supported Formats in the class reference (http://developer.apple.com/iphone/li...ontroller.html) for details.
jnic is offline   0 Reply With Quote
Old Nov 5, 2008, 06:39 AM   #8
CommanderData
macrumors regular
 
Join Date: Dec 2007
Quote:
Originally Posted by jnic View Post
I'm not the original poster, but here's the code I'm using MPMoviePlayer to "stream" (progressive download) movies over HTTP. It's extremely simple:

Code:
NSString *url = @"http://www.example.com/path/to/movie.mp4";
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
[moviePlayer play];
This often does not work in the simulator, but is always fine on the device. MPMoviePlayer does not appear to support RTSP.



For local files, just substitute the remote URL for a local one:

Code:
NSString *path = [bundle pathForResource:@"movie" ofType:@"mp4"];
NSString *url = [NSURL fileURLWithPath:path];

Hmmm. Am I missing something or are you suggesting local as in locally on the iPhone? What I want to do is use Wifi on the iPhone to access networked hard drives. Let's say I have a 2 Terabyte NAS on my local network that I want to access over Wifi from my iPhone for example (which I currently do from my laptop).

If I take the MoviePlayer sample code, can I just supply it the network location like @"smb://NAS/media/videos/mytestvid.mov" or is it more complex than that?

Last edited by CommanderData; Nov 5, 2008 at 06:45 AM.
CommanderData is offline   0 Reply With Quote
Old Nov 5, 2008, 07:01 AM   #9
jnic
macrumors 6502a
 
Join Date: Oct 2008
Location: Cambridge
Quote:
are you suggesting local is actually on the iPhone?
Yup, my misunderstanding.

Quote:
If I take the MoviePlayer sample code, can I just supply it the network location like @"smb://NAS/media/videos/mytestvid.mov" or is it more complex than that?
AFAIK, the movie player doesn't support Samba shares natively. You'd have to start an httpd to serve the videos, and set the URL to be its address on your local network (http://192.168..., etc.), or write your own Samba client to convert it on-the-fly.
jnic is offline   0 Reply With Quote
Old Feb 6, 2009, 10:13 AM   #10
nikihana
macrumors newbie
 
Join Date: Feb 2009
Sample, please

Hi,

Can you post the code fragment that actually plays a progressive download mp4 strea,?

My app simple crashes when I try it :-(

I am using the MoviePlayer sample as a base...
Thanks,


Quote:
Originally Posted by Fontano View Post
I was able to access Movies via HTTP progressive download.
I have not returned to accessing a true streaming server, the files I have been able to access where complete video files on the server.

IIRC, I posted this when I was having a problem with the player.
Which ultimately ended up being an incompatibility issue with the DiVX codec/player being installed (The actual one from www.divx.com)

The other Problem I was having at the time, is that I didn't change the URL building to use a URL link instead of a local file.

However, at the end of the work, it did work in the simulator, but not the device. And priorities have shifted, so I haven't returned to getting the streaming video to play.
nikihana is offline   0 Reply With Quote
Old Feb 27, 2009, 06:36 AM   #11
iGrump
macrumors newbie
 
Join Date: Feb 2009
If you're having trouble playing m4v etc from a web URL, make sure that the web server has the correct MIME types set up otherwise you will receive an error when trying to stream within iPhone app.

You can check this by trying to view the movie directly in a web browser - if you get a 404/Page not Found error - this is likely to be MIME types.
iGrump is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Video Streaming deverett Digital Video 1 Mar 1, 2014 03:51 PM
MPMoviePlayerController not working Ides iPhone/iPad Programming 0 Jul 26, 2013 09:29 PM
Video streaming? yearofthe Community Discussion 1 Apr 11, 2013 10:57 PM
Resolved: trying to play video with MPMoviePlayerController just gives me black screen straber iPhone/iPad Programming 3 Mar 10, 2013 06:50 PM
Benchmark video: AlwaysOnPC receives audio & Flash video streaming at last Menneisyys2 iPad Apps 0 Nov 6, 2012 04:12 PM

Forum Jump

All times are GMT -5. The time now is 04:22 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC