Can Exiftool be used for server databse solution? |XAMP, PHP, PhpMyAdmin, MySQL

Started by Petco, April 02, 2023, 04:48:17 AM

Previous topic - Next topic

Petco

Hello, Im using Exiftool for my Master of Engineering thesis.

I used Exiftool to extract some metadata from videos into .csv document. I easily imported the .csv to the table in the MySQL database, with import button in PhpMyAdmin.

This approach is good, but I was thinking... Would it be somehow possible to automate this process?

1.Lets say if I upload the video to the database, the video also "comes through" Exiftool, which is implemented from the database side.
2.It temporarily creates the .csv document which will contain only certain metadata, that I will choose on the server side.
3.Then it will store this data into the database table.

Also feel free to tell if anyone used Exiftool with XAMP, PHP, PhpMyAdmin or MySQL. I would be interested in your solution.

 

Phil Harvey

I do this sort of thing by adding cron jobs to watch the uploads directory.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Petco

Hello, I was thinking and maybe I found out an easier solution for what I need but im not sure if it could work.
This code below executes when URL is called and extract data from a video in a fix directory.
exec('exiftool -filename -createdate -imagesize -videoframerate -mediaduration -T -ext mp4 -csv D:\XAMP\htdocs\root\videos\try > D:\XAMP\htdocs\root\videos\ukaz.csv');
Now if I add attribute formaction to my submit input, I now upload a video and I execute metadata extraction
<input type='submit' name='import-excel' value='Upload' formaction="http://localhost/root/webhook.php">
Now, the only problem is that I dont need to extract a video in D:\XAMP\htdocs\root\videos\try but the video I just uploaded.
Can this path be changed for a variable($name), in which I store my video file?
$name = $_FILES['file']['name'];

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Blaumeise00

Quote from: Petco on April 20, 2023, 04:16:24 PMCan this path be changed for a variable($name), in which I store my video file?
$name = $_FILES['file']['name'];

$_FILES['file']['name'] is just a name.
You will have to use the directory of the uploaded file, then call the actual uploaded file.
Otherwise, you could analyze the temporary name which points to the actual temporary file:

$_FILES['file']['tmp_name']