Sylter
Sylter

Reputation: 1623

FLV Streaming on iPhone with ffmpeg

Good Morning, I am an iOS/Mac Developer.

I am developing an application that grab flv link from a website: now I want to play this flv file in streaming.

I find in AppStore BUZZPlayer, an application that can play flv video streaming: http://itunes.apple.com/it/app/buzz-player/id389744738?mt=8

Searching on Google I find out that exists ffmpeg for iPhone, so, my question is how can I stream a FLV Video with ffmpeg on iPhone?

A sample code is very appreciated!

Thank You.

P.S. Sorry for my poor English...

Upvotes: 2

Views: 2396

Answers (2)

intermat
intermat

Reputation: 19

I used the kxmovie (https://github.com/kolyvan/kxmovie) as example

I searched in many examples but only this code worked

Upvotes: 0

Neva
Neva

Reputation: 1330

The solution I would recommend would be to display a kind of web view, and then put the video embedded in the HTML.

Like generate some html code with your flv link.

Here is an example of what I'm talking about.

- (void)embedYouTube:(NSString*)url frame:(CGRect)frame {  
 NSString* embedHTML = @"\ 
    <html><head>\ 
 <style type=\"text/css\">\ 
 body {\ 
 background-color: transparent;\ 
 color: white;\ 
 }\ 
 </style>\ 
 </head><body style=\"margin:0\">\ 
    <embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ 
 width=\"%0.0f\" height=\"%0.0f\"></embed>\ 
    </body></html>";  
 NSString* html = [NSString stringWithFormat:embedHTML, url, frame.size.width, frame.size.height];  
 if(videoView == nil) {  
   videoView = [[UIWebView alloc] initWithFrame:frame];  
   [self.view addSubview:videoView];  
 }  
 [videoView loadHTMLString:html baseURL:nil];  
}  

hope this helps in any way.

Upvotes: 1

Related Questions