#1 2025-04-21 09:16:53

neeohw
Member
2024-04-22
4

[resolved] DateTimeOriginal exif metadata not synced from video

Hello/Hi/Greetings,

I rsync'ed a over 1600 photos and videos to my Piwigo installation. I generated the thumbnails for the videos and put them in their corresponding pwg_representative directory.
When I trigger a Synchronization via the admin interface, the DateTimeOriginal exif data from the pictures is synchronized just fine, but the DateTimeOriginal exif data from the mp4-files is not synced.
I've checked the PHP code, but I can't really find anything that distinguishes pictures from videos regarding the metadata.

What am I doing wrong?

Omgeving
Piwigo 15.5.0
Geïnstalleerd op 16 januari 2024, 1 jaar 3 maanden 4 dagen geleden
Besturingssysteem: Linux
PHP: 8.1.2-1ubuntu2.21 (Toon info) [2025-04-21 07:09:53]
MySQL: 5.5.5-10.6.21-MariaDB-0ubuntu0.22.04.2 [2025-04-21 07:09:53]
Afbeeldingen-bibliotheek: GD 2.3.0
Cache grootte Niet beschikbaar   nooit berekend Ververs

Geactiveerde plug-in lijst
LocalFiles Editor
Read Metadata
VideoJS

Offline

 

#2 2025-04-27 12:44:11

cryopad
Piwigo Team
Grenoble, France
2015-11-01
219

Re: [resolved] DateTimeOriginal exif metadata not synced from video

Hi @neeohw,

Did you also trigger a Synchronisation via the VideoJS interface?

Cheers


If you enjoy Piwigo for iOS…
➤ We would appreciate an AppStore review.
➤ Comments, suggestions ? Tell us on GitHub…
➤ Not yet available in your language ? Help us translate it…

Offline

 

#3 2025-04-27 19:59:15

neeohw
Member
2024-04-22
4

Re: [resolved] DateTimeOriginal exif metadata not synced from video

Yes, the overall VideoJS synchronize function says I have 792 videos in all my albums, but when I select one album to synchronize - an album of which I know it has videos - it says there are no videos.

However, when I edit one of the videos in that album and then go to the VideoJS tab, I can request a Synchronization for that one video. But it doesn't detect all the metadata.

This is the metadata I get:
AudioBitsPerSample: 16
AudioChannels: 1
AudioCodecID: mp4a
AudioCodecInfo: AAC (Advanced Audio Coding)
AudioSampleRate: 44.1 kHz
AvgBitrate: 9.8 Mbit/s
Duration: 00:00:10.891
DurationSeconds: 10.891
FileSize: 13.3 MB
FileType: MP4
MIMEtype: video/mp4
Resolution: 1080x1920
VideoBitrate: 9692532
VideoCodecID: qt
VideoCodecInfo: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
VideoFrameRate: 29.97 fps
filesize: 12980.336914062
height: 1920
width: 1080

I do have all three of mediainfo, ffprobe and exiftool installed.

Last edited by neeohw (2025-04-27 20:00:53)

Offline

 

#4 2025-04-28 22:19:18

cryopad
Piwigo Team
Grenoble, France
2015-11-01
219

Re: [resolved] DateTimeOriginal exif metadata not synced from video

Hi @neeohw,

Do you use the below settings in the LocalFiles Editor plugin?

Code:

/* Add Exif metadata support */
$conf['show_exif'] = true;
$conf['show_exif_fields'] = array(
  'date_creation',
  'formatprofile',
  'latitude',
  'longitude',
  'rotation',
  'Artist',
  'AspectRatio',
  'AudioBitsPerSample',
  'AudioChannels',
  'AudioCodecID',
  'AudioCodecInfo',
  'AudioSampleRate',
  'Author',
  'AvgBitrate',
  'Contrast',
  'DateTimeOriginal',
  'Description',
  'Duration',
  'DurationSeconds',
  'ExifVersion',
  'ExposureBiasValue',
  'ExposureMode',
  'ExposureProgram',
  'ExposureTime',
  'FileSize',
  'FileType',
  'Flash',
  'FNumber',
  'FocalLength',
  'FocalLengthIn35mmFilm',
  'Genre',
  'ISOSpeedRatings',
  'LightSource',
  'Make',
  'MeteringMode',
  'MIMEtype',
  'Model',
  'Resolution',
  'Saturation',
  'Sharpness',
  'Software',
  'Title',
  'VideoBitrate',
  'VideoCodecID',
  'VideoCodecInfo',
  'VideoFrameRate',
  'WhiteBalance',
  );

Normally, date_creation is unknown only when DateTimeOriginal is null in the metadata.

Could you please perform a sync with FFprobe only by commenting the lines defining the directories of MediaInfo and ExifTool, and then MediaInfo only and then ExifTool only to see whether one of them does not extract date_creation correctly?


If you enjoy Piwigo for iOS…
➤ We would appreciate an AppStore review.
➤ Comments, suggestions ? Tell us on GitHub…
➤ Not yet available in your language ? Help us translate it…

Offline

 

#5 2025-04-29 08:35:57

neeohw
Member
2024-04-22
4

Re: [resolved] DateTimeOriginal exif metadata not synced from video

Hey, I really appreciate you taking the time to look into my question.

Yes, I put that list in the LocalFiles Conf Editor.

The thing is: even when I put the below configuration in the conf editor, it still gives me a successful metadata sync on VideoJS tab for a specific video. Which is really strange as it shouldn't be able to find any of the binaries...

Code:

$conf['vjs_mediainfo_dir'] = '';
$conf['vjs_exiftool_dir'] = '';
$conf['ffmpeg_dir'] = '';

Offline

 

#6 2025-04-29 11:46:25

gueba
Member
2021-12-31
70

Re: [resolved] DateTimeOriginal exif metadata not synced from video

I confirm this behaviour.

Piwigo sync does not sync any exif-data in *.mp4 videos. It does well on photos.
Video_js syncs the video related data as usual.

A first (exif-) sync on the edit-photo page thwrows a warning:

Code:

Warning: Undefined variable $exif in /www/htdocs/xxxyyy/piwigo/plugins/piwigo-videojs/admin/admin_photo.php on line 216

followed by the "Cannot modify header..." - warning

Offline

 

#7 2025-04-29 11:49:36

gueba
Member
2021-12-31
70

Re: [resolved] DateTimeOriginal exif metadata not synced from video

I confirm this behaviour.

Piwigo sync does not sync any exif-data in *.mp4 videos. It does well on photos.
Video_js syncs the video related data as usual.

A first (exif-) sync on the edit-photo page thwrows a warning:

Code:

Warning: Undefined variable $exif in /www/htdocs/xxxyyy/piwigo/plugins/piwigo-videojs/admin/admin_photo.php on line 216

followed by the "Cannot modify header..." - warning


Server-Umgebung

    Piwigo 15.5.0 Prüfen, ob eine neue Version verfügbar ist.
    Installiert auf 28 Januar 2017, vor 8 Jahre 3 Monate
    Betriebssystem: Linux
    PHP: 8.3.17-nmm1 (Info anzeigen) [2025-04-29 11:48:34]
    MySQL: 10.11.11-MariaDB-0ubuntu0.24.04.2-log [2025-04-29 11:48:34]
    Grafikbibliothek: ImageMagick ImageMagick 6.9.12-98
    Größe des Cache 0 Mo   berechnet vor 5 Monate Aktualisieren

Liste der aktivierten Plugins 8

    Advanced Menu Manager
    Automatic Size
    Grum Plugins Classes.3
    LocalFiles Editor
    OpenStreetMap
    Panoramas
    Tag Groups
    VideoJS

Offline

 

#8 2025-04-29 22:31:20

cryopad
Piwigo Team
Grenoble, France
2015-11-01
219

Re: [resolved] DateTimeOriginal exif metadata not synced from video

Indeed, in the absence of metadata, the variable $exif is not initialised in this mode.
This will be fixed in the next version.

gueba wrote:

I confirm this behaviour.

Piwigo sync does not sync any exif-data in *.mp4 videos. It does well on photos.
Video_js syncs the video related data as usual.

A first (exif-) sync on the edit-photo page thwrows a warning:

Code:

Warning: Undefined variable $exif in /www/htdocs/xxxyyy/piwigo/plugins/piwigo-videojs/admin/admin_photo.php on line 216

followed by the "Cannot modify header..." - warning


If you enjoy Piwigo for iOS…
➤ We would appreciate an AppStore review.
➤ Comments, suggestions ? Tell us on GitHub…
➤ Not yet available in your language ? Help us translate it…

Offline

 

#9 2025-04-29 23:15:53

cryopad
Piwigo Team
Grenoble, France
2015-11-01
219

Re: [resolved] DateTimeOriginal exif metadata not synced from video

neeohw wrote:

The thing is: even when I put the below configuration in the conf editor, it still gives me a successful metadata sync on VideoJS tab for a specific video. Which is really strange as it shouldn't be able to find any of the binaries...

When I comment the lines setting the paths or use empty paths as you did, the VideoJS plugin tries to call ExifTool, FFprobe and MediaInfo w/o path in the shell command. On my server, these binaries are not accessible and I get the error message "Metadata cannot be retrieved because ExifTool, FFprobe or MediaInfo are not installed or their paths are incorrect.".

If you enable the debug mode and look at the logs in the _data folder, you should see lines similar to:

Code:

[DEBUG]  exec(mediainfo --Version 2>&1 >/dev/null) returns "sh: mediainfo: command not found", retval: 127
[DEBUG]  ERROR: Calling mediainfo did fail.
[DEBUG]  exec(ffprobe -version 2>&1 >/dev/null) returns "sh: ffprobe: command not found", retval: 127
[DEBUG]  ERROR: Calling ffprobe did fail.
[DEBUG]  exec(exiftool -ver 2>&1 >/dev/null) returns "sh: exiftool: command not found", retval: 127
[DEBUG]  ERROR: Calling exiftool did fail.

If not, this means that the binaries are accessible.

PS: The VideoJS plugin does not delete metadata from the database when the binaries are not accessible.


If you enjoy Piwigo for iOS…
➤ We would appreciate an AppStore review.
➤ Comments, suggestions ? Tell us on GitHub…
➤ Not yet available in your language ? Help us translate it…

Offline

 

#10 2025-04-30 15:02:18

gueba
Member
2021-12-31
70

Re: [resolved] DateTimeOriginal exif metadata not synced from video

I made some tests and came to the conclusion that piwigo-videojs does not sync the 'date_cration' since version 15c.

In an up-to-date-installation I uploaded an 'example.mp4' file in a folder under 'galleries', uploaded a jpg in the 'pwg_representative' and performed a sync from the piwigo tools page, followed by a sync on the videojs page.

Exiftool on my PC shows these values in the 'example.mp4':

Code:

ExifTool Version Number         : 12.57
File Name                       : example.mp4
Directory                       : .
File Size                       : 9.7 MB
File Modification Date/Time     : 2025:04:30 10:21:53+02:00
File Access Date/Time           : 2025:04:30 10:21:55+02:00
File Inode Change Date/Time     : 2025:04:30 10:21:53+02:00
File Permissions                : -rwxrwx---
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
Major Brand                     : MPEG-4 (.MP4) for SonyPSP
Minor Version                   : 146.1.1
Compatible Brands               : MSNV, mp42, isom
File Function Flags             : (none)
Video Track ID                  : 1
Video Codec                     : avc1
Video Attributes                : Variable bitrate, [17]
Video Avg Bitrate               : 14 Mbps
Video Max Bitrate               : 16 Mbps
Video Avg Frame Rate            : 25
Video Max Frame Rate            : 25
Video Size                      : 1920x1080
Pixel Aspect Ratio              : 1:1
Audio Track ID                  : 2
Audio Codec                     : mp4a
Audio Attributes                : (none)
Audio Avg Bitrate               : 128 kbps
Audio Max Bitrate               : 128 kbps
Movie Header Version            : 0
Create Date                     : 2022:11:01 08:37:07
Modify Date                     : 2022:11:01 08:37:07
Time Scale                      : 90000
Duration                        : 6.76 s
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 2022:11:01 08:37:07
Track Modify Date               : 2022:11:01 08:37:07
Track ID                        : 1
Track Duration                  : 6.76 s
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1920
Image Height                    : 1080
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : avc1
Source Image Width              : 1920
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Compressor Name                 : AVC Coding
Bit Depth                       : 24
Video Frame Rate                : 25
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2022:11:01 08:37:07
Media Modify Date               : 2022:11:01 08:37:07
Media Time Scale                : 48000
Media Duration                  : 6.74 s
Media Language Code             : und
Handler Description             : Sound Media Handler
Balance                         : 0
Audio Format                    : mp4a
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 48000
Track Property                  : Main track; No attributes; Priority 0
Time Zone                       : +02:00
Encoding Time                   : 2022:11:01 08:37:07+01:00
Date Acquired                   : 2022:11:01 08:37:07
Date/Time Original              : 2022:11:01 08:37:07+01:00
Release Date                    : 2022:11:01 08:37:07
Content Create Date             : 2022:11:01 08:37:07+01:00
Handler Type                    : Metadata Tags
Creation Date                   : 2022:11:01 08:37:07+01:00
Location Date                   : 2022:11:01 08:37:07+01:00
Year                            : 2022:11:01 08:37:07
Media Data Size                 : 9657135
Media Data Offset               : 5683
Image Size                      : 1920x1080
Megapixels                      : 2.1
Avg Bitrate                     : 11.4 Mbps

piwigo-videojs 15e showed these synced values:

Code:

    AudioBitsPerSample: 16
    AudioChannels: 2
    AudioCodecID: mp4a
    AudioSampleRate: 48 kHz
    AvgBitrate: 11.4 Mbit/s
    Duration: 00:00:6.760
    DurationSeconds: 6.76
    FileSize: 9.7 MB
    FileType: MP4
    MIMEtype: video/mp4
    VideoCodecID: MSNV
    VideoFrameRate: 25 fps
    filesize: 9436.34570312
    height: 1080
    resolution: 1920x1080
    width: 1920

Then I installed videojs 15c and synced:

Code:

    bitrate: 11428562
    channel: 2
    codecid: MSNV
    duration: 6760
    filesize: 9436
    format: MP4
    frame_rate: 25
    height: 1080
    playtime_seconds: 7
    resolution: 1920x1080
    sampling_rate: 48000
    type: video/mp4
    width: 1920

Finally I installe version 15b and voila:

Code:

    bitrate: 11428562
    channel: 2
    codecid: MSNV
    date_creation: 2022-11-01 08:37:07
    duration: 6760
    filesize: 9436
    format: MP4
    frame_rate: 25
    height: 1080
    playtime_seconds: 7
    resolution: 1920x1080
    sampling_rate: 48000
    type: video/mp4
    width: 1920

...the 'date_creation' is synced and metadata show up in gallery view.

I read on github that there was a fix for a  'MEDIA_CREATE_DATE' - problem in version 15c, so ....

Offline

 

#11 2025-05-17 19:25:43

cryopad
Piwigo Team
Grenoble, France
2015-11-01
219

Re: [resolved] DateTimeOriginal exif metadata not synced from video

True. A fix is coming. See this thread.


If you enjoy Piwigo for iOS…
➤ We would appreciate an AppStore review.
➤ Comments, suggestions ? Tell us on GitHub…
➤ Not yet available in your language ? Help us translate it…

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2025 · Contact