如何像 iPhone 中的 Talking Tomcat 应用程序一样录制屏幕视频? [英] how to record screen video as like Talking Tomcat application does in iphone?

查看:21
本文介绍了如何像 iPhone 中的 Talking Tomcat 应用程序一样录制屏幕视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我正在尝试记录我的游戏的游戏玩法,以便我可以将其视频从设备本身上传到 youtube……我正在尝试做与 iPhone 的 Talking tomcat 应用程序相同的事情……录制视频然后播放等等...

hey i m trying the record the gameplay of my game so that i can upload its video to youtube from device itself...m trying to do same thing as Talking tomcat app for iphone..recording the video then playing it ,etc...

我使用 glReadPixels() 读取帧缓冲区数据,然后借助 AVFoundation 框架中的 AVAssetWriter 将其写入视频.但是,只有在使用 glReadPixels 时,读取每个绘图上的数据才会将 FPS 从大约 30-35 降低到 2-3.

i m using glReadPixels() for reading framebuffer data and then writing it to video with the help of AVAssetWriter in AVFoundation framwork. But reading the data on each drawing decreases the FPS from around 30-35 to 2-3 only while using glReadPixels.

我认为会说话的 tomcat 也是在 Opengl ES 的帮助下制作的,它还具有视频录制功能,但在阅读每一帧时它不会减慢速度......?

i think Talking tomcat is also made with the help of Opengl ES it also has the video recording facility but it doesnot slows down while reading each frame any idea.... ?

推荐答案

如果有人想实现相同的..我自己想通了.首先令我惊讶的是,我发现会说话的 tomcat 不是 3D 游戏应用程序……它对所有动作都使用帧动画.如果有人想捕捉这种观点,那么他们可以使用以下代码---

In case someone want to implement the same..i figured out myself. First of all to my surprise i found that talking tomcat is not a 3D game app...it uses frame animations for all movements. and if some one wants to capture the that kind of view then they can use following code---

UIGraphicsBeginImageContext(self.view.bounds.size); //self.view.window.frame.size
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

然后使用 AVAssetWriter 从该帧创建视频.当然你可以在其他帖子中找到代码.对我来说它没有用,因为我必须捕获 3D 部分.干杯

and then use AVAssetWriter for creating the video from that frames. ofcourse you can find code for that in some other post.. For me its not useful as i have to capture 3D part.. Cheers

这篇关于如何像 iPhone 中的 Talking Tomcat 应用程序一样录制屏幕视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆