all repos — mgba @ d3a60f655582408f5a3ccb932abdd21c6e2ca16e

mGBA Game Boy Advance Emulator

Video: Try to improve encoding speed/ratefactor a bit
Jeffrey Pfau jeffrey@endrift.com
Wed, 12 Nov 2014 22:50:30 -0800
commit

d3a60f655582408f5a3ccb932abdd21c6e2ca16e

parent

ec0b206fee166975fdb3667dee22da0ce50a1107

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M src/platform/ffmpeg/ffmpeg-encoder.csrc/platform/ffmpeg/ffmpeg-encoder.c

@@ -228,10 +228,13 @@ encoder->video->width = encoder->width;

encoder->video->height = encoder->height; encoder->video->time_base = (AVRational) { VIDEO_TOTAL_LENGTH, GBA_ARM7TDMI_FREQUENCY }; encoder->video->pix_fmt = encoder->pixFormat; - encoder->video->gop_size = 15; - encoder->video->max_b_frames = 0; + encoder->video->gop_size = 60; + encoder->video->max_b_frames = 3; if (encoder->context->oformat->flags & AVFMT_GLOBALHEADER) { encoder->video->flags |= CODEC_FLAG_GLOBAL_HEADER; + } + if (strcmp(vcodec->name, "libx264") == 0) { + av_opt_set(encoder->video, "tune", "zerolatency", 0); } avcodec_open2(encoder->video, vcodec, 0); encoder->videoFrame = av_frame_alloc();