Detect Opus and FLAC in MP4
This commit is contained in:
parent
fe67abcfeb
commit
eb9ab514eb
|
@ -9,8 +9,8 @@ set(META_APP_AUTHOR "Martchus")
|
|||
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
||||
set(META_APP_DESCRIPTION "C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags")
|
||||
set(META_VERSION_MAJOR 9)
|
||||
set(META_VERSION_MINOR 0)
|
||||
set(META_VERSION_PATCH 1)
|
||||
set(META_VERSION_MINOR 1)
|
||||
set(META_VERSION_PATCH 0)
|
||||
set(META_REQUIRED_CPP_UNIT_VERSION 1.14.0)
|
||||
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
||||
|
||||
|
|
|
@ -183,6 +183,10 @@ MediaFormat fourccToMediaFormat(std::uint32_t fourccId)
|
|||
case WindowsMediaVideoV2:
|
||||
case WindowsMediaVideoV8:
|
||||
return MediaFormat(GeneralMediaFormat::WindowsMediaVideo, 2);
|
||||
case Flac:
|
||||
return GeneralMediaFormat::Flac;
|
||||
case Opus:
|
||||
return GeneralMediaFormat::Opus;
|
||||
// TODO: map more FOURCCs
|
||||
default:
|
||||
return GeneralMediaFormat::Unknown;
|
||||
|
|
|
@ -269,6 +269,7 @@ enum KnownValue : std::uint32_t {
|
|||
Explode = 0x78706C6F,
|
||||
FilmNoise = 0x666D6E73,
|
||||
Fire = 0x66697265,
|
||||
Flac = 0x664C6143,
|
||||
FlashPixImage = 0x66706978,
|
||||
FlashScreenVideoDecoder = 0x46535631,
|
||||
FloatingPoint32Bit = 0x666C3332,
|
||||
|
@ -342,6 +343,7 @@ enum KnownValue : std::uint32_t {
|
|||
MsMpeg4V3Decoder2 = 0x6D703433,
|
||||
NtscDv25Video = 0x64766320, /**< NTSC DV-25 video */
|
||||
Oggs = 0x4F676753,
|
||||
Opus = 0x4F707573,
|
||||
PalDv25Video = 0x64766370, /**< PAL DV-25 video */
|
||||
PdfImage = 0x70646620,
|
||||
Png = 0x706E6720, /**< Portable Network Graphics */
|
||||
|
|
|
@ -1642,9 +1642,11 @@ void Mp4Track::internalParseHeader(Diagnostics &diag)
|
|||
for (Mp4Atom *codecConfigContainerAtom = m_stsdAtom->firstChild(); codecConfigContainerAtom;
|
||||
codecConfigContainerAtom = codecConfigContainerAtom->nextSibling()) {
|
||||
codecConfigContainerAtom->parse(diag);
|
||||
|
||||
// parse FOURCC
|
||||
m_formatId = interpretIntegerAsString<std::uint32_t>(codecConfigContainerAtom->id());
|
||||
m_format = FourccIds::fourccToMediaFormat(codecConfigContainerAtom->id());
|
||||
|
||||
// parse codecConfigContainerAtom
|
||||
m_istream->seekg(static_cast<streamoff>(codecConfigContainerAtom->dataOffset()));
|
||||
switch (codecConfigContainerAtom->id()) {
|
||||
|
@ -1660,6 +1662,8 @@ void Mp4Track::internalParseHeader(Diagnostics &diag)
|
|||
case FourccIds::Dts:
|
||||
case FourccIds::DtsH:
|
||||
case FourccIds::DtsE:
|
||||
case FourccIds::Flac:
|
||||
case FourccIds::Opus:
|
||||
m_istream->seekg(6 + 2, ios_base::cur); // skip reserved bytes, data reference index
|
||||
tmp = reader.readUInt16BE(); // read sound version
|
||||
m_istream->seekg(6, ios_base::cur);
|
||||
|
|
|
@ -117,6 +117,9 @@ convert flac/test.flac ffmpeg -i mtx-test-data/alac/othertest-itunes.m4a -c:a fl
|
|||
convert flac/test.ogg ffmpeg -i flac/test.flac -vn -c:a copy flac/test.ogg
|
||||
convert mkv/av1_test.mkv ffmpeg -i matroska_wave1/test1.mkv -t 1 -c:v libaom-av1 -crf 30 -cpu-used 5 -an -strict experimental mkv/av1_test.mkv
|
||||
convert mp4/av1_test.mp4 ffmpeg -i mkv/av1_test.mkv -c copy mp4/av1_test.mp4
|
||||
convert mp4/test1-flac.m4a ffmpeg -i mp4/test1.m4a -c:a flac -f mp4 -strict -2 mp4/test1-flac.m4a
|
||||
convert mp4/test1-opus.m4a ffmpeg -i mp4/test1.m4a -c:a libopus -f mp4 -strict -2 mp4/test1-opus.m4a
|
||||
convert mp4/test1-vorbis.m4a ffmpeg -i mp4/test1.m4a -c:a libvorbis -f mp4 -strict -2 mp4/test1-vorbis.m4a
|
||||
convert misc/av1.ivf ffmpeg -i mkv/av1_test.mkv -c copy misc/av1.ivf
|
||||
convert mkv/nested-tags.mkv \
|
||||
mkvmerge --ui-language en_US \
|
||||
|
|
Loading…
Reference in New Issue