Following an older post: http://www.zenphoto.org/support/topic.php?id=11768
I tried to add metadata fields with only partial success.
From exiftool tag names (source: exiftool site), I found:
"©cmt" Comment
While running exiftool, I got the following two results:
exiftool json output
"Comment": {
"desc": "Comment",
"id": "?cmt",
"val": "Comments go here"
exiftool -G output
[QuickTime] Comment : Comments go here
Using that information, I added (some whitespace removed here):
'VideoComment' =array('QuickTime', 'Comment', gettext('Video Comment'), false, 256, true, 'string'),
after the other Video tags, in the functions.php file.
Going into options, "Video Comment" appears in the metadata list, but enabling it doesn't produce any display. I tried with both GD and Imagick, and refreshed the metadata, but they never show with the other Video metadata.
Config info:
ZP 1.4.10 [3d5be820ca]
PHP Imagick library 3.1.0RC1
ImageMagick 6.6.9-7 2014-03-06 Q16
MySQLi version: 5.5.44
PHP version: 5.3.10-1ubuntu3.20
Current gallery theme: Libratus
Thanks for any advice
P.S. I'm getting messages that my functions.php file seems wrong, although everything is working except for my new metadata.
Zenphoto users this libary for meta data reading of multimedia files:
http://getid3.sourceforge.net
It might be that this container format which is proprietary is not fully supported. I don't know that offhand. You can preview what it can read here (note we do not include all modules currently but only those we have plugins for):
http://www.getid3.org/demo/
In any case I would recommend to use normal mp4/m4v videos instead of Quicktime and jPlayer because modern browser do support these natively. Quicktime is not really the common container format it was years ago anymore.
Adding this line works for me:
'comment' =>array('VIDEO', 'comment', gettext('Video Comment'), false, 256, true, 'string'),
Note 1: if fields are added or deleted, setup should be run or the new data won't be stored.
Note 2: if zp-core files are changed you'll get the the message you mentioned.
Note 3: if you change zp-core files you'll have to apply your changes again after every update.
@acrylian - They actually are mp4/m4v files, but the TAGS, are listed under the "QuickTime" grouping, similar to how other image information may be under the "EXIF" tag, or the "IPTC" tag, depending.
@fretzl - Thanks! I'll try running setup. I hadn't tried that. I'll report back, when I get a chance.
This worked!
I'm still having trouble pulling "Composer", "TV Show", and "TV Episode ID", which I thought that I had pulled before with getID3, but I've been able to add Comment, Genre, and Description to my ZP display, and that's a big help.
For others, after editing the functions.php file, I re-ran the setup, then did a "Refresh metadata" (I don't know if it's needed, but I did it anyway), and then went to Options>Images, and enabled the new tag in the Metadata list.
The new tag in the Metadata list, seems like it can be whatever you like. It's the text that you enter in between the quotes (the argument), in the 'gettext' function.
Example: gettext('My new tag'), ...
Hope this is helpful to others, and if anyone has any suggestions on getting my missing items, I'd love to hear them.
FYI: I got my information from the function CopyToAppropriateCommentsSection() starting on line 2105 in .../zp-core/zp-extensions/class-video/getid3/module.audio-video.quicktime.php
There you can see how QuickTime metadata field-names are mapped to more readable field-names for internal use.
I checked that out, but I'm still not sure why some fields show, but others don't.
For examples:
This works
'VideoGenre' => array('VIDEO', 'genre', gettext('Genre'), false, 256, true, 'string'),
...but this doesn't
'VideoComposer' => array('VIDEO', 'composer', gettext('Composer'), false, 256, true, 'string'),
Similarly, this works
'VideoTVshow' => array('VIDEO', 'tv_show_name', gettext('Show'), true, 256, true, 'string'),
...but this doesn't
'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Episode'), false, 256, true, 'string'),
Thanks for the lead, though. At least now I'm not guessing at what the field-names are. ;-)
I have to admit I never used this functionality. Are these fields really set in the database correctly?
Just a note beforehand that in the next bigger version this whole handling of extra fields may change a bit (can't tell details). But that will be a while in the future ;-)
Thanks for the Support build. More tags are definitely showing up now. For example, although it does not show up in the Image Metadata list (no check box for "Composer", but it's showing up in the Image Info on the Image page. (Substitution, or mapped to another item, like 'artist'?)
This is how it appears in the functions.php file
'VideoComposer' => array('VIDEO', 'composer', gettext('Composer'), false, 256, true, 'string'),
The episode info
'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Episode'), false, 256, true, 'string'),
still isn't appearing in the Image Info.
And none of the sort_... items ( module.audio-video.quicktime.php, starting at line 2202 ) are appearing in the Image Info.
I tried the Support build, and I see the typo, and why that might have changed things, but it's still the same.
If you want to look, http://hdl.handle.net/10020/metaTest click the Metadata Test Movie. I have a PDF of my functions.php file, a jpg of the items selected in Image>Metadata, and a movie file that lists all of the embedded metadata in the description, and I think you can even download it, if you want to use it for testing.
Apparently tv_episode needs to be parsed as a [b]number[/b] otherwise it breaks the code.
So I changed
'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Video TV Episode'), false, 256, true, 'string'),
to
'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Video TV Episode'), false, 32, true, 'number'),
I added the "list" below to functions.php and the only tags that still do not show up are sort_title and sort_album_artist.
'VideoLyrics' => array('VIDEO', 'lyrics', gettext('Video Lyrics'), false, 256, true, 'string'), 'VideoComment' => array('VIDEO', 'comment', gettext('Video Comment'), false, 256, true, 'string'), 'VideoComposer' => array('VIDEO', 'composer', gettext('Video Composer'), false, 256, true, 'string'), 'VideoAlbum' => array('VIDEO', 'album', gettext('Video Album'), false, 256, true, 'string'), 'VideoAlbumArtist' => array('VIDEO', 'album_artist', gettext('Video Album Artist'), false, 256, true, 'string'), 'VideoGrouping' => array('VIDEO', 'grouping', gettext('Video Grouping'), false, 256, true, 'string'), 'VideoDescription' => array('VIDEO', 'description', gettext('Video Description'), false, 256, true, 'string'), 'VideoGenre' => array('VIDEO', 'genre', gettext('Video Genre'), false, 256, true, 'string'), 'VideoTVshow' => array('VIDEO', 'tv_show_name', gettext('Video TV Show'), false, 256, true, 'string'), 'VideoTVepisode' => array('VIDEO', 'tv_episode', gettext('Video TV Episode'), false, 32, true, 'number'), 'VideoTVepisodeID' => array('VIDEO', 'tv_episode_id', gettext('Video TV EpisodeID'), false, 256, true, 'string'), 'VideoSortTitle' => array('VIDEO', 'sort_title', gettext('Video Sort Title'), false, 256, true, 'string'), 'VideoSortAlbum' => array('VIDEO', 'sort_album', gettext('Video Sort Album'), false, 256, true, 'string'), 'VideoSortArtist' => array('VIDEO', 'sort_artist', gettext('Video Sort Artist'), false, 256, true, 'string'), 'VideoSortAlbumArtist' => array('VIDEO', 'sort_album_artist', gettext('Video Sort Album Artist'), false, 256, true, 'string'), 'VideoSortComposer' => array('VIDEO', 'sort_composer', gettext('Video Sort Composer'), false, 256, true, 'string'), 'VideoSortShow' => array('VIDEO', 'sort_show', gettext('Video Sort Show'), false, 256, true, 'string'),