php-mediainfo
php-mediainfo copied to clipboard
Windows
I installed this on Laravel 8,
$mediaInfo = new MediaInfo();
$mediaInfo->setConfig('command', 'C:\Program Files\MediaInfo\MediaInfo.exe');
$mediaInfoContainer = $mediaInfo->getInfo(url);
This opens the Mediainfo, reads the file but it gets stuck with Mediainfo open and the page keeps loading until I close the mediainfo instance then trows "Return value of Mhor\MediaInfo\Parser\AbstractXmlOutputParser::transformXmlToArray() must be of the type array, bool returned"
How can I use it?
Hi, @alexsweb did you install the "cli" version of mediainfo (see https://github.com/mhor/php-mediainfo#usage-for-windowsos)? php-mediainfo
read the output of mediainfo command line execution, if you use the GUI version, php-mediainfo will launch MediaInfo GUI but nothing will be outputed by the MediaInfo command line so php-mediainfo will throw an error.
I have Cli as well, it works from cmd..
Get Outlook for iOShttps://aka.ms/o0ukef
From: Maxime Horcholle @.> Sent: Wednesday, September 29, 2021 3:28:50 PM To: mhor/php-mediainfo @.> Cc: Alexandru Popa @.>; Mention @.> Subject: Re: [mhor/php-mediainfo] Windows (#127)
Hi, @alexswebhttps://github.com/alexsweb did you install the "cli" version of mediainfo (see https://github.com/mhor/php-mediainfo#usage-for-windowsos)? php-mediainfo read the output of mediainfo command line execution, if you use the GUI version, php-mediainfo will launch MediaInfo GUI but nothing will be outputed by the MediaInfo command line so php-mediainfo will throw an error.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mhor/php-mediainfo/issues/127#issuecomment-930129187, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AR2TDSS6SDVGK35QAJ66CPTUEMBAFANCNFSM5EBDFCQA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
@mhor
Get Outlook for iOShttps://aka.ms/o0ukef
From: Alexandru Popa @.> Sent: Wednesday, September 29, 2021 3:30:23 PM To: mhor/php-mediainfo @.>; mhor/php-mediainfo @.> Cc: Mention @.> Subject: Re: [mhor/php-mediainfo] Windows (#127)
I have Cli as well, it works from cmd..
Get Outlook for iOShttps://aka.ms/o0ukef
From: Maxime Horcholle @.> Sent: Wednesday, September 29, 2021 3:28:50 PM To: mhor/php-mediainfo @.> Cc: Alexandru Popa @.>; Mention @.> Subject: Re: [mhor/php-mediainfo] Windows (#127)
Hi, @alexswebhttps://github.com/alexsweb did you install the "cli" version of mediainfo (see https://github.com/mhor/php-mediainfo#usage-for-windowsos)? php-mediainfo read the output of mediainfo command line execution, if you use the GUI version, php-mediainfo will launch MediaInfo GUI but nothing will be outputed by the MediaInfo command line so php-mediainfo will throw an error.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mhor/php-mediainfo/issues/127#issuecomment-930129187, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AR2TDSS6SDVGK35QAJ66CPTUEMBAFANCNFSM5EBDFCQA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Sorry I'm not familiar with Windows environments I don't know if I could help you. Internally php-mediainfo run mediainfo command with some flag and parse the output.
Could you try to run this command:
C:\Program Files\MediaInfo\MediaInfo.exe YOUR_URL -f --OUTPUT=OLDXML
You can also dump the output of mediainfo command execution here.
@mhor This works, as well as your example
mediainfo -i http://127.0.0.1:8000/7zvov31gicbxel02l9te
I downloaded a new version of CLI and now I get "Undefined index: track" vendor\mhor\php-mediainfo\src\Parser\MediaInfoOutputParser.php:46
Looks like it does not find the tracks. Yet in cmd works, same executable.
Could you try this: https://github.com/mhor/php-mediainfo/issues/125#issuecomment-826968341
If it's doesn't solve your problem could you send here the result of these commands:
mediainfo --version
mediainfo http://127.0.0.1:8000/7zvov31gicbxel02l9te --output=OLDXML -F --urlencode
A standard output of mediainfo command should look like that:
<?xml version="1.0" encoding="UTF-8"?>
<Mediainfo version="21.09">
<File>
<track type="General">
<Count>343</Count>
<Count_of_stream_of_this_kind>1</Count_of_stream_of_this_kind>
<Kind_of_stream>General</Kind_of_stream>
<Kind_of_stream>General</Kind_of_stream>
<Stream_identifier>0</Stream_identifier>
<Count_of_audio_streams>1</Count_of_audio_streams>
<Audio_Format_List>FLAC</Audio_Format_List>
<Audio_Format_WithHint_List>FLAC</Audio_Format_WithHint_List>
<Audio_codecs>FLAC</Audio_codecs>
<Complete_name>02 Maria Violenza - Messine.flac</Complete_name>
<File_name_extension>02 Maria Violenza - Messine.flac</File_name_extension>
<File_name>02 Maria Violenza - Messine</File_name>
<File_extension>flac</File_extension>
<Format>FLAC</Format>
<Format>FLAC</Format>
<Format_Info>Free Lossless Audio Codec</Format_Info>
<Format_Url>https://xiph.org/flac/</Format_Url>
<Format_Extensions_usually_used>fla flac</Format_Extensions_usually_used>
<Commercial_name>FLAC</Commercial_name>
<Internet_media_type>audio/x-flac</Internet_media_type>
<File_size>72899870</File_size>
<File_size>69.5 MiB</File_size>
<File_size>70 MiB</File_size>
<File_size>70 MiB</File_size>
<File_size>69.5 MiB</File_size>
<File_size>69.52 MiB</File_size>
<Duration>333660</Duration>
<Duration>5 min 33 s</Duration>
<Duration>5 min 33 s 660 ms</Duration>
<Duration>5 min 33 s</Duration>
<Duration>00:05:33.660</Duration>
<Duration>00:05:33.660</Duration>
<Overall_bit_rate_mode>VBR</Overall_bit_rate_mode>
<Overall_bit_rate_mode>Variable</Overall_bit_rate_mode>
<Overall_bit_rate>1747884</Overall_bit_rate>
<Overall_bit_rate>1 748 kb/s</Overall_bit_rate>
<Stream_size>0</Stream_size>
<Stream_size>0.00 Byte (0%)</Stream_size>
<Stream_size>Byte0</Stream_size>
<Stream_size>0.0 Byte</Stream_size>
<Stream_size>0.00 Byte</Stream_size>
<Stream_size>0.000 Byte</Stream_size>
<Stream_size>0.00 Byte (0%)</Stream_size>
<Proportion_of_this_stream>0.00000</Proportion_of_this_stream>
<Title>Messine</Title>
<Album>Messine / Je suis moisissure</Album>
<Album_Performer>Maria Violenza + Noir Boy George</Album_Performer>
<Part>1</Part>
<Part_Total>1</Part_Total>
<Track_name>Messine</Track_name>
<Track_name_Position>2</Track_name_Position>
<Track_name_Total>7</Track_name_Total>
<Performer>Maria Violenza</Performer>
<Label>Kakakids Records</Label>
<Recorded_date>2021-09-07</Recorded_date>
<File_last_modification_date>UTC 2021-09-15 11:22:59</File_last_modification_date>
<File_last_modification_date__local_>2021-09-15 13:22:59</File_last_modification_date__local_>
<Cover>Yes</Cover>
<Cover_type>Cover (front)</Cover_type>
<Cover_MIME>image/jpeg</Cover_MIME>
<Comment>Visit https://kakakidsrecords.bandcamp.com</Comment>
<MUSICBRAINZ_RELEASEGROUPID>5c950f75-499e-4ff7-9b30-172def312a8b</MUSICBRAINZ_RELEASEGROUPID>
<ORIGINALDATE>2021-09-07</ORIGINALDATE>
<ORIGINALYEAR>2021</ORIGINALYEAR>
<RELEASETYPE>ep</RELEASETYPE>
<SCRIPT>Latn</SCRIPT>
<RELEASESTATUS>official</RELEASESTATUS>
<RELEASECOUNTRY>XW</RELEASECOUNTRY>
<ALBUMARTISTSORT>Maria Violenza + Noir Boy George</ALBUMARTISTSORT>
<MEDIA>Digital Media</MEDIA>
<ARTISTSORT>Maria Violenza</ARTISTSORT>
<ARTISTS>Maria Violenza</ARTISTS>
<MUSICBRAINZ_RELEASETRACKID>08981e30-2cd8-480f-891a-1c6364c6900b</MUSICBRAINZ_RELEASETRACKID>
</track>
<track type="Audio">
<Count>280</Count>
<Count_of_stream_of_this_kind>1</Count_of_stream_of_this_kind>
<Kind_of_stream>Audio</Kind_of_stream>
<Kind_of_stream>Audio</Kind_of_stream>
<Stream_identifier>0</Stream_identifier>
<Format>FLAC</Format>
<Format>FLAC</Format>
<Format_Info>Free Lossless Audio Codec</Format_Info>
<Format_Url>https://xiph.org/flac/</Format_Url>
<Commercial_name>FLAC</Commercial_name>
<Internet_media_type>audio/x-flac</Internet_media_type>
<Duration>333660</Duration>
<Duration>5 min 33 s</Duration>
<Duration>5 min 33 s 660 ms</Duration>
<Duration>5 min 33 s</Duration>
<Duration>00:05:33.660</Duration>
<Duration>00:05:33.660</Duration>
<Bit_rate_mode>VBR</Bit_rate_mode>
<Bit_rate_mode>Variable</Bit_rate_mode>
<Bit_rate>1694699</Bit_rate>
<Bit_rate>1 695 kb/s</Bit_rate>
<Channel_s_>2</Channel_s_>
<Channel_s_>2 channels</Channel_s_>
<Channel_positions>Front: L R</Channel_positions>
<Channel_positions>2/0/0</Channel_positions>
<Channel_layout>L R</Channel_layout>
<Sampling_rate>48000</Sampling_rate>
<Sampling_rate>48.0 kHz</Sampling_rate>
<Samples_count>16015680</Samples_count>
<Bit_depth>24</Bit_depth>
<Bit_depth>24 bits</Bit_depth>
<Compression_mode>Lossless</Compression_mode>
<Compression_mode>Lossless</Compression_mode>
<Stream_size>70681639</Stream_size>
<Stream_size>67.4 MiB (97%)</Stream_size>
<Stream_size>67 MiB</Stream_size>
<Stream_size>67 MiB</Stream_size>
<Stream_size>67.4 MiB</Stream_size>
<Stream_size>67.41 MiB</Stream_size>
<Stream_size>67.4 MiB (97%)</Stream_size>
<Proportion_of_this_stream>0.96957</Proportion_of_this_stream>
<Writing_library>reference libFLAC 1.3.2 20170101</Writing_library>
<Writing_library>libFLAC 1.3.2 (UTC 2017-01-01)</Writing_library>
<Encoded_Library_Name>libFLAC</Encoded_Library_Name>
<Encoded_Library_Version>1.3.2</Encoded_Library_Version>
<Encoded_Library_Date>UTC 2017-01-01</Encoded_Library_Date>
</track>
</File>
</Mediainfo>
Closed for now, due to inactivity.