Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use MediaInfo with Amazon S3?

According to the MediaInfo ChangeLog, Amazon S3 support was added in v0.7.76 and even patched in v0.7.77 (latest).

However, I can't find any documentation on how to implement it. It's not in CLI help menu nor the SourceForge project pages. I was hoping someone here might have some insight as the SourceForge forum is closed off.

How do I craft a MediaInfo command to use Amazon S3 with Access Key & Secret Key? I'm using the CLI.

The closest thing I could find was someone's example Java code: http://fossies.org/linux/MediaInfo_CLI/MediaInfoLib/Source/Example/HowToUse_Dll.JNA.java

It looks like they're crafting a custom HTTP request to S3 and streaming the response to MediaInfo. I'm not sure. I don't know Java; I only know Bash, Ruby, PHP.

Has anyone successfully got MediaInfo working with S3; something like this?

mediainfo https://AWSAccessKeyId:[email protected]/bucketname/filename
like image 206
BoomShadow Avatar asked Sep 28 '15 22:09

BoomShadow


People also ask

Can you use xray with S3?

X-Ray enables trace messages for Amazon S3 event notifications. You can use the X-Ray service map to view the connections between Amazon S3 and other services that your application uses. You can also use the console to view metrics such as average latency and failure rates.

Can we query data in S3?

Amazon S3 Select and Amazon S3 Glacier Select enable customers to run structured query language SQL queries directly on data stored in S3 and Amazon S3 Glacier. With S3 Select, you simply store your data on S3 and query using SQL statements to filter the contents of S3 objects, retrieving only the data that you need.

Can we set TTL in S3?

You can set whole buckets to certain TTL using the S3 Browser tool , the link is also a guide to setting bucket wide TTL.

Can Lambda read from S3?

The Lambda function retrieves the source S3 bucket name and the key name of the uploaded object from the event parameter that it receives. The function uses the Amazon S3 getObject API to retrieve the content type of the object.


2 Answers

The Java example is an example about how to download with Java and send data to MediaInfo from Memory. Now MediaInfo has native support of S3. So just provide this URL.

The only issue is that you must have libcurl available and MediaInfo compiled with libcurl support. This is not already available on all platforms (e.g. on Windows you must put libcurl.dll from libcurl website in the same folder as mediainfo).

Better delivery of such support (with libcurl provided directly, and fully tested, on all platforms) is planned but there is no ETA.

like image 99
Jérôme Martinez Avatar answered Oct 03 '22 04:10

Jérôme Martinez


Mediainfo executable can be built with libcurl on linux distribution using below commands: (I used centos)

yum groupinstall 'Development Tools'
yum install libcurl-devel
yum install wget
wget http://mediaarea.net/download/binary/mediainfo/17.12/MediaInfo_CLI_17.12_GNU_FromSource.tar.xz
tar xvf MediaInfo_CLI_17.12_GNU_FromSource.tar.xz
cd MediaInfo_CLI_GNU_FromSource/
./CLI_Compile.sh --with-libcurl
cd MediaInfo/Project/GNU/CLI
./mediainfo --version

Then following command will provide media information for Amazon S3 url.

mediainfo --Output=XML https://AWSAccessKeyId:[email protected]/bucketname/filename

The above command won't work with AWS keys(filename) having special characters. By using pre-signed url, it is possible to use special characters in AWS Keys.

aws s3 presign 's3://bucketname/testing/mini & bar™©.mp4' 
mediainfo 'presignd url'
like image 43
Swati Avatar answered Oct 03 '22 04:10

Swati