The simplest example of mobile terminal based on FFmpeg attachment: built-in IOS player, ffmpegios

Source: Internet
Author: User

The simplest example of mobile terminal based on FFmpeg attachment: built-in IOS player, ffmpegios

========================================================== ==================

List of the simplest FFmpeg-based mobile-end example series:

The simplest Mobile End example based on FFmpeg: Android HelloWorld

The simplest example of mobile terminal based on FFmpeg: Android Video Decoder

The simplest example of mobile terminal based on FFmpeg: Android video decoder-single library version

The simplest Mobile End example based on FFmpeg: Android streamer

The simplest example of a mobile terminal based on FFmpeg: Android video Transcoder

The simplest Mobile End example based on FFmpeg attachment: built-in player for Android

The simplest example of FFmpeg-based mobile terminal attachment: SDL Android HelloWorld

The simplest Mobile End example based on FFmpeg: IOS HelloWorld

The simplest example of mobile terminal based on FFmpeg: IOS Video Decoder

The simplest example of Mobile End Based on FFmpeg: IOS streamer

The simplest example of a mobile terminal based on FFmpeg: IOS video Transcoder

The simplest example of a mobile terminal based on FFmpeg attachment: built-in player for IOS

The simplest example of FFmpeg-based mobile terminal: Windows Phone HelloWorld

========================================================== ==================


Previous articles record FFmpeg-based multimedia programs in IOS. This document records a video player that comes with IOS. Compared with FFmpeg, Playing videos in IOS multimedia framework is much easier-you only need to call several interfaces.



The source code of the source code project is located in the ViewController. m file. The content is as follows.
/*** The Simplest IOS Video Player *** Simplest IOS Player *** Ray Xiaohua Lei Xiaohua * leixiaohua1020@126.com * China Media University/Digital TV Technology * Communication University of China/Digital TV Technology * http://blog.csdn.net/leixiaohua1020 ** this app is the simplest video player on IOS. * This software is the simplest Video Player on IOS. **/# import "ViewController. h "# import <MediaPlayer/MediaPlayer. h> @ interface ViewController () @ property (nonatomic, strong) MPMoviePlayerController * moviePlayer; // video playback controller @ end @ implementation ViewController-(void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self. moviePlayer play]; [sel F addNotification];}-(void) dealloc {// remove all Notification monitoring [[nsicationicationcenter defacenter center] removeObserver: self];}-(MPMoviePlayerController *) moviePlayer {if (! _ MoviePlayer) {NSString * urlStr = [[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: @ "resource. bundle/war3end.mp4 "]; NSURL * url = [NSURL fileURLWithPath: urlStr]; _ moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL: url]; _ moviePlayer. view. frame = self. view. bounds; _ moviePlayer. view. autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self. view addSubview: _ moviePlayer. view];} return _ moviePlayer;}-(void) addNotification {NSNotificationCenter * icationicationcenter = [nsnotifcenter center defacenter center]; [icationicationcenter addObserver: self selector: @ selector (mediaPlayerPlaybackStateChange :) name: MPMoviePlayerPlaybackStateDidChangeNotification object: self. moviePlayer]; [icationicationcenter addObserver: self selector: @ selector (mediaPlayerPlaybackFinished :) name: MPMoviePlayerPlaybackDidFinishNotification object: self. moviePlayer];}-(void) mediaPlayerPlaybackStateChange :( NSNotification *) notification {switch (self. moviePlayer. playbackState) {case MPMoviePlaybackStatePlaying: NSLog (@ "playing... "); break; case MPMoviePlaybackStatePaused: NSLog (@" pause playback. "); break; case MPMoviePlaybackStateStopped: NSLog (@" stop playing. "); break; default: NSLog (@" playback status: % li ", self. moviePlayer. playbackState); break ;}}- (void) mediaPlayerPlaybackFinished :( NSNotification *) notification {NSLog (@ "playback completed. % li ", self. moviePlayer. playbackState);}-(void) didReceiveMemoryWarning {[super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated .} @ end
 


Shows the running result of the App running on the mobile phone. After the program runs, the war3end.mp4 file in resource.bundleis automatically added.



Download
Simplest ffmpeg mobile

Project Homepage

Github: https://github.com/leixiaohua1020/simplest_ffmpeg_mobile

Open source China: https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_mobile

SourceForge: https://sourceforge.net/projects/simplestffmpegmobile/


CSDN project: http://download.csdn.net/detail/leixiaohua1020/8924391


This solution contains various examples of using FFmpeg to process multimedia on mobile terminals:
[Android]
Simplest_android_player: Android-Based Video Player
Simplest_ffmpeg_android_helloworld: The FFmpeg-based HelloWorld program in Android
Simplest_ffmpeg_android_decoder: the simplest FFmpeg-based video decoder on Android
Simplest_ffmpeg_android_decoder_onelib: the simplest FFmpeg-Based Video Decoder for Android-single library
Simplest_ffmpeg_android_streamer: the simplest FFmpeg-based streamer on Android
Simplest_ffmpeg_android_transcoder: The FFmpeg command line tool transplanted on the Android platform
Simplest_sdl_android_helloworld: the simplest program to port SDL to Android.
[IOS]
Simplest_ios_player: A Video Player Based on the IOS Interface
Simplest_ffmpeg_ios_helloworld: The FFmpeg-based HelloWorld program in IOS
Simplest_ffmpeg_ios_decoder: the simplest FFmpeg-based video decoder on IOS
Simplest_ffmpeg_ios_streamer: the simplest FFmpeg-based streamer on IOS
Simplest_ffmpeg_ios_transcoder: The ffmpeg. c command line tool transplanted on the IOS platform
Simplest_sdl_ios_helloworld: the simplest program to port SDL to IOS.



Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.