哪位好心人能借用一下苹果手机avplayer字幕帐号

AVPlayerHD v2.6 - 超强媒体播放器 中文版
一款功能非常强大的视频播放器,支持多种格式视频文件流畅播放。支持 XVID/DIVX,AVI,WMV,RMVB,ASF,H264,MKV
等格式,同时支持 SMI, SRT 字幕。支持 USB/WIFI
传输文件,文件存放目录:/private/var/mobile/Documents
& 视频格式扩大
- Dolby Digital (AC3), Dolby Digital Plus (EAC3)
- Support High quality video clips ( 720P, 1080P )
- MKV,XVID,AVI,WMV,RMVB,ASF,H264,&
- SMI,TXT,SRT,SubStationAlpha字幕
- 高解像度清晰画面
- 乌贼墨色,灰度,彩色化
& 播放速度调节
- 用户配置
- 往右推:10秒后
- 往左推:10秒前
- 往上推:1。5倍速
- 往下推:基本速度
& 附加功能
- 锁定颠倒/画面比:自动/16:9 4:3 1:1 全画面
- 文件夹管理:密码,修改档名,移动文件,生成文件夹
- 继续播放
- 拖动导航
& USB/WIFI传送
版本 2.6 中的新功能
- Fulll 64-bit support&
- Fixed webdav issues on windows 7
- Fixed a crash bug when playing a video on Google Drive
- Minor bug fixes
&若下载得到的文件为 .zip 压缩文件,请手动修改扩展名为 .ipa 即可。
请使用 iTunes、 等工具安装本站软件,建议使用
下载、安装、管理您机器上的 ipa
本站软件大都转载自 apptrackr,威锋等网站,仅为方便网友,如侵犯到您的合法利益,请联系我们。
本站从网上收集的一些商业软件仅供学习、试用,请于下载后 24 小时内删除,并自行购买。
试用本站下载软件需要先越狱,然后安装 AppSync,否则无法安装使用。【】
我猜你还喜欢  后续更新: v2.6.1, v2.7.0, v3.0.0
评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
AVplayer播rm确实好,但是播网络下载的mkv很多都只有图像没有声音,拖进度条就会出错,播mkv现在是Oplayer最好 管理员回复: 试试 nPlayer /multimedia/avplayer/nPlayer-iPad-iPhone.html
好东西必须顶
2.0版太给力了,之前的版本播放RMVB视频一直有问题,现在不光普通RMVB,P的RMVB都能流畅播放,估计是换内核了
新版非常难用,声音也没办法调节,必须二次操作。
从1.5开始播放RMVB格式电影一快进就没声音,到1.6了仍没解决,现在还在用1.4,是不是开发小组放弃RMVB的支持了
求更新1.63
新版本。我这无法记录之前播放到哪个时段了,每次都重新播放,郁闷
iOS上最好的播放器,虽有小小不足,但已让我足够满意
求更新到1.6版本
这个版本的放RMVB简直就是灾难啊!换回1.4了
AVplayer,是不是专门看AV的咧?
老大是不是以后上传文件用DBank代替115吧,115不行了啊!
更新后rmvb还卡不了?有知道的告诉下,谢谢。
51ipa是我见过最好最负责最萌的管理员了,哈哈
这次的更新太强大了,完全支持1080P了,如果字幕的显示效果能像xmbc一样的话就无敌了~
我想给文件夹设密码,点开密码选项为ON时,弹出窗口要我输入密码,可怎么输都提示密码错误,难道是有初始密码么?我还把软件重新安装了一遍,第一次进去还是要输入密码,一直提示密码错误。求指导。程序员承认这是一
总是声音和画面不同步啊~~
我的是 4 完美越狱了 为什么视频播放的时候会闪退 请尽快回复 谢谢 管理员回复: iPad 1? iPad 2? 闪退很正常,内存不够了。重启试试
这货最大的优点是可以挂srt,smi字幕,如果文件是h264的mp4,就不卡。h264的mkv还是会卡。貌似是判断硬解用文件名?不过不支持ass字幕很遗憾呀。
我想给文件夹设密码,点开密码选项为ON时,弹出窗口要我输入密码,可怎么输都提示密码错误,难道是有初始密码么?我还把软件重新安装了一遍,第一次进去还是要输入密码,一直提示密码错误。求指导。
打开wifi,秒退
一打开wifitransfer就
一打开wifi transfer就秒退
楼下的同学们说得很对。。这个升级后文件目录改变了。。以前是直接将文件放在Document中就可以在软件里显示并播放了。现在更新后原来的文件还在Document里可是打开软件显示没有任何文件。。后来发现路径变了。应该把
文件目录是/var/mobile/applications/xxxxxxxxx/library/catches/documents
Fixed slow iTunes backup caused by data file 这个很关键! 这个完整准确的意思是什么?
关于avplayer的路径,在没安装新版本的时候都是在document文件夹里的,然后现在放进去的文件在软件里显示不出来,,后来发现在library里Caches的document里才能显示,这个文件夹不是放缓存的吗?用ifunbox/itools拉
- Fixed slow iTunes backup caused by data file 这个很关键!
以前的版本直接拖个文件夹进去都可以显示,但是现在拖进去了软件里面根本没有显示,什么原因? 管理员回复: 用 iTunes 拖的吗
不好意思,看错了。zip没改成ipa
这个在itunes显示为iphone,ipod touch应用
不是ipad的
希望比OPLAYER好
错误代码-是什么情况啊楼主,万分感谢 管理员回复: 请在设置 - 通用 - 访问限制一栏中检查是否对安装应用程序和删除应用程序做了限制。如果做了限制,关闭该限制即可。
多谢!很顺利装上了!可以看rmvb了哦耶
楼主,这个软件安装的时候显示是invalid ipa 无效软件,其他软件都能安装,就这个软件安装失败,显示无效,求救 管理员回复: 对比 sha1 码,看看是不是你下载的问题,还有你的 iOS 符不符合,还有是不是 iPad 版装
亲爱的管理员,听说你是玉树临风赛潘安,一朵梨花压海棠,帅气洞彻九重天,宇宙无敌老美男。 麻烦GG能不能上三国塔防的啊,好想,好想要。 管理员回复: iTunes 链接?
软件安装失败(错误代码:-)我用的是91安装的 破解过的4.2.1版本touch4 管理员回复: 用 91 的不懂,没用过,抱歉。
代码错误怎么回事? 管理员回复: 啥错误代码?具体的
怎么传到机器里呢? 管理员回复: iTunes, iTool, iFunbox, 同步助手,...
为什么拉不进itunes里啊?说的是文件无效 管理员回复: 重新下载
好的,我在试试看,谢谢了
用iTools安装走完安装进度条以后安装那里就变成安装失败,不知道代码埃我的ipad24.3.3 管理员回复: 软件本身没问题的,你试试
的同步助手。
安装不上啊,用iTools安装失败,确定已越狱,且安装了AppSync 4+ 什么原因啊? 管理员回复: 错误代码说一下呀,什么机器?什么系统?
如果不越狱,可以装吗?谢谢管理员 管理员回复: 不可以
你好,我的ipad没有越狱,我刚才下载了这个软件,同步不到ipad上是这个原因吗?谢谢
为什么同步到ipad会发生未知错误呢 管理员回复: 没越狱?越了没装 AppSync?
太好啦,找了很久,谢谢分享!谢谢51ipa!
请问怎么用itune传视频啊?不是MP4格式的不让传啊~ 管理员回复: iTunes 选择应用程序那里,下方,程序共享文档。
秒杀oplayer啊
今天貌似又更新了
管理员~ 我用itune上传不到啊? 我越狱了~ 管理员回复: 估计没装 AppSync
IP4的1.4版本在哪下载?管理员! 这个是ipad的啊
此软件已经也了1.4版 期待更新
thanks for sharing
怎么没有iphone版本 管理员回复: 有啊
可以说这是我升级到4.2的关键原因啊,谢谢楼主分享呢~
不是ipad版本 管理员回复: 已修正
管理员你好 我试了几个视频 发现只有用WIFI才能传上去 。 用传输软件传到那个存放目录 打开播放器没有。 管理员回复: 用 iTunes 放最方便
怎么用不了啊?装不上呢 管理员回复: 越狱了吗?
终于有了,内牛满面啊,谢谢~
人气:264045
人气:419190
人气:264045
人气:254896
人气:224930
人气:181171
人气:79917
人气:75591
人气:62824
人气:61260AVPlayer on the App Store
Opening the iTunes Store.If iTunes doesn't open, click the iTunes application icon in your Dock or on your Windows desktop.Progress Indicator
Opening the iBooks Store.If iBooks doesn't open, click the iBooks app in your Dock.Progress Indicator
iTunes is the world's easiest way to organize and add to your digital media collection.
We are unable to find iTunes on your computer. To buy and download AVPlayer by EPLAYWORKS, get iTunes now.
Already have iTunes? Click I Have iTunes to open it now.
By EPLAYWORKS
Open iTunes to buy and download apps.
Description
Do you enjoy watching videos on your iPhone? Do you hate not being able to because your iPhone cannot support the video format? Or do you hate the inconvenient and time-consuming hassle of trying to convert video formats to fit into one that your iPhone can support? This is why the AVPlayer was created. The AVPlayer can play almost any computer video file format such as AVI, Xvid, WMV and much more clearly and effortlessly. No converting hassles. Just copy files via USB and just drag and drop into the AVPlayer’s Media Explorer. The AVPlayer can also support external subtitle files such as SMI and SRT. So if you enjoy watching videos on your iPad, then the AVPlayer is an absolute necessity. o Support Formats- Dolby Digital (AC3), Dolby Digital Plus (EAC3)- Support High quality video clips ( 720P, 1080P )- MP4,MOV,M4V- XVID,AVI,WMV,RMVB,ASF,H264,MKV… most of all movie file formats. - SMI, SRT, TXT, SubStationAlpha Subtitles o Post Processing - High quality video processing - Contrast,Saturation,Brightness - TV-Out o Control the playback speed (From 0.5X to 2.0X) - User setting support - Sweep to the left : move to backword 10 sec - Sweep to the right : move to forward 10 sec - Sweep to the top : 1.5X speed - Sweep to the down : normal speed o Additional features - Rotation Lock / Aspect ratio:auto/16:9/4:3/Full screen - Folder Management:Pass code/Move/Rename/Create - Resume play from last position - Scrubbing search - supports e-mail attachment by "Open In" feature o USB/WIFI Transfer o Note 1. How to add video with USB - Run iTunes 9.1 or above - Device->My Device(My iPad)->Apps, drag and drop files to the AVplayer's documents 2. Support High quality video clips ( 720P, 1080P )- High quality video clips of 720P (1280 x 720) or more are recommended for MP4 format. - MP4, MOV, M4V formats that QuickTime supports can be played up to 1080P by using H/W Decoder but, Post Processing function isn’t provided.- Support H/W decoding for MKV and AVI (720P supported on iPad1, 1080P supported on iPad2 / The New iPad)- Hybrid decoding mode is added and now it is able to play high resolution videos by using hardware accelerator feature embedded in iPhone/iPad even for mkv or avi in h264. Also battery use time has extended.- Application may crash in iPhone 3GS / iPod Touch due to heavy use of memory in Hybrid decoding. Try turning off all application running in background and reboot the device by holding down sleep mode button for long time.
- If screen shakes it means hardware decoding is not supported. Try turning off hybrid decoding.- When the file formats are available for MKV or AVI the player supports hardware decoding.- If you cannot choose audio in mp4 or avi, change the extension to mkv temporarily and chosen audio channel will be applied.3. The optimal speed when advancing its playing speed can differ depending on the way it’s compressed and the size. Video clips of XVID (AVI) 720 x 480 can be fast played up to 1.3-1.5 times faster than normal.
What's New in Version 2.6
- Support iPhone 6 and iPhone 6 plus resolution- Fulll 64-bit support - Fixed webdav issues on windows 7- Fixed a crash bug when playing a video on Google Drive- Minor bug fixes
iPhone Screenshot
Customer Reviews
A Stalwart app
The most reliable app I ever downloaded, and the most versatile.
I got this app in early 2012, and for an audio/videophile, it's the most useful app ever made.
Any format, any size, any resolution, and an excellent file system to boot.
This thing plays stuff that my computer can't handle.
Now it even plays your movies from its own cloud.
Don't listen to the spoiled brats who expect everything new to work flawlessly.
I got what I paid for and a ton extra.
Excellent App!!
I love this App! I travel a lot and I don't always have my laptop at hand to watch a bunch of downloaded training videos. The video quality on my iPhone 6 Plus is excellent and I particularly like the ability to increase/decrease the playbackspeed. I find this a very useful feature when reviewing a video for educational purpose. Keep up the good works!
Connecting to your Cloud
Using my Western digital cloud I tried using the wifi dlna server to access my videos, and avplayer will always play the last file. Even when downloading the file, it won't work. The proper file name is displayed but wrong file. Unless you use a different app to retrieve your videos and then transfer to the player essentially copying the file twice just to view it. Really cumbersome to work with, especially for presentations.
Customers Also Bought
$2.99Category: Version: 2.6Size: 32.4 MBLanguages: English, French, German, Japanese, Korean, Polish, Russian, Simplified Chinese, Spanish, Traditional Chinese, TurkishSeller: EPLAYWORKSCompatibility: Requires iOS 6.0 or later. Compatible with iPhone, iPad, and iPod touch.
Customer Ratings
Current Version:
4.02703&&&&&37 Ratings
All Versions:
&&&&&773 Ratings
More iPhone Apps by EPLAYWORKS
Discover and share new apps.
Follow us on .
Discover and share new music, movies, TV, books, and more.
and discover new iTunes Radio Stations and the music we love.后使用快捷导航没有帐号?
查看: 607|回复: 9
新人欢迎积分1 阅读权限70积分7931精华0UID帖子金钱31443 威望2
Lv.7, 积分 7931, 距离下一级还需 2069 积分
UID帖子威望2 多玩草590 草
本帖最后由 心雨星晴 于
20:04 编辑
现在不给注册了,哪位好心人借用一下!用完马上还,到最后的整合了。
19:30:11 上传
夜舞丿红颜
新人欢迎积分0 阅读权限60积分3805精华0UID6252341帖子金钱31729 威望0
红颜々淚℡
Lv.6, 积分 3805, 距离下一级还需 1195 积分
UID6252341帖子威望0 多玩草580 草
心雨星晴 发表于
现在不给注册了,哪位好心人借用一下!用完马上还,到最后的整合了。
angel888k密码
爱嫉妒的小人都去死!!!
别跟我说版权问题,端午重阳春节差点都被别人抢去,还跟他们讲什么权!DY岛竞争那么激烈,也没看到谁蹦出来说话!!都是窝里横的类型!!
新人欢迎积分1 阅读权限70积分7931精华0UID帖子金钱31443 威望2
Lv.7, 积分 7931, 距离下一级还需 2069 积分
UID帖子威望2 多玩草590 草
ゞ薍〥Angel℡ 发表于
angel888k密码
已经有了,不过还是谢谢你。
新人欢迎积分1 阅读权限50积分1554精华0UID4320038帖子金钱2081 威望0
Lv.5, 积分 1554, 距离下一级还需 946 积分
UID4320038帖子威望0 多玩草98 草
ゞ薍〥Angel℡ 发表于
angel888k密码
朋友 能借下EX账号吗=、=&&试了你发的这个 密码不对呀。 我也是没的注册了 拼合不了文件[ddt15]
夜舞丿红颜
新人欢迎积分0 阅读权限60积分3805精华0UID6252341帖子金钱31729 威望0
红颜々淚℡
Lv.6, 积分 3805, 距离下一级还需 1195 积分
UID6252341帖子威望0 多玩草580 草
asdfse 发表于
朋友 能借下EX账号吗=、=&&试了你发的这个 密码不对呀。 我也是没的注册了 拼合不了文件 ...
我去看看!!!
爱嫉妒的小人都去死!!!
别跟我说版权问题,端午重阳春节差点都被别人抢去,还跟他们讲什么权!DY岛竞争那么激烈,也没看到谁蹦出来说话!!都是窝里横的类型!!
夜舞丿红颜
新人欢迎积分0 阅读权限60积分3805精华0UID6252341帖子金钱31729 威望0
红颜々淚℡
Lv.6, 积分 3805, 距离下一级还需 1195 积分
UID6252341帖子威望0 多玩草580 草
asdfse 发表于
朋友 能借下EX账号吗=、=&&试了你发的这个 密码不对呀。 我也是没的注册了 拼合不了文件 ...
账号被盗了!!!
爱嫉妒的小人都去死!!!
别跟我说版权问题,端午重阳春节差点都被别人抢去,还跟他们讲什么权!DY岛竞争那么激烈,也没看到谁蹦出来说话!!都是窝里横的类型!!
新人欢迎积分1 阅读权限50积分1554精华0UID4320038帖子金钱2081 威望0
Lv.5, 积分 1554, 距离下一级还需 946 积分
UID4320038帖子威望0 多玩草98 草
ゞ薍〥Angel℡ 发表于
账号被盗了!!!
湖北五奶熊
新人欢迎积分0 阅读权限40积分623精华0UID帖子金钱3981 威望0
Lv.4, 积分 623, 距离下一级还需 377 积分
UID帖子威望0 多玩草0 草
现在又不能注册了? 09年时注册的路过。。。
新人欢迎积分0 阅读权限20积分27精华0UID帖子金钱122 威望0
Lv.2, 积分 27, 距离下一级还需 23 积分
UID帖子威望0 多玩草0 草
急求啊 !!!绝对不该密码啊!!!!
新人欢迎积分1 阅读权限20积分41精华0UID帖子金钱119 威望0
Lv.2, 积分 41, 距离下一级还需 9 积分
UID帖子威望0 多玩草0 草
谁还有&&求用
需要金钱:1100
Powered by
手机盒子客户端点击或扫描下载A blog about coding, life, and other arbitrary topics
Awhile back I posted a handful of simple .
Among them was a basic ScreenCaptureView implementation that would periodically render the contents of its subview(s) into a UIImage that was exposed as a publicly accessible property.
This provides the ability to quickly and easily take a snapshot of your running application, or any arbitrary component within it.
And while not superbly impressive (the iPhone has a built-in screenshot feature, after all), I noted that the control theoretically allowed for captured frames to be sent off to an AVCaptureSession in order to record live video of a running application.
Recently I returned to this bit of code, and the ability to record live video of an application is theoretical no longer.
To get straight to the point, here is the revised code:
//ScreenCaptureView.h
#import &UIKit/UIKit.h&
#import &AVFoundation/AVFoundation.h&
* Delegate protocol.
Implement this if you want to receive a notification when the
* view completes a recording.
* When a recording is completed, the ScreenCaptureView will notify the delegate, passing
* it the path to the created recording file if the recording was successful, or a value
* of nil if the recording failed/could not be saved.
@protocol ScreenCaptureViewDelegate &NSObject&
- (void) recordingFinished:(NSString*)outputPathOrN
* ScreenCaptureView, a UIView subclass that periodically samples its current display
* and stores it as a UIImage available through the 'currentScreen' property.
* sample/update rate can be configured (within reason) by setting the 'frameRate'
* property.
* This class can also be used to record real-time video of its subviews, using the
* 'startRecording' and 'stopRecording' methods.
A new recording will overwrite any
* previously made recording file, so if you want to create multiple recordings per
* session (or across multiple sessions) then it is your responsibility to copy/back-up
* the recording output file after each session.
* To use this class, you must link against the following frameworks:
- AssetsLibrary
- AVFoundation
- CoreGraphics
- CoreMedia
- CoreVideo
- QuartzCore
@interface ScreenCaptureView : UIView {
//video writing
AVAssetWriter *videoW
AVAssetWriterInput *videoWriterI
AVAssetWriterInputPixelBufferAdaptor *avA
//recording state
NSDate* startedAt;
void* bitmapD
//for recording video
- (bool) startR
- (void) stopR
//for accessing the current screen and adjusting the capture rate, etc.
@property(retain) UIImage* currentS
@property(assign) float frameR
@property(nonatomic, assign) id&ScreenCaptureViewDelegate&
//ScreenCaptureView.m
#import &ScreenCaptureView.h&
#import &QuartzCore/QuartzCore.h&
#import &MobileCoreServices/UTCoreTypes.h&
#import &AssetsLibrary/AssetsLibrary.h&
@interface ScreenCaptureView(Private)
- (void) writeVideoFrameAtTime:(CMTime)
@implementation ScreenCaptureView
@synthesize currentScreen, frameRate,
- (void) initialize {
// Initialization code
self.clearsContextBeforeDrawing = YES;
self.currentScreen =
self.frameRate = 10.0f;
//10 frames per seconds
_recording =
videoWriter =
videoWriterInput =
avAdaptor =
startedAt =
bitmapData = NULL;
- (id) initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self initialize];
- (id) init {
self = [super init];
if (self) {
[self initialize];
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initialize];
- (CGContextRef) createBitmapContextOfSize:(CGSize) size {
CGContextRef
context = NULL;
CGColorSpaceRef colorS
bitmapByteC
bitmapBytesPerR
bitmapBytesPerRow
= (size.width * 4);
bitmapByteCount
= (bitmapBytesPerRow * size.height);
colorSpace = CGColorSpaceCreateDeviceRGB();
if (bitmapData != NULL) {
free(bitmapData);
bitmapData = malloc( bitmapByteCount );
if (bitmapData == NULL) {
fprintf (stderr, &Memory not allocated!&);
return NULL;
context = CGBitmapContextCreate (bitmapData,
size.width,
size.height,
// bits per component
bitmapBytesPerRow,
colorSpace,
kCGImageAlphaNoneSkipFirst);
CGContextSetAllowsAntialiasing(context,NO);
if (context== NULL) {
free (bitmapData);
fprintf (stderr, &Context not created!&);
return NULL;
CGColorSpaceRelease( colorSpace );
//static int frameCount = 0;
//debugging
- (void) drawRect:(CGRect)rect {
NSDate* start = [NSDate date];
CGContextRef context = [self createBitmapContextOfSize:self.frame.size];
//not sure why this is necessary...image renders upside-down and mirrored
CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, self.frame.size.height);
CGContextConcatCTM(context, flipVertical);
[self.layer renderInContext:context];
CGImageRef cgImage = CGBitmapContextCreateImage(context);
UIImage* background = [UIImage imageWithCGImage: cgImage];
CGImageRelease(cgImage);
self.currentScreen =
//debugging
//if (frameCount & 40) {
NSString* filename = [NSString stringWithFormat:@&Documents/frame_%d.png&, frameCount];
NSString* pngPath = [NSHomeDirectory() stringByAppendingPathComponent:filename];
[UIImagePNGRepresentation(self.currentScreen) writeToFile: pngPath atomically: YES];
frameCount++;
to record a scrollview while it is scrolling you need to implement your UIScrollViewDelegate such that it calls
'setNeedsDisplay' on the ScreenCaptureView.
if (_recording) {
float millisElapsed = [[NSDate date] timeIntervalSinceDate:startedAt] * 1000.0;
[self writeVideoFrameAtTime:CMTimeMake((int)millisElapsed, 1000)];
float processingSeconds = [[NSDate date] timeIntervalSinceDate:start];
float delayRemaining = (1.0 / self.frameRate) - processingS
CGContextRelease(context);
//redraw at the specified framerate
[self performSelector:@selector(setNeedsDisplay) withObject:nil afterDelay:delayRemaining & 0.0 ? delayRemaining : 0.01];
- (void) cleanupWriter {
[avAdaptor release];
avAdaptor =
[videoWriterInput release];
videoWriterInput =
[videoWriter release];
videoWriter =
[startedAt release];
startedAt =
if (bitmapData != NULL) {
free(bitmapData);
bitmapData = NULL;
- (void)dealloc {
[self cleanupWriter];
[super dealloc];
- (NSURL*) tempFileURL {
NSString* outputPath = [[NSString alloc] initWithFormat:@&%@/%@&, [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0], @&output.mp4&];
NSURL* outputURL = [[NSURL alloc] initFileURLWithPath:outputPath];
NSFileManager* fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:outputPath]) {
if ([fileManager removeItemAtPath:outputPath error:&error] == NO) {
NSLog(@&Could not delete old recording file at path:
%@&, outputPath);
[outputPath release];
return [outputURL autorelease];
-(BOOL) setUpWriter {
NSError* error =
videoWriter = [[AVAssetWriter alloc] initWithURL:[self tempFileURL] fileType:AVFileTypeQuickTimeMovie error:&error];
NSParameterAssert(videoWriter);
//Configure video
NSDictionary* videoCompressionProps = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithDouble:4.0], AVVideoAverageBitRateKey,
NSDictionary* videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
AVVideoCodecH264, AVVideoCodecKey,
[NSNumber numberWithInt:self.frame.size.width], AVVideoWidthKey,
[NSNumber numberWithInt:self.frame.size.height], AVVideoHeightKey,
videoCompressionProps, AVVideoCompressionPropertiesKey,
videoWriterInput = [[AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings] retain];
NSParameterAssert(videoWriterInput);
videoWriterInput.expectsMediaDataInRealTime = YES;
NSDictionary* bufferAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:kCVPixelFormatType_32ARGB], kCVPixelBufferPixelFormatTypeKey, nil];
avAdaptor = [[AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:videoWriterInput sourcePixelBufferAttributes:bufferAttributes] retain];
//add input
[videoWriter addInput:videoWriterInput];
[videoWriter startWriting];
[videoWriter startSessionAtSourceTime:CMTimeMake(0, 1000)];
return YES;
- (void) completeRecordingSession {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[videoWriterInput markAsFinished];
// Wait for the video
int status = videoWriter.
while (status == AVAssetWriterStatusUnknown) {
NSLog(@&Waiting...&);
[NSThread sleepForTimeInterval:0.5f];
status = videoWriter.
@synchronized(self) {
BOOL success = [videoWriter finishWriting];
if (!success) {
NSLog(@&finishWriting returned NO&);
[self cleanupWriter];
id delegateObj = self.
NSString *outputPath = [[NSString alloc] initWithFormat:@&%@/%@&, [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0], @&output.mp4&];
NSURL *outputURL = [[NSURL alloc] initFileURLWithPath:outputPath];
NSLog(@&Completed recording, file is stored at:
%@&, outputURL);
if ([delegateObj respondsToSelector:@selector(recordingFinished:)]) {
[delegateObj performSelectorOnMainThread:@selector(recordingFinished:) withObject:(success ? outputURL : nil) waitUntilDone:YES];
[outputPath release];
[outputURL release];
[pool drain];
- (bool) startRecording {
bool result = NO;
@synchronized(self) {
if (! _recording) {
result = [self setUpWriter];
startedAt = [[NSDate date] retain];
_recording =
- (void) stopRecording {
@synchronized(self) {
if (_recording) {
_recording =
[self completeRecordingSession];
-(void) writeVideoFrameAtTime:(CMTime)time {
if (![videoWriterInput isReadyForMoreMediaData]) {
NSLog(@&Not ready for video data&);
@synchronized (self) {
UIImage* newFrame = [self.currentScreen retain];
CVPixelBufferRef pixelBuffer = NULL;
CGImageRef cgImage = CGImageCreateCopy([newFrame CGImage]);
CFDataRef image = CGDataProviderCopyData(CGImageGetDataProvider(cgImage));
int status = CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, avAdaptor.pixelBufferPool, &pixelBuffer);
if(status != 0){
//could not get a buffer from the pool
NSLog(@&Error creating pixel buffer:
status=%d&, status);
// set image data into pixel buffer
CVPixelBufferLockBaseAddress( pixelBuffer, 0 );
uint8_t* destPixels = CVPixelBufferGetBaseAddress(pixelBuffer);
CFDataGetBytes(image, CFRangeMake(0, CFDataGetLength(image)), destPixels);
will work if the pixel buffer is contiguous and has the same bytesPerRow as the input data
if(status == 0){
BOOL success = [avAdaptor appendPixelBuffer:pixelBuffer withPresentationTime:time];
if (!success)
NSLog(@&Warning:
Unable to write buffer to video&);
//clean up
[newFrame release];
CVPixelBufferUnlockBaseAddress( pixelBuffer, 0 );
CVPixelBufferRelease( pixelBuffer );
CFRelease(image);
CGImageRelease(cgImage);
This class will let you record high-quality video of any other view in your application.
To use it, simply set it up as the superview of the UIView(s) that you want to record, add a reference to it in your corresponding UIViewController (using Interface Builder or whatever your preferred method happens to be), and then call ‘startRecording‘ when you are ready to start recording video.
When you’ve recorded enough, call ‘stopRecording‘ to complete the process.
You will get a nice .mp4 file stored under your application’s ‘Documents’ directory that you can copy off or do whatever else you want with.
Note that if you want to record a UIScrollView while it is scrolling, you will need to implement your UIScrollViewDelegate such that it calls ‘setNeedsDisplay‘ on the ScreenCaptureView while the scroll-view is scrolling.
For instance:
- (void) scrollViewDidScroll: (UIScrollView*)scrollView {
[captureView setNeedsDisplay];
I haven’t tested this code on a physical device yet, but there’s no reason why it should not work on any device that includes H.264 video codec support (iPhone 3GS and later).
However, given the amount of drawing that it does, it’s safe to say that the more horsepower behind it, the better.
Here is a rather unimpressive 30-second recording of a UITableView that I created using this class (if your browser doesn’t support HTML5, use the link below):
Lastly, I haven’t tested this class with any OpenGL-based subviews, so I can’t say if it will work in that case.
If you try it in this configuration, please feel free to reply with your results.
For anyone looking for a working example, you can download this .
This project simply creates a 30-second recording of a ‘UITableView‘.
This entry was posted in ,
and tagged , , , . Bookmark the .
Recent Posts
February 2016
891011121314
15161718192021
22232425262728
Categories

我要回帖

更多关于 avplayer播放器 的文章

 

随机推荐