With PWG2.6 out, videojs plugin is still unable to display metadata for video.
The event for reading metadata is still limited to image supported by @read_exif_data
$exif = trigger_event('format_exif_data', $exif, $filename, $map);
With videojs plugin, I am able to fetch all the video metadata, https://github.com/xbgmsharp/piwigo-vid … photo-edit
I wish to show when request (eg: &metadata in the URL)
See [Bugtracker] ticket 2943
Offline
it would be great if you submit complete and tested patches
because I think none of us has better knowledge on the subject as you do (+ I don't always understand what you want :) )
Offline
Hello,
I finally got time to provide the patch, http://piwigo.org/bugs/view.php?id=2943
Using the last git source code for VideoJS.
Add the following in your config
$conf['show_exif_fields'] = array(
'Make',
'Model',
'ExifVersion',
'Software',
'DateTimeOriginal',
'FNumber',
'ExposureBiasValue',
'FILE;FileSize',
'ExposureTime',
'Flash',
'ISOSpeedRatings',
'FocalLength',
'FocalLengthIn35mmFilm',
'WhiteBalance',
'ExposureMode',
'MeteringMode',
'ExposureProgram',
'LightSource',
'Contrast',
'Saturation',
'Sharpness',
'bitrate',
'channel',
'date_creation',
'display_aspect_ratio',
'duration',
'filesize',
'format',
'frame_rate',
'latitude',
'longitude',
'make',
'model',
'playtime_seconds',
'sampling_rate',
'type',
);
Patch include/functions_metadata.inc.php as follow, a single line change.
# diff ../../include/functions_metadata.inc.php ../../include/functions_metadata.inc.php.bck
153c153
< if ($exif = @read_exif_data($filename) or $exif = trigger_change('format_exif_data', $exif=array(), $filename, $map))
---
> if ($exif = @read_exif_data($filename))
And now you can see the video Metadata using VideoJS.
What do you think?
Would it be possible to get this change include in the next release?
Offline
By any chance, can the single line patch be include in PWG2.7.2?
Offline
Would be nice to get some feedback.
The patch allow any plugin to display metadata as EXIF.
I believe it can be useful for GPX tacks or Videos or any non EXIF file.
Offline
I think
-it should be a different event name than the current one (which would be called 2 times)
-default should be null instead of empty array (otherwise the test in the line afterwards is useless I think)
Offline
rvelices wrote:
-it should be a different event name than the current one (which would be called 2 times)
I do agree it was my original commit.
I did create a new trigger and send the new file, http://piwigo.org/bugs/view.php?id=2943
In order to reduce the change, I used the same trigger and it avoid code duplication.
rvelices wrote:
-default should be null instead of empty array (otherwise the test in the line afterwards is useless I think)
Good point I will also update my code, to exit on non null $exif.
# diff ../../include/functions_metadata.inc.php ../../include/functions_metadata.inc.php.bck
153c153
< if ($exif = @read_exif_data($filename) or $exif = trigger_change('format_exif_data', $exif=null, $filename, $map))
---
> if ($exif = @read_exif_data($filename))
Offline
Hi all,
Could we move forward on this and try to be include in next PWG release.
Do you prefer extra metadata to be an extended EXIF or a complete new entry in a separate function?
I really think it is a nice feature to have as seen in the screenshot. (Not sure but I can upload it to the forum)
https://github.com/xbgmsharp/piwigo-vid … o-metadata
Being an extended EXIF metadata, it allow a quick and easy path.
# diff ../../include/functions_metadata.inc.php ../../include/functions_metadata.inc.php.bck 153c153 < if ($exif = @read_exif_data($filename) or $exif = trigger_change('format_exif_data', $exif=null, $filename, $map)) --- > if ($exif = @read_exif_data($filename))
I need a final decision.
I would like to know if I include the patching process in my plugin or if you do include the change in the PWG core.
Last edited by xbgmsharp (2015-01-09 15:46:32)
Offline
What about:
[pierrick@pierrick-desktop] ~/public_html/piwigo/dev/trunk $ svn diff include/functions_metadata.inc.php Index: include/functions_metadata.inc.php =================================================================== --- include/functions_metadata.inc.php (revision 30766) +++ include/functions_metadata.inc.php (working copy) @@ -150,9 +150,16 @@ } // Read EXIF data - if ($exif = @read_exif_data($filename)) + if ($exif = @read_exif_data($filename) or $exif2 = trigger_change('format_exif_data', $exif=null, $filename, $map)) { - $exif = trigger_change('format_exif_data', $exif, $filename, $map); + if (!empty($exif2)) + { + $exif = $exif2; + } + else + { + $exif = trigger_change('format_exif_data', $exif, $filename, $map); + } // configured fields foreach ($map as $key => $field)
This way we don't call trigger_change twice.
I have tried with [extension by maple] EXIF View and it works fine.
Offline
That would work. I try over videos and photos and it is fine.
Indeed, it avoid duplicate code and twice the trigger callback.
Offline
[Subversion] r30888, will be in Piwigo 2.7.4
Offline
2.7.4 is live, so is your request xbgmsharp :-)
Offline
Hi
my Galaxy S4 has no Recorded_Date in the meta information of the video files. I have to add the following lines in include/mediainfo.php, Row 126:
if (isset($general->Encoded_Date))
{
$exif['date_creation'] = date( 'Y-m-d H:i:s', strtotime((string)$general->Encoded_Date));
}
With this, my videos has now also a creation date, one of the most important meta information for me.
Maybe you add these lines to the plugin also.
Best regards
Steve
Offline