Announcement

  •  » Engine
  •  » Metadata on Video

#1 2014-01-19 20:02:46

xbgmsharp
Member
1970-01-01
215

Metadata on Video

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

Code:

$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, fixed] Trigger for element without EXIF metadata

Offline

 

#2 2014-01-19 20:11:58

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3270

Re: Metadata on Video

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

 

#3 2014-10-20 16:32:57

xbgmsharp
Member
1970-01-01
215

Re: Metadata on Video

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

 

#4 2014-10-22 10:32:54

xbgmsharp
Member
1970-01-01
215

Re: Metadata on Video

By any chance, can the single line patch be include in PWG2.7.2?

Offline

 

#5 2014-11-19 12:02:36

xbgmsharp
Member
1970-01-01
215

Re: Metadata on Video

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

 

#6 2014-11-19 13:45:34

rvelices
Piwigo Team
2005-12-29
1960

Re: Metadata on Video

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

 

#7 2014-11-20 12:06:59

xbgmsharp
Member
1970-01-01
215

Re: Metadata on Video

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

 

#8 2015-01-09 15:01:10

xbgmsharp
Member
1970-01-01
215

Re: Metadata on Video

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.

Code:

# 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.


Uploaded Images

Last edited by xbgmsharp (2015-01-09 15:46:32)

Offline

 

#9 2015-01-09 15:33:24

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13171

Re: Metadata on Video

What about:

Code:

[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.


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#10 2015-01-09 15:44:53

xbgmsharp
Member
1970-01-01
215

Re: Metadata on Video

That would work. I try over videos and photos and it is fine.
Indeed, it avoid duplicate code and twice the trigger callback.

Offline

 

#11 2015-01-10 06:43:23

rvelices
Piwigo Team
2005-12-29
1960

Re: Metadata on Video

Looks good

Offline

 

#12 2015-01-12 09:41:14

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13171

Re: Metadata on Video

[Subversion] r30888, will be in Piwigo 2.7.4


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#13 2015-01-30 01:28:16

noyaudabricot
Member
Brussels
2014-12-01
6

Re: Metadata on Video

Excellent!

Offline

 

#14 2015-02-17 11:14:43

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13171

Re: Metadata on Video

2.7.4 is live, so is your request xbgmsharp :-)


Latest blog post (May 3rd 2018) New subscription form

Offline

 

#15 2015-02-27 23:09:34

steffu
Member
2014-11-11
4

Re: Metadata on Video

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

 
  •  » Engine
  •  » Metadata on Video

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact