mirror of https://github.com/mgba-emu/mgba.git
FFmpeg: Force MP4 files to YUV420P
This commit is contained in:
parent
d9b645b209
commit
6a77d2aaea
1
CHANGES
1
CHANGES
|
@ -82,6 +82,7 @@ Misc:
|
||||||
- Qt: Remove audio buffer sizing in AudioProcessorQt
|
- Qt: Remove audio buffer sizing in AudioProcessorQt
|
||||||
- Qt: Re-enable QtMultimedia on Windows
|
- Qt: Re-enable QtMultimedia on Windows
|
||||||
- FFmpeg: Return false if a file fails to open
|
- FFmpeg: Return false if a file fails to open
|
||||||
|
- FFmpeg: Force MP4 files to YUV420P
|
||||||
|
|
||||||
0.5.2: (2016-12-31)
|
0.5.2: (2016-12-31)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -304,6 +304,14 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
|
||||||
}
|
}
|
||||||
av_opt_set(encoder->video->priv_data, "tune", "zerolatency", 0);
|
av_opt_set(encoder->video->priv_data, "tune", "zerolatency", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (encoder->video->codec->id == AV_CODEC_ID_H264 &&
|
||||||
|
(strcasecmp(encoder->containerFormat, "mp4") ||
|
||||||
|
strcasecmp(encoder->containerFormat, "m4v") ||
|
||||||
|
strcasecmp(encoder->containerFormat, "mov"))) {
|
||||||
|
// QuickTime and a few other things require YUV420
|
||||||
|
encoder->video->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||||
|
}
|
||||||
avcodec_open2(encoder->video, vcodec, 0);
|
avcodec_open2(encoder->video, vcodec, 0);
|
||||||
#if LIBAVCODEC_VERSION_MAJOR >= 55
|
#if LIBAVCODEC_VERSION_MAJOR >= 55
|
||||||
encoder->videoFrame = av_frame_alloc();
|
encoder->videoFrame = av_frame_alloc();
|
||||||
|
|
Loading…
Reference in New Issue