简体   繁体   English

iPhone的ffmpeg编码问题

[英]iphone encode problem with ffmpeg

I need to encode a video from image. 我需要从图像编码视频。 I use ffmpeg and compiling rigth. 我使用ffmpeg和编译权。 My problem is that when i try to opne video with quicktime on iphone, this give me a message "this movie format is not supported". 我的问题是,当我尝试在iPhone上使用QuickTime播放视频时,这会提示我“不支持该电影格式”。 I create a file mp4 with this parameter on context: 我在上下文中使用此参数创建文件mp4:

context->time_base.num = 1;
context->time_base.den = 15;
context->codec_type = CODEC_TYPE_VIDEO;
context->codec_id = CODEC_ID_H264;
context->bit_rate = 1000000;

context->width = width; 
context->height = height;

context->keyint_min = 10;
context->i_quant_factor = 0.71;
context->bit_rate_tolerance = 20000;
context->rc_max_rate = 100000;
context->rc_buffer_size = 8835000;
context->qcompress = 0.6;
context->qmin = 10;
context->qmax = 30;
context->max_qdiff = 4;
context->gop_size = 30;

context->time_base.num = 1;

context->time_base.den = 30;
context->sample_aspect_ratio = av_d2q(1, 255);
context->profile = 30;

context->pix_fmt =  PIX_FMT_YUV420P;

context->flags |= CODEC_FLAG_LOOP_FILTER;

where is my mistake?? 我的错误在哪里? thanks 谢谢

您应该改用AVFoundation,这样可以在编码时使用硬件加速。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM