mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 19:45:33 +00:00
MediaCapture/FFmpeg: Default to VP9
This commit is contained in:
parent
6baea54e9d
commit
e40bd20ea8
@ -22,6 +22,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -2112,10 +2113,16 @@ bool MediaCaptureFFmpeg::InternalBeginCapture(float fps, float aspect, u32 sampl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FFmpeg decides whether mp4, mkv, etc should use h264 or mpeg4 as their default codec by whether x264 was enabled
|
// Default to VP9, because there's no LGPL H.264 encoder. In Flatpak builds, openh264 should be available.
|
||||||
// But there's a lot of other h264 encoders (e.g. hardware encoders) we may want to use instead
|
#ifdef __linux__
|
||||||
if (!vcodec && wrap_avformat_query_codec(output_format, AV_CODEC_ID_H264, FF_COMPLIANCE_NORMAL))
|
const AVCodecID default_video_codec = (std::getenv("container") != nullptr) ? AV_CODEC_ID_H264 : AV_CODEC_ID_VP9;
|
||||||
vcodec = wrap_avcodec_find_encoder(AV_CODEC_ID_H264);
|
#else
|
||||||
|
constexpr AVCodecID default_video_codec = AV_CODEC_ID_VP9;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Use container default if available.
|
||||||
|
if (!vcodec && wrap_avformat_query_codec(output_format, default_video_codec, FF_COMPLIANCE_NORMAL))
|
||||||
|
vcodec = wrap_avcodec_find_encoder(default_video_codec);
|
||||||
if (!vcodec)
|
if (!vcodec)
|
||||||
vcodec = wrap_avcodec_find_encoder(output_format->video_codec);
|
vcodec = wrap_avcodec_find_encoder(output_format->video_codec);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user