Mediainfo不会使用S3密钥中的特殊字符处理AWS S3 URL

时间:2018-03-26 02:20:36

标签: mediainfo

我正在使用最新的mediainfo。 mediainfo --version显示  MediaInfoLib - v17.12

在文件名中使用特殊字符时,它显示有效输出。

style.css

虽然如果我使用带有特殊字符的文件名(有效的s3密钥),从AWS S3,它不接受它作为有效输入。 我使用下面的url,其中username,secret和bucketname特定于我的aws帐户。和'测试/迷你& bar.mp4'是关键。

https://username:secret@s3-ap-southeast-2.amazonaws.com/bucketname/testing/mini& bar.mp4

>mediainfo 'mini & bar.mp4' 

    Complete name                            : mini & bar.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42 (mp41/mp42/isom)
    File size                                : 380 KiB
    Duration                                 : 4 s 4 ms
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 777 kb/s
    Movie name                               : mini
    Encoded date                             : UTC 2015-02-21 06:02:24
    Tagged date                              : UTC 2015-02-21 06:02:26

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L3.1
    Format settings                          : CABAC / 2 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 2 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 4 s 4 ms
    Bit rate mode                            : Variable
    Bit rate                                 : 768 kb/s
    Width                                    : 854 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 29.970 (30000/1001) FPS
    Original frame rate                      : 25.000 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.063
    Stream size                              : 378 KiB (99%)
    Title                                    : Core Media Video
    Encoded date                             : UTC 2015-02-21 06:02:24
    Tagged date                              : UTC 2015-02-21 06:02:26
    Color range                              : Limited
    Color primaries                          : BT.601 NTSC
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.601

如果使用单引号或双引号,则会显示签名不匹配错误。

<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>testing/mini</Key><RequestId>157877D3B661D9A6</RequestId></Error>

当查看MediaArea / MediaInfoLib代码时,似乎只处理了空格,并且没有为aws键处理其他特殊字符。

来自Reader_libcurl.cpp

<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

当进一步搜索此类问题时,下面的问题讨论aws键中的空间,现在似乎已经解决了。 https://sourceforge.net/p/mediainfo/bugs/960/

所以我的问题是:

  1. 为什么mediainfo不处理AWS键中的特殊字符?
  2. 根据代码, - urlencode选项设置url编码。如何使用此选项,此选项是否强制url编码和具有特殊字符的aws键将被接受?
  3. 是否有任何解决方法可以获得具有特殊字符的s3网址上的mediainfo结果?
  4. 如何解决此问题?

1 个答案:

答案 0 :(得分:0)

我找到了解决问题的方法,即使用预先签名的网址。

以下是我使用过的命令:

1. aws s3 presign 's3://bucketname/testing/mini & bar™©.mp4' 
   output is => "presignd url"
2. mediainfo 'presignd url'

希望它有所帮助!!