我有一个非常简单的脚本,可以在 CLI 环境中运行,但不能在 FPM 环境中运行,尽管两个配置文件完全相同。
这是它的样子:
<?php
echo shell_exec('mediainfo -f --Output=XML --Language=raw /home/mstrasser/Vidéos/Motocross.mp4 2>&1');?>
注意“视频”中的重音,请注意它与没有重音的路径完美配合。
这是 CLI 上下文中的输出:
<?xml version="1.0" encoding="UTF-8"?>
<Mediainfo version="0.7.67">
<File>
<track type="General">
<Count>288</Count>
<StreamCount>1</StreamCount>
<StreamKind>General</StreamKind>
<StreamKind_String>General</StreamKind_String>
<StreamKindID>0</StreamKindID>
<VideoCount>1</VideoCount>
<AudioCount>1</AudioCount>
<Video_Format_List>AVC</Video_Format_List>
<Video_Format_WithHint_List>AVC</Video_Format_WithHint_List>
<Video_Codec_List>AVC</Video_Codec_List>
<Audio_Format_List>AAC</Audio_Format_List>
<Audio_Format_WithHint_List>AAC</Audio_Format_WithHint_List>
<Audio_Codec_List>AAC LC</Audio_Codec_List>
<CompleteName>/home/mstrasser/Vidéos/Motocross.mp4</CompleteName>
<FolderName>/home/mstrasser/Vidéos</FolderName>
<FileName>Motocross</FileName>
<FileExtension>mp4</FileExtension>
<Format>MPEG-4</Format>
<Format_String>MPEG-4</Format_String>
<Format_Extensions>mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v</Format_Extensions>
<Format_Commercial>MPEG-4</Format_Commercial>
<Format_Profile>Base Media / Version 2</Format_Profile>
<InternetMediaType>video/mp4</InternetMediaType>
<CodecID>mp42</CodecID>
<CodecID_Url>http://www.apple.com/quicktime/download/standalone.html</CodecID_Url>
<Codec>MPEG-4</Codec>
<Codec_String>MPEG-4</Codec_String>
<Codec_Extensions>mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v</Codec_Extensions>
<FileSize>93140940</FileSize>
<FileSize_String>88.8 MiB</FileSize_String>
<FileSize_String1>89 MiB</FileSize_String1>
<FileSize_String2>89 MiB</FileSize_String2>
<FileSize_String3>88.8 MiB</FileSize_String3>
<FileSize_String4>88.83 MiB</FileSize_String4>
<Duration>301603</Duration>
<Duration_String>5mn 1s</Duration_String>
<Duration_String1>5mn 1s 603ms</Duration_String1>
<Duration_String2>5mn 1s</Duration_String2>
<Duration_String3>00:05:01.603</Duration_String3>
<OverallBitRate_Mode>VBR</OverallBitRate_Mode>
<OverallBitRate_Mode_String>VBR</OverallBitRate_Mode_String>
<OverallBitRate>2470557</OverallBitRate>
<OverallBitRate_String>2471 Kbps</OverallBitRate_String>
<StreamSize>92427</StreamSize>
<StreamSize_String>90.3 KiB (0%)</StreamSize_String>
<StreamSize_String1>90 KiB</StreamSize_String1>
<StreamSize_String2>90 KiB</StreamSize_String2>
<StreamSize_String3>90.3 KiB</StreamSize_String3>
<StreamSize_String4>90.26 KiB</StreamSize_String4>
<StreamSize_String5>90.3 KiB (0%)</StreamSize_String5>
<StreamSize_Proportion>0.00099</StreamSize_Proportion>
<HeaderSize>92419</HeaderSize>
<DataSize>93048521</DataSize>
<FooterSize>0</FooterSize>
<IsStreamable>Yes</IsStreamable>
<Encoded_Date>UTC 2014-03-07 13:41:18</Encoded_Date>
<Tagged_Date>UTC 2014-03-07 13:41:18</Tagged_Date>
<File_Modified_Date>UTC 2014-05-15 16:01:23</File_Modified_Date>
<File_Modified_Date_Local>2014-05-15 18:01:23</File_Modified_Date_Local>
<gsst>0</gsst>
<gstd>301673</gstd>
<gssd>BADC28725HH1400169569381396</gssd>
<gshh>r20---sn-aigllnse.googlevideo.com</gshh>
</track>
<track type="Video">
<Count>272</Count>
<StreamCount>1</StreamCount>
<StreamKind>Video</StreamKind>
<StreamKind_String>Video</StreamKind_String>
<StreamKindID>0</StreamKindID>
<StreamOrder>0</StreamOrder>
<ID>1</ID>
<ID_String>1</ID_String>
<Format>AVC</Format>
<Format_Info>Advanced Video Codec</Format_Info>
<Format_Url>http://developers.videolan.org/x264.html</Format_Url>
<Format_Commercial>AVC</Format_Commercial>
<Format_Profile>High@L3.1</Format_Profile>
<Format_Settings>CABAC / 1 Ref Frames</Format_Settings>
<Format_Settings_CABAC>Yes</Format_Settings_CABAC>
<Format_Settings_CABAC_String>Yes</Format_Settings_CABAC_String>
<Format_Settings_RefFrames>1</Format_Settings_RefFrames>
<Format_Settings_RefFrames_String>1 frame1</Format_Settings_RefFrames_String>
<InternetMediaType>video/H264</InternetMediaType>
<CodecID>avc1</CodecID>
<CodecID_Info>Advanced Video Coding</CodecID_Info>
<CodecID_Url>http://www.apple.com/quicktime/download/standalone.html</CodecID_Url>
<Codec>AVC</Codec>
<Codec_String>AVC</Codec_String>
<Codec_Family>AVC</Codec_Family>
<Codec_Info>Advanced Video Codec</Codec_Info>
<Codec_Url>http://developers.videolan.org/x264.html</Codec_Url>
<Codec_CC>avc1</Codec_CC>
<Codec_Profile>High@L3.1</Codec_Profile>
<Codec_Settings>CABAC / 1 Ref Frames</Codec_Settings>
<Codec_Settings_CABAC>Yes</Codec_Settings_CABAC>
<Codec_Settings_RefFrames>1</Codec_Settings_RefFrames>
<Duration>301592</Duration>
<Duration_String>5mn 1s</Duration_String>
<Duration_String1>5mn 1s 592ms</Duration_String1>
<Duration_String2>5mn 1s</Duration_String2>
<Duration_String3>00:05:01.592</Duration_String3>
<BitRate>2276170</BitRate>
<BitRate_String>2276 Kbps</BitRate_String>
<BitRate_Maximum>6627048</BitRate_Maximum>
<BitRate_Maximum_String>6627 Kbps</BitRate_Maximum_String>
<Width>1280</Width>
<Width_String>1280 pixel3</Width_String>
<Height>720</Height>
<Height_String>720 pixel3</Height_String>
<PixelAspectRatio>1.000</PixelAspectRatio>
<DisplayAspectRatio>1.778</DisplayAspectRatio>
<DisplayAspectRatio_String>16:9</DisplayAspectRatio_String>
<Rotation>0.000</Rotation>
<FrameRate_Mode>CFR</FrameRate_Mode>
<FrameRate_Mode_String>CFR</FrameRate_Mode_String>
<FrameRate_Mode_Original>VFR</FrameRate_Mode_Original>
<FrameRate>23.976</FrameRate>
<FrameRate_String>23.976 fps2</FrameRate_String>
<FrameCount>7231</FrameCount>
<Resolution>8</Resolution>
<Resolution_String>8 bit3</Resolution_String>
<Colorimetry>4:2:0</Colorimetry>
<ColorSpace>YUV</ColorSpace>
<ChromaSubsampling>4:2:0</ChromaSubsampling>
<BitDepth>8</BitDepth>
<BitDepth_String>8 bit3</BitDepth_String>
<ScanType>Progressive</ScanType>
<ScanType_String>Progressive</ScanType_String>
<Interlacement>PPF</Interlacement>
<Interlacement_String>Interlaced_PPF</Interlacement_String>
<Bits_Pixel_Frame_>0.103</Bits_Pixel_Frame_>
<StreamSize>85809675</StreamSize>
<StreamSize_String>81.8 MiB (92%)</StreamSize_String>
<StreamSize_String1>82 MiB</StreamSize_String1>
<StreamSize_String2>82 MiB</StreamSize_String2>
<StreamSize_String3>81.8 MiB</StreamSize_String3>
<StreamSize_String4>81.83 MiB</StreamSize_String4>
<StreamSize_String5>81.8 MiB (92%)</StreamSize_String5>
<StreamSize_Proportion>0.92129</StreamSize_Proportion>
<Tagged_Date>UTC 2014-03-07 13:41:24</Tagged_Date>
</track>
<track type="Audio">
<Count>222</Count>
<StreamCount>1</StreamCount>
<StreamKind>Audio</StreamKind>
<StreamKind_String>Audio</StreamKind_String>
<StreamKindID>0</StreamKindID>
<StreamOrder>1</StreamOrder>
<ID>2</ID>
<ID_String>2</ID_String>
<Format>AAC</Format>
<Format_Info>Advanced Audio Codec</Format_Info>
<Format_Commercial>AAC</Format_Commercial>
<Format_Profile>LC</Format_Profile>
<CodecID>40</CodecID>
<Codec>AAC LC</Codec>
<Codec_String>AAC LC</Codec_String>
<Codec_Family>AAC</Codec_Family>
<Codec_CC>40</Codec_CC>
<Duration>301603</Duration>
<Duration_String>5mn 1s</Duration_String>
<Duration_String1>5mn 1s 603ms</Duration_String1>
<Duration_String2>5mn 1s</Duration_String2>
<Duration_String3>00:05:01.603</Duration_String3>
<BitRate_Mode>VBR</BitRate_Mode>
<BitRate_Mode_String>VBR</BitRate_Mode_String>
<BitRate>192000</BitRate>
<BitRate_String>192 Kbps</BitRate_String>
<BitRate_Maximum>201352</BitRate_Maximum>
<BitRate_Maximum_String>201 Kbps</BitRate_Maximum_String>
<Channel_s_>2</Channel_s_>
<Channel_s__String>2 channel2</Channel_s__String>
<ChannelPositions>Front: L R</ChannelPositions>
<ChannelPositions_String2>2/0/0</ChannelPositions_String2>
<ChannelLayout>L R</ChannelLayout>
<SamplingRate>44100</SamplingRate>
<SamplingRate_String>44.1 KHz</SamplingRate_String>
<SamplingCount>13300692</SamplingCount>
<FrameCount>12989</FrameCount>
<Compression_Mode>Lossy</Compression_Mode>
<Compression_Mode_String>Lossy</Compression_Mode_String>
<StreamSize>7238838</StreamSize>
<StreamSize_String>6.90 MiB (8%)</StreamSize_String>
<StreamSize_String1>7 MiB</StreamSize_String1>
<StreamSize_String2>6.9 MiB</StreamSize_String2>
<StreamSize_String3>6.90 MiB</StreamSize_String3>
<StreamSize_String4>6.903 MiB</StreamSize_String4>
<StreamSize_String5>6.90 MiB (8%)</StreamSize_String5>
<StreamSize_Proportion>0.07772</StreamSize_Proportion>
<Title>IsoMedia File Produced by Google, 5-11-2011</Title>
<Encoded_Date>UTC 2014-03-07 13:41:22</Encoded_Date>
<Tagged_Date>UTC 2014-03-07 13:41:24</Tagged_Date>
</track>
</File>
</Mediainfo>
这是 Web 上下文中的输出:
<?xml version="1.0" encoding="UTF-8"?>
<Mediainfo version="0.7.67">
</Mediainfo>
我试过改变LC_ALL
,改变页面字符集,但没有成功。可能是什么问题呢 ?
退出状态码为 1。