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 :
- why mediainfo is not handling special characters in AWS keys?
- 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?
- Is there any workaround to get result of mediainfo on s3 url having special characters?
- how to fix this?