From ac68c2f4c860e725c4f2f97f98d9377510ef281b Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 22 Jul 2019 10:03:16 +0200 Subject: [PATCH] codecs/h264: Add H264 codec information --- CMakeLists.txt | 2 ++ data/locale/en-US.ini | 9 ++++++ source/codecs/h264.cpp | 18 ++++++++++++ source/codecs/h264.hpp | 63 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 source/codecs/h264.cpp create mode 100644 source/codecs/h264.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b6974b..6942bd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,6 +266,8 @@ set(PROJECT_PRIVATE "${PROJECT_SOURCE_DIR}/source/strings.hpp" "${PROJECT_SOURCE_DIR}/source/codecs/hevc.hpp" "${PROJECT_SOURCE_DIR}/source/codecs/hevc.cpp" + "${PROJECT_SOURCE_DIR}/source/codecs/h264.hpp" + "${PROJECT_SOURCE_DIR}/source/codecs/h264.cpp" "${PROJECT_SOURCE_DIR}/source/encoders/generic.hpp" "${PROJECT_SOURCE_DIR}/source/encoders/generic.cpp" "${PROJECT_SOURCE_DIR}/source/encoders/prores_aw.hpp" diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index f7fc2df..e82faea 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -61,6 +61,15 @@ ProRes.Profile.Light="Light (LT)" ProRes.Profile.Standard="Standard" ProRes.Profile.HighQuality="High Quality (HQ)" +# Codec: H264 +Codec.H264="H264" +Codec.H264.Profile="Profile" +Codec.H264.Profile.baseline="Baseline" +Codec.H264.Profile.main="Main" +Codec.H264.Profile.high="High" +Codec.H264.Profile.high444p="High 4:4:4 Predictive" +Codec.H264.Level="Level" + # Codec: HEVC Codec.HEVC="HEVC" Codec.HEVC.Profile="Profile" diff --git a/source/codecs/h264.cpp b/source/codecs/h264.cpp new file mode 100644 index 0000000..08e09d3 --- /dev/null +++ b/source/codecs/h264.cpp @@ -0,0 +1,18 @@ +// FFMPEG Video Encoder Integration for OBS Studio +// Copyright (C) 2018 - 2019 Michael Fabian Dirks +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +#include "h264.hpp" diff --git a/source/codecs/h264.hpp b/source/codecs/h264.hpp new file mode 100644 index 0000000..b10e8c1 --- /dev/null +++ b/source/codecs/h264.hpp @@ -0,0 +1,63 @@ +// FFMPEG Video Encoder Integration for OBS Studio +// Copyright (C) 2018 - 2019 Michael Fabian Dirks +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +#pragma once +#include + +// Codec: H264 +#define P_H264 "Codec.H264" +#define P_H264_PROFILE "Codec.H264.Profile" +#define P_H264_LEVEL "Codec.H264.Level" + +namespace obsffmpeg { + namespace codecs { + namespace h264 { + enum class profile { + CONSTRAINED_BASELINE, + BASELINE, + MAIN, + HIGH, + HIGH444_PREDICTIVE, + UNKNOWN = -1, + }; + + enum class level { + L1_0 = 10, + L1_0b, + L1_1, + L1_2, + L1_3, + L2_0 = 20, + L2_1, + L2_2, + L3_0 = 30, + L3_1, + L3_2, + L4_0 = 40, + L4_1, + L4_2, + L5_0 = 50, + L5_1, + L5_2, + L6_0 = 60, + L6_1, + L6_2, + UNKNOWN = -1, + }; + } // namespace h264 + } // namespace codecs +} // namespace obsffmpeg