Announcement


Notice: Undefined offset: 5 in /var/www/piwigo.org/forum/include/parser.php on line 551

#1 2021-12-28 09:25:03

alacecho
Member
2021-08-15
2

Save metadata (tags) into Videos

Hello!

My Piwigo is running on the Docker from [Github] docker-piwigo file Dockerfile. The docker image comes with all the necessary dependencies for Videojs: mediainfo, ffprobe, exiftool and ffmpeg. I have successfully created galleries, and uploaded videos to the galleries without any problems. Videojs recognises the metadata of mp4 videos, such as the tags contained in the videos, without any problems.

My query is related to adding new tags to the files from Piwigo. My idea is that I can export or download these videos, and that they keep the new tags in their metadata. However, I have not been able to do this. The process indicates that the new tags have been generated for the video (I assume they are saved and linked from the database), but the metadata does not show these new tags.

I have been reading about metadata, Piwigo, and some queries and ideas on the forums, and I have prepared this information, in case it is possible that someone can help me, or some ideas come up.

I've activated the logging used

Code:

$conf['enable_i_log'] = true;

into the configuration file.

1. Uploading a video file using Albums - Add pictures - Administration of the batch - Action Videos. When I upload a video (with no tags into it), this is the log output:

Code:

[2021-12-28 8:42:22]    [INFO]  upload_file_pdf, $file_path = ././upload/2021/12/28/20211228084222-02c11246.mp4, $representative_ext =
[2021-12-28 8:42:22]    [INFO]  upload_file_tiff, $file_path = ././upload/2021/12/28/20211228084222-02c11246.mp4, $representative_ext =
[2021-12-28 8:42:22]    [INFO]  upload_file_video, $file_path = ././upload/2021/12/28/20211228084222-02c11246.mp4, $representative_ext =
[2021-12-28 8:42:22]    [INFO]  Handling ././upload/2021/12/28/20211228084222-02c11246.mp4 got jpg
[2021-12-28 8:42:23]    [INFO]  add_uploaded_file : force cache generation, derivative_url = http://192.168.42.150:9091/i.php?/upload/2021/12/28/pwg_representative/20211228084222-02c11246-me.jpg
[2021-12-28 8:42:23]    [DEBUG] [i.php] 
  src_path: '20211228084222-02c11246.jpg'
  derivative_path: '20211228084222-02c11246-me.jpg'
  o_size: '1080 1080 1166400'
  d_size: '594 594 352836'
  mem_usage: 1.0
  timing: array(
    'load' => 42,
    'rotate' => '',
    'crop' => '',
    'scale' => 133,
    'sharpen' => '',
    'watermark' => '',
    'save' => 26,
    'send' => 0,
    'total' => 202,
  )
[2021-12-28 8:42:23]    [DEBUG] empty_lounge, exec=siDQ, begins
[2021-12-28 8:42:23]    [DEBUG] empty_lounge, exec=siDQ wins the race and gets the token!
[2021-12-28 8:42:23]    [DEBUG] empty_lounge, exec=siDQ, ends
[2021-12-28 8:42:23]    [DEBUG] [i.php] 
  src_path: '20211228084222-02c11246.jpg'
  derivative_path: '20211228084222-02c11246-sq.jpg'
  o_size: '1080 1080 1166400'
  d_size: '120 120 14400'
  mem_usage: 1.0
  timing: array(
    'load' => 36,
    'rotate' => '',
    'crop' => '',
    'scale' => 83,
    'sharpen' => '',
    'watermark' => '',
    'save' => 2,
    'send' => 0,
    'total' => 123,
  )

2. Into the Gallery - Edit picture, I add 3 new tags: Newtag01, Newtag02, Newtag03. I save the video edition and then, this is the log output (looks like the tags 12, 13 and 14 has been attached to the video:

[2021-12-28 8:48:40]    [DEBUG] taglist_before
  33: array()
[2021-12-28 8:48:40]    [DEBUG] taglist_after
  33: array(
    0 => '12',
    1 => '13',
    2 => '14',
  )
$images_to_update 0: 33

3. If I move to these folders, the tags are not attached to the video or the pictures (automatically created by Videojs), when I browse the files with exiftool, mediainfo, or ffmpeg tools in the host (Debian testing machine). My " expectation ", was that the new tag information would at least be saved in the generated jpg files.

File: Gallery/upload/2021/12/28/20211228084222-02c11246.mp4
File: Gallery/upload/2021/12/28/pwg_representative/20211228084222-02c11246.jpg
All files into: Gallery/_data/i/upload/2021/12/28/pwg_representative/

4. Using the "Write metadata" plugin, I got this:

[2021-12-28 9:05:42]    [INFO]  wm_write_metadata command = exiftool -q -IPTC:Headline="Production" -IPTC:ObjectName="Production" -IPTC:Keywords="Newtag01" -IPTC:Keywords="Newtag02" -IPTC:Keywords="Newtag03" "./upload/2021/12/28/202112>
[2021-12-28 9:05:43]    [DEBUG] [i.php]
  src_path: '20211228084222-02c11246.jpg'
  derivative_path: '20211228084222-02c11246-me.jpg'
  o_size: '1080 1080 1166400'
  d_size: '594 594 352836'
  mem_usage: 1.0
  timing: array(
    'load' => 38,
    'rotate' => '',
    'crop' => '',
    'scale' => 131,
    'sharpen' => '',
    'watermark' => '',
    'save' => 26,
    'send' => 0,
    'total' => 197,
  )

Looks like the new tags has been writed into mp4 or jpg files. If I explore the previous files, and the new tags doesn't appear into files.

5. If I use the "Sync metadata" button, nothing happen into log file, or media files.

It is possible that this query has been made before, and you have not found it. However, does anyone know if it is possible to save the new tags within the video metadata, or in some other way? It would be very interesting to keep this metadata when exporting the videos, or backing up the files.

In my video collection, the tag information is contained in xmp files. As Piwigo cannot read these sidecar files, I move the information into the mp4 file as follows (in case it helps anyone), or I embed metadata from mp4 to xmp or another filetype:

Code:

exiftool -v -v -r -overwrite_original -ext mp4 -tagsfromfile @ -all:all -xmp:all -exif:all -iptc:all -n -srcfile %d%f.xmp -r .

Thanks!
Alex

Last edited by alacecho (2021-12-28 11:46:30)

Offline

 

Board footer

Powered by FluxBB

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