Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP4: Handle more metadata #2179

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Source/MediaInfo/MediaInfo_Config_Automatic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"Alignment_Split;Split across interleaves\n"
"All;All\n"
"AlternateGroup;Alternate group\n"
"Android_Version;Android version\n"
"Archival_Location;Archival location\n"
"Arranger;Arranger\n"
"ArtDirector;ArtDirector\n"
Expand Down Expand Up @@ -1168,6 +1169,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"SamplesPerFrame;Samples per frame\n"
"SamplingCount;Samples count\n"
"SamplingRate;Sampling rate\n"
"Samsung_Model_Number;Samsung model number\n"
"Save;Save\n"
"ScanOrder;Scan order\n"
"ScanOrder_Original;Original scan order\n"
Expand Down
2 changes: 2 additions & 0 deletions Source/MediaInfo/Multiple/File_Mpeg4.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ private :
void moov_udta_rtng();
void moov_udta_ptv ();
void moov_udta_Sel0();
void moov_udta_smta();
void moov_udta_smta_mdln();
void moov_udta_tags();
void moov_udta_tags_meta();
void moov_udta_tags_tseg();
Expand Down
35 changes: 33 additions & 2 deletions Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,8 @@ namespace Elements
const int64u moov_udta_ptv =0x70747620;
const int64u moov_udta_rtng=0x72746E67;
const int64u moov_udta_Sel0=0x53656C30;
const int64u moov_udta_smta=0x736d7461;
const int64u moov_udta_smta_mdln=0x6d646c6e;
const int64u moov_udta_tags=0x74616773;
const int64u moov_udta_tags_meta=0x6D657461;
const int64u moov_udta_tags_tseg=0x74736567;
Expand Down Expand Up @@ -1431,6 +1433,10 @@ void File_Mpeg4::Data_Parse()
ATOM(moov_udta_ptv )
ATOM(moov_udta_rtng)
ATOM(moov_udta_Sel0)
LIST(moov_udta_smta)
ATOM_BEGIN
ATOM(moov_udta_smta_mdln)
ATOM_END
LIST(moov_udta_tags)
ATOM_BEGIN
ATOM(moov_udta_tags_meta)
Expand Down Expand Up @@ -3981,6 +3987,8 @@ void File_Mpeg4::moov_meta_ilst_xxxx_data()
Fill(Stream_General, 0, "Media/History/UUID", Value);
else if (Parameter=="com.android.capture.fps")
FrameRate_Real=Value;
else if (Parameter=="com.android.version")
Fill(Stream_General, 0, "Android_Version", Value);
else if (Parameter=="com.universaladid.idregistry")
{
Fill(Stream_General, 0, "UniversalAdID_Registry", Value);
Expand Down Expand Up @@ -6279,6 +6287,7 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()

int16u Width, Height, Depth, ColorTableID;
int8u CompressorName_Size;
Ztring CompressorName;
bool IsGreyscale;
Skip_B2( "Version");
Skip_B2( "Revision level");
Expand All @@ -6296,12 +6305,12 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
{
//This is pascal string
Skip_B1( "Compressor name size");
Skip_UTF8(CompressorName_Size, "Compressor name");
Get_UTF8(CompressorName_Size, CompressorName, "Compressor name");
Skip_XX(32-1-CompressorName_Size, "Padding");
}
else
//this is hard-coded 32-byte string
Skip_UTF8(32, "Compressor name");
Get_UTF8(32, CompressorName, "Compressor name");
Get_B2 (Depth, "Depth");
if (Depth>0x20 && Depth<0x40)
{
Expand Down Expand Up @@ -6339,6 +6348,7 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
CodecID_Fill(Codec, Stream_Video, StreamPos_Last, InfoCodecID_Format_Mpeg4);
Fill(Stream_Video, StreamPos_Last, Video_Codec, Codec, true);
Fill(Stream_Video, StreamPos_Last, Video_Codec_CC, Codec, true);
Fill(Stream_Video, StreamPos_Last, Video_Encoded_Library, CompressorName);
if (Codec==__T("drms"))
Fill(Stream_Video, StreamPos_Last, Video_Encryption, "iTunes");
if (Codec==__T("encv"))
Expand Down Expand Up @@ -9745,6 +9755,27 @@ void File_Mpeg4::moov_udta_Sel0()
Skip_XX(Element_Size, "Data");
}

//---------------------------------------------------------------------------
void File_Mpeg4::moov_udta_smta()
{
NAME_VERSION_FLAG("Samsung Metadata");
}

//---------------------------------------------------------------------------
void File_Mpeg4::moov_udta_smta_mdln()
{
Element_Name("Model Number");

//Parsing
string SamsungModelNumber;
Get_String(Element_Size, SamsungModelNumber, "Value");

//Filling
FILLING_BEGIN();
Fill(Stream_General, 0, "Samsung_Model_Number", SamsungModelNumber);
FILLING_END();
}

//---------------------------------------------------------------------------
void File_Mpeg4::moov_udta_tags()
{
Expand Down
2 changes: 2 additions & 0 deletions Source/Resource/Text/Language/DefaultLanguage.csv
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ Alignment_Aligned;Aligned on interleaves
Alignment_Split;Split across interleaves
All;All
AlternateGroup;Alternate group
Android_Version;Android version
Archival_Location;Archival location
Arranger;Arranger
ArtDirector;ArtDirector
Expand Down Expand Up @@ -1139,6 +1140,7 @@ SamplePeakLevel_Album;Sample peak level (album)
SamplesPerFrame;Samples per frame
SamplingCount;Samples count
SamplingRate;Sampling rate
Samsung_Model_Number;Samsung model number
Save;Save
ScanOrder;Scan order
ScanOrder_Original;Original scan order
Expand Down