Use embedded UTF-8 video metadata
This commit is contained in:
parent
dd0804a2ab
commit
8c97b1c759
1 changed files with 7 additions and 4 deletions
11
index.php
11
index.php
|
|
@ -30,12 +30,15 @@ function video_metadata($path){
|
||||||
$lower = [];
|
$lower = [];
|
||||||
foreach ($tags as $k => $v) $lower[strtolower($k)] = $v;
|
foreach ($tags as $k => $v) $lower[strtolower($k)] = $v;
|
||||||
if (!empty($lower['title'])) $meta['title'] = $lower['title'];
|
if (!empty($lower['title'])) $meta['title'] = $lower['title'];
|
||||||
if (!empty($lower['date'])) $meta['date'] = $lower['date'];
|
if (!empty($lower['date'])) {
|
||||||
if (!empty($lower['creation_time'])) $meta['date'] = substr($lower['creation_time'], 0, 10);
|
$meta['date'] = $lower['date'];
|
||||||
foreach (['location','place','location-eng','com.apple.quicktime.location.iso6709'] as $k) {
|
} elseif (!empty($lower['creation_time'])) {
|
||||||
|
$meta['date'] = substr($lower['creation_time'], 0, 10);
|
||||||
|
}
|
||||||
|
foreach (['location','place','location-eng','com.apple.quicktime.location.name','com.apple.quicktime.location.iso6709'] as $k) {
|
||||||
if (!empty($lower[$k])) { $meta['location'] = $lower[$k]; break; }
|
if (!empty($lower[$k])) { $meta['location'] = $lower[$k]; break; }
|
||||||
}
|
}
|
||||||
foreach (['description','comment','synopsis'] as $k) {
|
foreach (['description','synopsis'] as $k) {
|
||||||
if (!empty($lower[$k])) { $meta['description'] = $lower[$k]; break; }
|
if (!empty($lower[$k])) { $meta['description'] = $lower[$k]; break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue