This is the time of last year to do a project to write an article, the project background is to have an IP camera (with a Web server), the ipad to achieve real-time video monitoring, the first to understand the RTP, RTSP, H. s and so on some professional concepts, after the TCP handshake to establish a connection to receive data, the final result is to receive data do not know how to parse with FFmpeg, and then use a third-party program Iframeextractor Skip These troublesome steps, provide a rtsp://... The server address to play the video. Here's what the article says:
The implementation of the video live feature of the iOS platform mainly uses the third-party class library ffmpeg, which provides video codec and decoding solution. However, the use of such libraries for video streaming is very complex and cumbersome, there is an iOS platform Iframeextractor project, you can use it to realize the video broadcast function.
Steps:
1, in the local compilation ffmpeg; (See accessories at the bottom)
2, borrowing Iframeextractor project.
First, the local compilation FFmpeg
First git clone git://source.ffmpeg.org/ffmpeg.git download the ffmpeg source file.
Compile steps See a foreigner-written tutorial: http://www.tangentsoftworks.com/2012/11/12/ how-to-prepare-your-mac-for-ios-development-with-ffmpeg-libraries/
It is important to note that:
1. The above-mentioned compilation tutorials for foreigners are only suitable for the following environments:
Mac OS X10.8.2 + Xcode4.5.2 (4g2008a)
PS: I did not compile successfully in the Mac OS X10.8.3 environment.
2. This tutorial gas-preprocessor linked file compilation may be wrong, it is recommended to download the latest version of Gas-preprocessor, Link here:
Https://github.com/mansr/gas-preprocessor
As for other platforms how to compile, Https://github.com/lajos/iFrameExtractor this page has compiled steps, never tried.
3. See the compilation steps in the tutorial are divided into i386, ARMv6, ARMV7, armv7s, need to understand the emulator and the real machine and the real machine between the use of different instruction set processor architecture, so to compile separately. which
I386 for simulators
ARMv6 for devices prior to 3GS
ARMv7 for 3GS after IPhone5 and IPAD4 devices
Armv7s for IPhone5 and iPad4 and after equipment
4. Determine whether the compilation is successful or not
Create a new Xcode project with the following configuration:
① will Libavcodec,libavdevice,libavfilter,libavformat,libavresample, libavutil,libswresample,libswscale folder to the project root directory, see figure: (Note folder color)
② find all. A files and drag them to the Project Frameworks folder, as shown in the figure:
③ adding class libraries libbz2.dylib,libz.dylib,libiconv.dylib
④build Settings
add $ (srcroot) for Header Search Paths (PS: Related to Lib folder path)
add $ (srcroot) for Library Search Paths
The above is configured and then verified with code:
Add in the APPDELEGATE.M file
#include "avformat.h"
Then add the Didfinishlaunchingwithoptions method
Av_register_all ();
Then command+r run the validation, and follow this step and there should be no error.
Second, borrowing Iframeextractor project
Download this project
git clone git://github.com/pinkyjie/iframeextractor.git
There are four files in this project that need to be used,utilities.h/utilities.m and videoframeextractor.h/videoframeextractor.m, Drag the four files to the project and see Iframeextractor.git's IFRAMEEXTRACTORAPPDELEGATE.H/IFRAMEEXTRACTORAPPDELEGATE.M file for usage.
Be aware that the initialization of Videoframeextractor
Self.video=[[videoframeextractor alloc]initwithvideo:videourlstring];
Among them, Videourlstring is the "rtsp://..." link.
Report:
Mac OS X10.8.2 + Xcode4.5.2 Environment compilation FFmpeg Foreigner Tutorial:
http://www.tangentsoftworks.com/2012/11/12/how-to-prepare-your-mac-for-ios-development-with-ffmpeg-libraries/
The above link has expired, checked, the article here:
Http://ywanguu.blogspot.com/2013/02/how-to-prepare-your-mac-for-ios.html
FFmpeg source code Download Link:
Https://github.com/FFmpeg/FFmpeg
Iframeextractor Project Download link
Https://github.com/lajos/iFrameExtractor
Gas-preprocessor File Download link
Https://github.com/mansr/gas-preprocessor
With the FFmpeg I compiled successfully
Http://pan.baidu.com/s/1ntFklhZ
2013-06-28