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

Different results with parse and Mediainfo(xml) #31

Closed
Hellowlol opened this issue Nov 23, 2016 · 6 comments
Closed

Different results with parse and Mediainfo(xml) #31

Hellowlol opened this issue Nov 23, 2016 · 6 comments

Comments

@Hellowlol
Copy link

Hellowlol commented Nov 23, 2016

Using:

<?xml version="1.0" encoding="UTF-8"?>
<Mediainfo version="0.7.90">
<File>
<track type="General">
<Unique_ID>201687259218363082767350208093136514272 (0x97BB8D9E0E82DA3AB712EE412BBA6CE0)</Unique_ID>
<Complete_name>C:\htpc\upload1\Billions.S01E01.720p.WEB-DL-NTb_3\Billions.S01E01.720p.WEB-DL-NTb.mkv</Complete_name>
<Format>Matroska</Format>
<Format_version>Version 4 / Version 2</Format_version>
<File_size>707 MiB</File_size>
<Duration>54 min 21 s</Duration>
<Overall_bit_rate>1 819 kb/s</Overall_bit_rate>
<Encoded_date>UTC 2016-01-18 12:12:45</Encoded_date>
<Writing_application>mkvmerge v7.6.0 (&apos;Garden of Dreams&apos;) 64bit built on Feb  8 2015 13:04:34</Writing_application>
<Writing_library>libebml v1.3.1 + libmatroska v1.4.2</Writing_library>
</track>

<track type="Video">
<ID>1</ID>
<Format>AVC</Format>
<Format_Info>Advanced Video Codec</Format_Info>
<Format_profile>High@L3.1</Format_profile>
<Format_settings__CABAC>Yes</Format_settings__CABAC>
<Format_settings__ReFrames>5 frames</Format_settings__ReFrames>
<Codec_ID>V_MPEG4/ISO/AVC</Codec_ID>
<Duration>54 min 21 s</Duration>
<Width>1 280 pixels</Width>
<Height>720 pixels</Height>
<Display_aspect_ratio>16:9</Display_aspect_ratio>
<Frame_rate_mode>Constant</Frame_rate_mode>
<Frame_rate>23.976 (24000/1001) FPS</Frame_rate>
<Color_space>YUV</Color_space>
<Chroma_subsampling>4:2:0</Chroma_subsampling>
<Bit_depth>8 bits</Bit_depth>
<Scan_type>Progressive</Scan_type>
<Default>Yes</Default>
<Forced>No</Forced>
</track>

<track type="Audio">
<ID>2</ID>
<Format>AAC</Format>
<Format_Info>Advanced Audio Codec</Format_Info>
<Format_profile>HE-AAC / LC</Format_profile>
<Codec_ID>A_AAC</Codec_ID>
<Duration>54 min 21 s</Duration>
<Channel_s_>2 channels</Channel_s_>
<Channel_positions>Front: L R</Channel_positions>
<Sampling_rate>48.0 kHz / 24.0 kHz</Sampling_rate>
<Frame_rate>23.438 FPS (1024 spf)</Frame_rate>
<Compression_mode>Lossy</Compression_mode>
<Language>English</Language>
<Default>Yes</Default>
<Forced>No</Forced>
</track>

<track type="Text">
<ID>3</ID>
<Format>UTF-8</Format>
<Codec_ID>S_TEXT/UTF8</Codec_ID>
<Codec_ID_Info>UTF-8 Plain Text</Codec_ID_Info>
<Language>English</Language>
<Default>Yes</Default>
<Forced>No</Forced>
</track>

</File>
</Mediainfo>

mi = MediaInfo(xml)
mi.to_data()

mi {'tracks': [{'writing_application': "mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb  8 2015 13:04:34", 'format_version': 'Version 4 / Version 2', 'format': 'Matroska', 'track_type': 'General', 'complete_name': 'C:\\htpc\\upload1\\Billions.S01E01.720p.WEB-DL-NTb_3\\Billions.S01E01.720p.WEB-DL-NTb.mkv', 'encoded_date': 'UTC 2016-01-18 12:12:45', 'file_size': '707 MiB', 'duration': '54 min 21 s', 'overall_bit_rate': '1 819 kb/s', 'unique_id': '201687259218363082767350208093136514272 (0x97BB8D9E0E82DA3AB712EE412BBA6CE0)', 'writing_library': 'libebml v1.3.1 + libmatroska v1.4.2'}, {'codec_id': 'V_MPEG4/ISO/AVC', 'color_space': 'YUV', 'format_info': 'Advanced Video Codec', 'frame_rate_mode': 'Constant', 'format': 'AVC', 'default': 'Yes', 'format_settings__cabac': 'Yes', 'track_type': 'Video', 'format_profile': 'High@L3.1', 'forced': 'No', 'track_id': '1', 'height': '720 pixels', 'width': '1 280 pixels', 'bit_depth': '8 bits', 'display_aspect_ratio': '16:9', 'frame_rate': '23.976 (24000/1001) FPS', 'chroma_subsampling': '4:2:0', 'scan_type': 'Progressive', 'duration': '54 min 21 s', 'format_settings__reframes': '5 frames'}, {'codec_id': 'A_AAC', 'forced': 'No', 'format_info': 'Advanced Audio Codec', 'channel_s': '2 channels', 'language': 'English', 'format': 'AAC', 'default': 'Yes', 'track_type': 'Audio', 'channel_positions': 'Front: L R', 'track_id': '2', 'duration': '54 min 21 s', 'format_profile': 'HE-AAC / LC', 'frame_rate': '23.438 FPS (1024 spf)', 'compression_mode': 'Lossy', 'sampling_rate': '48.0 kHz / 24.0 kHz'}, {'forced': 'No', 'language': 'English', 'format': 'UTF-8', 'default': 'Yes', 'track_type': 'Text', 'track_id': '3', 'codec_id_info': 'UTF-8 Plain Text', 'codec_id': 'S_TEXT/UTF8'}]}

mf = MediaInfo.parse(path_to_file)

mf.to_data()


mf {'tracks': [{'writing_application': "mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb  8 2015 13:04:34", 'other_file_size': ['707 MiB', '707 MiB', '707 MiB', '707 MiB', '707.3 MiB'], 'format_version': 'Version 4 / Version 2', 'file_name': 'Billions.S01E01.720p.WEB-DL-NTb', 'track_type': 'General', 'file_size': 741634835, 'text_codecs': 'UTF-8', 'other_unique_id': ['201687259218363082767350208093136514272 (0x97BB8D9E0E82DA3AB712EE412BBA6CE0)'], 'count_of_text_streams': '1', 'format_url': 'http://packs.matroska.org/', 'format_extensions_usually_used': 'mkv mk3d mka mks', 'count_of_video_streams': '1', 'duration': 3261910, 'writing_library': 'libebml v1.3.1 + libmatroska v1.4.2', 'video_format_withhint_list': 'AVC', 'audio_language_list': 'English', 'stream_identifier': '0', 'text_language_list': 'English', 'other_frame_rate': ['23.976 FPS'], 'video_language_list': 'English', 'file_creation_date': 'UTC 2016-01-18 12:17:40.000', 'text_format_list': 'UTF-8', 'codec': 'Matroska', 'complete_name': 'C:\\htpc\\upload1\\Billions.S01E01.720p.WEB-DL-NTb_3\\Billions.S01E01.720p.WEB-DL-NTb.mkv', 'other_writing_library': ['libebml v1.3.1 + libmatroska v1.4.2'], 'other_overall_bit_rate': ['1 819 kb/s'], 'file_last_modification_date__local': '2016-01-18 13:17:40.000', 'count_of_stream_of_this_kind': '1', 'other_kind_of_stream': ['General'], 'audio_format_withhint_list': 'AAC', 'other_codec': ['Matroska'], 'format': 'Matroska', 'kind_of_stream': 'General', 'other_format': ['Matroska'], 'file_last_modification_date': 'UTC 2016-01-18 12:17:40.000', 'overall_bit_rate': 1818897, 'folder_name': 'C:\\htpc\\upload1\\Billions.S01E01.720p.WEB-DL-NTb_3', 'frame_rate': '23.976', 'other_duration': ['54 min 21 s', '54 min 21 s 910 ms', '54 min 21 s', '00:54:21.910', '00:54:22;18', '00:54:21.910 (00:54:22;18)'], 'count': '322', 'video_format_list': 'AVC', 'file_extension': 'mkv', 'commercial_name': 'Matroska', 'audio_codecs': 'AAC LC-SBR', 'codecs_video': 'AVC', 'count_of_audio_streams': '1', 'file_creation_date__local': '2016-01-18 13:17:40.000', 'codec_extensions_usually_used': 'mkv mk3d mka mks', 'codec_url': 'http://packs.matroska.org/', 'audio_format_list': 'AAC', 'text_format_withhint_list': 'UTF-8', 'frame_count': '78208', 'other_writing_application': ["mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb  8 2015 13:04:34"], 'unique_id': 201687259218363082767350208093136514272L, 'encoded_date': 'UTC 2016-01-18 12:12:45'}, {'codec_settings': 'CABAC / 5 Ref Frames', 'other_interlacement': ['Progressive'], 'framerate_mode_original': 'VFR', 'sampled_height': '720', 'framerate_den': '1001', 'track_type': 'Video', 'framerate_num': '24000', 'interlacement': 'PPF', 'height': 720, 'format_settings__reframes': 5, 'codec_id_url': 'http://ffdshow-tryout.sourceforge.net/', 'format_url': 'http://developers.videolan.org/x264.html', 'other_resolution': ['8 bits'], 'duration': 3261929, 'unique_id': '17417841369823057563', 'codec_settings__cabac': 'Yes', 'other_track_id': ['1'], 'forced': 'No', 'stream_identifier': '0', 'codec_settings_refframes': '5', 'width': 1280, 'colorimetry': '4:2:0', 'other_delay': ['00:00:00.000'], 'sampled_width': '1280', 'track_id': 1, 'delay': 0, 'pixel_aspect_ratio': '1.000', 'other_bit_depth': ['8 bits'], 'other_height': ['720 pixels'], 'streamorder': '0', 'chroma_subsampling': '4:2:0', 'count_of_stream_of_this_kind': '1', 'other_kind_of_stream': ['Video'], 'codec': 'V_MPEG4/ISO/AVC', 'other_codec': ['AVC'], 'format_settings__cabac': 'Yes', 'other_frame_rate_mode': ['Constant'], 'color_space': 'YUV', 'kind_of_stream': 'Video', 'format': 'AVC', 'codec_info': 'Advanced Video Codec', 'other_format_settings__reframes': ['5 frames'], 'scan_type': 'Progressive', 'delay__origin': 'Container', 'internet_media_type': 'video/H264', 'format_info': 'Advanced Video Codec', 'display_aspect_ratio': '1.778', 'frame_rate': '23.976', 'codec_family': 'AVC', 'other_width': ['1 280 pixels'], 'format_settings': 'CABAC / 5 Ref Frames', 'other_duration': ['54 min 21 s', '54 min 21 s 929 ms', '54 min 21 s', '00:54:21.929', '00:54:22;18', '00:54:21.929 (00:54:22;18)'], 'count': '334', 'other_delay__origin': ['Container'], 'commercial_name': 'AVC', 'frame_rate_mode': 'CFR', 'other_scan_type': ['Progressive'], 'default': 'Yes', 'frame_count': '78208', 'other_forced': ['No'], 'other_default': ['Yes'], 'other_chroma_subsampling': ['4:2:0'], 'other_format_settings__cabac': ['Yes'], 'codec_profile': 'High@L3.1', 'codec_id': 'V_MPEG4/ISO/AVC', 'other_frame_rate': ['23.976 (24000/1001) FPS'], 'codec_url': 'http://ffdshow-tryout.sourceforge.net/', 'resolution': 8, 'bit_depth': 8, 'other_display_aspect_ratio': ['16:9'], 'format_profile': 'High@L3.1'}, {'format_settings__sbr': 'Yes (Implicit)', 'other_channel_s': ['2 channels'], 'track_type': 'Audio', 'other_channel_positions': ['2/0/0'], 'other_compression_mode': ['Lossy'], 'format_profile': 'HE-AAC / LC', 'duration': 3261910, 'samples_count': '156571680', 'forced': 'No', 'samples_per_frame': '1024', 'stream_identifier': '0', 'other_delay': ['00:00:00.000'], 'channel_positions': 'Front: L R', 'track_id': 2, 'delay': 0, 'codec': 'AAC LC-SBR', 'sampling_rate': '48000 / 24000', 'count_of_stream_of_this_kind': '1', 'other_kind_of_stream': ['Audio'], 'other_language': ['English', 'English', 'en', 'eng', 'en'], 'other_codec': ['AAC LC-SBR'], 'other_format_settings__sbr': ['Yes (Implicit)'], 'count': '272', 'other_video0_delay': ['00:00:00.000'], 'format': 'AAC', 'kind_of_stream': 'Audio', 'delay__origin': 'Container', 'format_info': 'Advanced Audio Codec', 'frame_rate': '23.438', 'delay_relative_to_video': 0, 'other_track_id': ['2'], 'other_duration': ['54 min 21 s', '54 min 21 s 910 ms', '54 min 21 s', '00:54:21.910', '00:54:21.910'], 'other_sampling_rate': ['48.0 kHz / 24.0 kHz'], 'other_delay__origin': ['Container'], 'commercial_name': 'AAC', 'channellayout': 'L R', 'language': 'en', 'default': 'Yes', 'other_delay_relative_to_video': ['00:00:00.000'], 'other_default': ['Yes'], 'channel_s': 2, 'streamorder': '1', 'codec_id': 'A_AAC', 'other_frame_rate': ['23.438 FPS (1024 spf)'], 'compression_mode': 'Lossy', 'codec_family': 'AAC', 'video0_delay': 0, 'other_forced': ['No'], 'unique_id': '11027699435699514785'}, {'track_type': 'Text', 'codec_id_info': 'UTF-8 Plain Text', 'forced': 'No', 'stream_identifier': '0', 'track_id': 3, 'codec': 'S_TEXT/UTF8', 'count_of_stream_of_this_kind': '1', 'other_kind_of_stream': ['Text'], 'other_language': ['English', 'English', 'en', 'eng', 'en'], 'other_codec': ['UTF-8'], 'kind_of_stream': 'Text', 'format': 'UTF-8', 'codec_info': 'UTF-8 Plain Text', 'other_track_id': ['3'], 'count': '234', 'commercial_name': 'UTF-8', 'language': 'en', 'default': 'Yes', 'other_forced': ['No'], 'other_default': ['Yes'], 'streamorder': '2', 'codec_id': 'S_TEXT/UTF8', 'unique_id': '13564175569453905064'}]}

Is this intended or a bug?

@sbraz
Copy link
Owner

sbraz commented Nov 23, 2016

That looks like a bug, can you upload a sample file please?

@sbraz
Copy link
Owner

sbraz commented Nov 23, 2016

Ah nevermind, I get it, did you use -f? I think you didn't and that's why you don't see all the info on your XML.

@Hellowlol
Copy link
Author

No i didnt use -f. Does pymediainfo use that by default? I tried to look for that option but i couldnt find it in your code.

@sbraz
Copy link
Owner

sbraz commented Nov 23, 2016

It's called "complete" in the library, not "full":

lib.MediaInfo_Option(None, "Complete", "1")

@sbraz sbraz closed this as completed Nov 23, 2016
@Hellowlol
Copy link
Author

Ah, thanks! Ps, i think this should be optional since it returns alot of junk :P

@sbraz
Copy link
Owner

sbraz commented Nov 23, 2016

Well, I could make an option but it would be enabled by default so as not to break backwards compatibility.
I usually only access the attributes I need, so it's usually not a problem. I can't think of a scenario where it would be bad to have too much data, unless you just dump it like in your example.
Feel free to make a PR if you really want that feature :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants