ExifTool Forum

General => Other Discussion => Topic started by: Petco on April 02, 2023, 04:48:17 AM

Title: Can Exiftool be used for server databse solution? |XAMP, PHP, PhpMyAdmin, MySQL
Post by: Petco on April 02, 2023, 04:48:17 AM
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.

 
Title: Re: Can Exiftool be used for server databse solution? |XAMP, PHP, PhpMyAdmin, MySQL
Post by: Phil Harvey on April 02, 2023, 06:49:09 AM
I do this sort of thing by adding cron jobs to watch the uploads directory.

- Phil
Title: Re: Can Exiftool be used for server databse solution? |XAMP, PHP, PhpMyAdmin, MySQL
Post by: Petco on April 20, 2023, 04:16:24 PM
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'];
Title: Re: Can Exiftool be used for server databse solution? |XAMP, PHP, PhpMyAdmin, MySQL
Post by: Phil Harvey on April 22, 2023, 05:38:23 PM
I don't understand what you are asking.

- Phil
Title: Re: Can Exiftool be used for server databse solution? |XAMP, PHP, PhpMyAdmin, MySQL
Post by: Blaumeise00 on April 26, 2023, 04:15:56 AM
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']