0

I am using latest mediainfo. mediainfo --version shows MediaInfoLib - v17.12

When using special character in filename, it shows valid output.

>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

Although if I use filename(valid s3 key) with special characters, from AWS S3, it is not accepting it as valid input. I used below url where username, secret and bucketname are specific to my aws account. and 'testing/mini & bar.mp4' is the key.

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

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

If use it with single or double quotes, it shows signature mismatch error.

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

When looked into MediaArea/MediaInfoLib code, it seems only space is handled and other special characters are not handled for aws key.

From Reader_libcurl.cpp

// URL encoding
MediaInfo_Config::urlencode ShouldUrlEncode=Config.URLEncode_Get();
if (ShouldUrlEncode==MediaInfo_Config::URLEncode_Guess)
{
    if (File_URL.Path.find(' '))
        ShouldUrlEncode=MediaInfo_Config::URLEncode_Yes;
}
if (ShouldUrlEncode==MediaInfo_Config::URLEncode_Yes)
    File_URL.Path=ZenLib::Format::Http::URL_Encoded_Encode(File_URL.Path);

When searched further for such issues, below issue talks about space in aws key, which seems to be resolved now. https://sourceforge.net/p/mediainfo/bugs/960/

So my questions are :

  1. why mediainfo is not handling special characters in AWS keys?
  2. Based on code, --urlencode options sets url encoding. How to use this option, is this option force url encoding and aws keys with special characters will be accepted?
  3. Is there any workaround to get result of mediainfo on s3 url having special characters?
  4. how to fix this?
Derek Brown
  • 4,232
  • 4
  • 27
  • 44
Swati
  • 577
  • 6
  • 15
  • This question, although good, is probably not a good fit for StackOverflow since it requires diagnosing an existing software library, rather than a direct programming question. I would suggest creating an issue on the [mediainfo Github page](https://github.com/MediaArea/MediaInfoLib), as you will probably have better luck. – Derek Brown Mar 26 '18 at 02:31
  • Thanks Derek. I had thought of adding issue on github page. Before that, I hope to get some workaround or some ideas to solve my problem from this forum. New issue request submitted: https://github.com/MediaArea/MediaInfoLib/issues/823 – Swati Mar 26 '18 at 03:04

1 Answers1

0

I have found workaround for my problem, which is to use pre-signed url.

Following are the commands I have used:

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

Hope it helps!!

Swati
  • 577
  • 6
  • 15