0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

libobs: Force hvc1 codec tag for HEVC video and respect input tags

This commit is contained in:
PatTheMav 2022-11-02 05:24:09 +01:00 committed by Patrick Heyer
parent 097e9ccecf
commit bbb3dc0059

View File

@ -149,7 +149,16 @@ static inline bool init_output(media_remux_job_t job, const char *out_filename)
av_dict_copy(&out_stream->metadata, in_stream->metadata, 0);
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
out_stream->codecpar->codec_tag = 0;
if (in_stream->codecpar->codec_tag != 0) {
out_stream->codecpar->codec_tag =
in_stream->codecpar->codec_tag;
} else if (in_stream->codecpar->codec_id == AV_CODEC_ID_HEVC) {
// Tag HEVC files with industry standard HVC1 tag for wider device compatibility
out_stream->codecpar->codec_tag =
MKTAG('h', 'v', 'c', '1');
} else {
out_stream->codecpar->codec_tag = 0;
}
#else
out_stream->codec->codec_tag = 0;
out_stream->time_base = out_stream->codec->time_base;