Skip to content
xbgmsharp edited this page Mar 15, 2015 · 23 revisions

This tab extend the video support of Piwigo.

  • Look for all the supported video by the plugin (mp4, ogg, webm or MP4, OGG, WEBM)

Metadata

  • Parse the metadata from each video (filesize, width, height, latitude, longitude, date_creation, rotation) and push them to the DB.
    • Support of latitude, longitude is include in PWG
    • View the latitude, longitude required 'OpenStreetMap' or 'RV Maps & Earth' plugin.
    • Support of rotation, to be use, if 'videojs-rotatezoom plugin' is activated.

Poster

  • Create a poster at the selected second and push it to the DB.
    • If the movie is shorter, it fallback to the last second.
  • Overwrite any existing poster if selected.
    • It does not check if the file exist, it use the 'representative_ext' field in the DB.
  • Create a poster in the output format JPG (.jpg) or PNG (.png).
  • Apply an overlay on the poster creation if selected.
    • Useful if you want to distinct video file from image.
    • You can also use the MediaIcon plugin to distinct video file.

Thumbnail

Usage

  • Copy the video to an album in your gallery.
  • Synchronize as usual, 'Administration' -> 'Tools' -> 'Synchronization'
  • Go to the plugin page 'Administration' -> 'Plugins' -> 'VideoJS' -> 'Synchronization'
  • Run the Synchronization.

Go back to your album and you should see the thumbnail, Click on it and you should see the video with a poster, Click play and the video should start. Easy enough ;)

Requirement

  • Piwigo > 2.4, because the 'pwg_representative' does not exist before.
  • Ensure you have MediaInfo install, eg: '/usr/bin/mediainfo'.
    • Check MediaInfo website.
    • Only the CLI version is require.
  • Ensure you have FFmpeg install, eg: '/usr/bin/ffmpeg'.
  • Ensure of permission to read and execute the video file.
  • Ensure of permission to write in the 'pwg_representative' directory of your album.
  • Ensure the presence of 'OpenStreetMap' or 'RV Maps & Earth' plugin to allow latitude and longitude support.
  • Poster/Thumbnail support for MP4 file require 'libfaac' 'libvo-aacenc' or 'libx264' to be installed on the system.
  • Poster/Thumbnail support for WebM file require 'libvorbis' or 'libvpx' to be installed on the system.
  • Poster/Thumbnail support for OGG file require 'libvorbis' or 'libtheora' to be installed on the system.
  • To easily convert your video in a supported format, you can use HandBrake
  • Global information about video and the web, Encoding files to .webm (VP8) and .mp4 (h.264) using ffmpeg.

I have test it successfully on video from my iPhone.

MediaInfo

The command used to read video metadata is as following:

mediainfo --Full --Output=XML --Language=raw "$VIDEOFILE"

The human readable version is as following:

mediainfo "$VIDEOFILE"

Poster generation

The command works with ffmpeg and avconv.

The command used to generate the poster is as following:

  • for JPG output file:

ffmpeg -ss 4 -i "$INFILE" -vcodec mjpeg -vframes 1 -an -f rawvideo -y "$OUTFILE"

  • for PNG output file:

ffmpeg -ss 4 -i "$INFILE" -vcodec png -vframes 1 -an -f rawvideo -y "$OUTFILE"

Change number 4 to generate poster in different time.

Thumbnail generation

The command used to generate the thumbnail is as following:

  • for JPG output file:

ffmpeg -ss 4 -i "$INFILE" -vcodec mjpeg -vframes 1 -an -f rawvideo -vf scale='160:trunc(ow/a)' -y "$OUTFILE"

  • for PNG output file:

ffmpeg -ss 4 -i "$INFILE" -vcodec png -vframes 1 -an -f rawvideo -vf scale='160:trunc(ow/a)' -y "$OUTFILE"

Change number 4 to generate a thumbnail in different time.

Change number 160 to generate a thumbnail with a different width.

To respect the aspect ration, it takes thumbnail output width (ow), divides it by aspect ratio (a), truncates digits after decimal point.

Screenshot

Sample synchronize ouput