几周来我一直在尝试在我的 ios 应用程序中实现 ffmpeg。现在我可以播放几个 avi 文件,但其他文件(例如 flv、wma、mp4...)播放速度很慢。
我花了很多时间使用 ffmpeg 和 opengl,但没有找到解决方案。
我正在寻找其他替代方案来在 ios 设备上播放此文件。
有人知道其他库、框架……我可以用它们来播放这个文件。不管有没有营业执照。
很感谢,
Edited:
初始化着色器:
shader = [[GLShader alloc] initWithFileName:@"render" attributes:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:0], @"position",
[NSNumber numberWithInt:1], @"texCoords", nil]
uniforms:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:0], @"sampler0",
[NSNumber numberWithInt:0], @"viewProjectionMatrix",nil]];
渲染.fsv:
uniform sampler2D sampler0;
varying highp vec2 _texcoord;
void main()
{ gl_FragColor = texture2D(sampler0, _texcoord);}
渲染.vsf:
attribute vec4 position;
attribute vec2 texCoords;
varying vec4 colorVarying;
varying vec2 _texcoord;
uniform mat4 viewProjectionMatrix;
void main()
{ _texcoord = texCoords;
gl_Position = viewProjectionMatrix * position;}
我如何在这段代码中实现您的解决方案?