* Viewing raster and vector images, in the following formats:
3FR, ANI, APM, ARW, BMP, CR2, CRW, CUR, DNG, ERF, GIF, ICNS, ICO, JPE/JPEG/JPG, JPS, KDC, MEF, MPO, MOS, MRW, NEF, ORF, PEF, PTX, PBM/PGM/PNM/PPM, PNG, QIF/QTIF (QuickTime Image Format), RAF, RAW, RW2, SR2, SRF, SVG/SVGZ, TGA/TARGA, TIF/TIFF, WMF, XBM, XPM. Animated GIFs are supported.
+* Preview and thumbnails of video clips can be displayed. Clips can be run via a defined external program.
+
* Images can be displayed singly in normal or fullscreen mode; static or slideshow mode; in sets of two or four per page for comparison; or as thumbnails of various sizes. Synchronised zoom when multi images are displayed.
* Pan(orama) view displays image thumbnails in calendar, grid, folder and other layouts.
markdown
when compiling Geeqie, to create this file in html format
+ libffmpegthumbnailer 2.0.0
+ https://github.com/dirkvdb/ffmpegthumbnailer
+ for thumbnailing camera video clips
+ disable with configure option: --disable-ffmpegthumbnailer
### Code hackers:
AC_SUBST(TIFF_CFLAGS)
AC_SUBST(TIFF_LIBS)
+# libffmpegthumbnailer support
+# ----------------------------------------------------------------------
+
+AC_ARG_ENABLE([ffmpegthumbnailer],
+ AC_HELP_STRING([--disable-ffmpegthumbnailer], [disable ffmpegthumbnailer support for generating thumbnails of video files]),
+ [ffmpegthumbnailer=$enableval], [ffmpegthumbnailer=auto])
+
+if test "x${ffmpegthumbnailer}" != "xno"; then
+ PKG_CHECK_MODULES(FFMPEGTHUMBNAILER, [libffmpegthumbnailer >= 2.0.0],
+ [
+ HAVE_FFMPEGTHUMBNAILER=yes
+ AC_DEFINE(HAVE_FFMPEGTHUMBNAILER, 1, [define to enable ffmpegthumbnailer support])
+ AC_CHECK_MEMBER([video_thumbnailer.prefer_embedded_metadata], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_METADATA, 1, [define if ffmpegthumbnailer supports embedded metadata])], [], [[#include <libffmpegthumbnailer/videothumbnailerc.h>]])
+ AC_CHECK_MEMBER([image_data.image_data_width], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_RGB, 1, [define if ffmpegthumbnailer supports raw RGB output])], [], [[#include <libffmpegthumbnailer/videothumbnailerc.h>]])
+ AC_CHECK_LIB([ffmpegthumbnailer], [video_thumbnailer_set_size], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_WH, 1, [define if ffmpegthumbnailer supports specifying size by width/height])])
+ ],
+ [
+ HAVE_FFMPEGTHUMBNAILER=no
+ ])
+else
+ HAVE_FFMPEGTHUMBNAILER=disabled
+fi
+
+AM_CONDITIONAL(HAVE_FFMPEGTHUMBNAILER, [test "x$HAVE_FFMPEGTHUMBNAILER" = xyes])
+AC_SUBST(FFMPEGTHUMBNAILER_CFLAGS)
+AC_SUBST(FFMPEGTHUMBNAILER_LIBS)
# Exiv2 support
# ----------------------------------------------------------------------
Libchamplain: $HAVE_LIBCHAMPLAIN
Libchamplain-gtk: $HAVE_LIBCHAMPLAIN_GTK
Lua: $HAVE_LUA
+ FFmpegthumbnailer: $HAVE_FFMPEGTHUMBNAILER
Documentation:
Doxygen: $DX_DOXYGEN
<link linkend="GuideReferencePixbufLoaders" endterm="titleGuideReferencePixbufLoaders" />\r
for additional information.\r
</para>\r
+ <para>\r
+ Preview and thumbnails of video clips can be displayed. Clips can be run via a defined external program - see\r
+ <link linkend="Behaviour">Play video by left click on image</link>.\r
+ </para>\r
</section>\r
$(LIBCHAMPLAIN_GTK_CFLAGS) \
$(LUA_CFLAGS) \
$(CLUTTER_CFLAGS) \
- $(CLUTTER_GTK_CFLAGS) \
+ $(CLUTTER_GTK_CFLAGS) \
+ $(FFMPEGTHUMBNAILER_CFLAGS) \
-I$(top_srcdir) \
-I$(top_builddir)
$(LIBCHAMPLAIN_GTK_CFLAGS) \
$(LUA_CFLAGS) \
$(CLUTTER_CFLAGS) \
- $(CLUTTER_GTK_CFLAGS) \
+ $(CLUTTER_GTK_CFLAGS) \
+ $(FFMPEGTHUMBNAILER_CFLAGS) \
-I$(top_srcdir) \
-I$(top_builddir)
image_load_jpeg.h\
image_load_tiff.c\
image_load_tiff.h\
+ image_load_ffmpegthumbnailer.c\
+ image_load_ffmpegthumbnailer.h\
image-overlay.c \
image-overlay.h \
img-view.c \
lua.c \
glua.h
-geeqie_LDADD = $(GTK_LIBS) $(GLIB_LIBS) $(INTLLIBS) $(JPEG_LIBS) $(TIFF_LIBS) $(LCMS_LIBS) $(EXIV2_LIBS) $(LIBCHAMPLAIN_LIBS) $(LIBCHAMPLAIN_GTK_LIBS) $(LUA_LIBS) $(CLUTTER_LIBS) $(CLUTTER_GTK_LIBS)
+geeqie_LDADD = $(GTK_LIBS) $(GLIB_LIBS) $(INTLLIBS) $(JPEG_LIBS) $(TIFF_LIBS) $(LCMS_LIBS) $(EXIV2_LIBS) $(LIBCHAMPLAIN_LIBS) $(LIBCHAMPLAIN_GTK_LIBS) $(LUA_LIBS) $(CLUTTER_LIBS) $(CLUTTER_GTK_LIBS) $(FFMPEGTHUMBNAILER_LIBS)
EXTRA_DIST = \
$(extra_SLIK)
#include "image_load_gdk.h"
#include "image_load_jpeg.h"
#include "image_load_tiff.h"
+#include "image_load_ffmpegthumbnailer.h"
#include "exif.h"
#include "filedata.h"
}
g_mutex_unlock(il->data_mutex);
+#ifdef HAVE_FFMPEGTHUMBNAILER
+ if (il->fd->format_class == FORMAT_CLASS_VIDEO)
+ scale = TRUE;
+#endif
mime_types = il->backend.get_format_mime_types(loader);
n = 0;
- while (mime_types[n])
+ while (mime_types[n] && !scale)
{
if (strstr(mime_types[n], "jpeg")) scale = TRUE;
n++;
static void image_loader_setup_loader(ImageLoader *il)
{
g_mutex_lock(il->data_mutex);
+#ifdef HAVE_FFMPEGTHUMBNAILER
+ if (il->fd->format_class == FORMAT_CLASS_VIDEO)
+ {
+ DEBUG_1("Using custom ffmpegthumbnailer loader");
+ image_loader_backend_set_ft(&il->backend);
+ }
+ else
+#endif
#ifdef HAVE_JPEG
if (il->bytes_total >= 2 && il->mapped_file[0] == 0xff && il->mapped_file[1] == 0xd8)
{
--- /dev/null
+/*
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: Tomasz Golinski <tomaszg@math.uwb.edu.pl>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "main.h"
+#include "image-load.h"
+#include "image_load_ffmpegthumbnailer.h"
+
+#ifdef HAVE_FFMPEGTHUMBNAILER
+#include <libffmpegthumbnailer/videothumbnailerc.h>
+
+typedef struct _ImageLoaderFT ImageLoaderFT;
+struct _ImageLoaderFT {
+ ImageLoaderBackendCbAreaUpdated area_updated_cb;
+ ImageLoaderBackendCbSize size_cb;
+ ImageLoaderBackendCbAreaPrepared area_prepared_cb;
+
+ video_thumbnailer *vt;
+
+ gpointer data;
+
+ GdkPixbuf *pixbuf;
+ guint requested_width;
+ guint requested_height;
+
+};
+
+static void image_loader_ft_log_cb(ThumbnailerLogLevel log_level, const char* msg)
+{
+ if (log_level == ThumbnailerLogLevelError)
+ log_printf("ImageLoaderFFmpegthumbnailer: %s",msg);
+ else
+ DEBUG_1("ImageLoaderFFmpegthumbnailer: %s",msg);
+}
+
+void image_loader_ft_destroy_image_data(guchar *pixels, gpointer data)
+{
+ image_data *image = (image_data *) data;
+
+ video_thumbnailer_destroy_image_data (image);
+}
+
+static gchar* image_loader_ft_get_format_name(gpointer loader)
+{
+ return g_strdup("ffmpeg");
+}
+
+static gchar** image_loader_ft_get_format_mime_types(gpointer loader)
+{
+ static gchar *mime[] = {"video/mp4", NULL};
+ return g_strdupv(mime);}
+
+static gpointer image_loader_ft_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
+{
+ ImageLoaderFT *loader = g_new0(ImageLoaderFT, 1);
+
+ loader->area_updated_cb = area_updated_cb;
+ loader->size_cb = size_cb;
+ loader->area_prepared_cb = area_prepared_cb;
+ loader->data = data;
+
+ loader->vt = video_thumbnailer_create();
+ loader->vt->overlay_film_strip = 1;
+ loader->vt->maintain_aspect_ratio = 1;
+#if HAVE_FFMPEGTHUMBNAILER_RGB
+ video_thumbnailer_set_log_callback(loader->vt, image_loader_ft_log_cb);
+#endif
+
+ return (gpointer) loader;
+}
+
+static void image_loader_ft_set_size(gpointer loader, int width, int height)
+{
+ ImageLoaderFT *lft = (ImageLoaderFT *) loader;
+ lft->requested_width = width;
+ lft->requested_height = height;
+ DEBUG_1("TG: setting size, w=%d, h=%d", width, height);
+}
+
+// static gboolean image_loader_ft_loadfromdisk(gpointer loader, const gchar *path, GError **error)
+static gboolean image_loader_ft_load (gpointer loader, const guchar *buf, gsize count, GError **error)
+{
+ ImageLoaderFT *lft = (ImageLoaderFT *) loader;
+ ImageLoader *il = lft->data;
+
+ image_data *image = video_thumbnailer_create_image_data();
+
+#ifdef HAVE_FFMPEGTHUMBNAILER_WH
+// DEBUG_1("TG: FT requested size w=%d:h=%d for %s", lft->requested_width > 0, lft->requested_height, il->fd->path);
+ video_thumbnailer_set_size(lft->vt, lft->requested_width, lft->requested_height);
+#else
+ lft->vt->thumbnail_size = MAX(lft->requested_width,lft->requested_width);
+#endif
+
+#ifdef HAVE_FFMPEGTHUMBNAILER_METADATA
+ lft->vt->prefer_embedded_metadata = options->thumbnails.use_ft_metadata ? 1 : 0;
+#endif
+
+#if HAVE_FFMPEGTHUMBNAILER_RGB
+ lft->vt->thumbnail_image_type = Rgb;
+#else
+ lft->vt->thumbnail_image_type = Png;
+#endif
+
+ video_thumbnailer_generate_thumbnail_to_buffer (lft->vt, il->fd->path, image);
+
+#if HAVE_FFMPEGTHUMBNAILER_RGB
+ lft->pixbuf = gdk_pixbuf_new_from_data (image->image_data_ptr, GDK_COLORSPACE_RGB, FALSE, 8, image->image_data_width, image->image_data_height, image->image_data_width*3, image_loader_ft_destroy_image_data, image);
+ lft->size_cb(loader, image->image_data_width, image->image_data_height, lft->data);
+ lft->area_updated_cb(loader, 0, 0, image->image_data_width, image->image_data_height, lft->data);
+#else
+ GInputStream *image_stream;
+ image_stream = g_memory_input_stream_new_from_data (image->image_data_ptr, image->image_data_size, NULL);
+
+ if (image_stream == NULL)
+ {
+ video_thumbnailer_destroy_image_data (image);
+ DEBUG_1("FFmpegthumbnailer: cannot open stream for %s", il->fd->path);
+ return FALSE;
+ }
+
+ lft->pixbuf = gdk_pixbuf_new_from_stream (image_stream, NULL, NULL);
+ lft->size_cb(loader, gdk_pixbuf_get_width(lft->pixbuf), gdk_pixbuf_get_height(lft->pixbuf), lft->data);
+ g_object_unref (image_stream);
+ video_thumbnailer_destroy_image_data (image);
+#endif
+
+ if (!lft->pixbuf)
+ {
+ DEBUG_1("FFmpegthumbnailer: no frame generated for %s", il->fd->path);
+ return FALSE;
+ }
+
+/* See comment in image_loader_area_prepared_cb
+ * Geeqie uses area_prepared signal to fill pixbuf with background color.
+ * We can't do it here as pixbuf already contains the data */
+// lft->area_prepared_cb(loader, lft->data);
+
+ lft->area_updated_cb(loader, 0, 0, gdk_pixbuf_get_width(lft->pixbuf), gdk_pixbuf_get_height(lft->pixbuf), lft->data);
+
+ return TRUE;
+}
+
+static GdkPixbuf* image_loader_ft_get_pixbuf(gpointer loader)
+{
+ ImageLoaderFT *lft = (ImageLoaderFT *) loader;
+ return lft->pixbuf;
+}
+
+static void image_loader_ft_abort(gpointer loader)
+{
+}
+
+static gboolean image_loader_ft_close(gpointer loader, GError **error)
+{
+ return TRUE;
+}
+
+static void image_loader_ft_free(gpointer loader)
+{
+ ImageLoaderFT *lft = (ImageLoaderFT *) loader;
+ if (lft->pixbuf) g_object_unref(lft->pixbuf);
+ video_thumbnailer_destroy (lft->vt);
+
+ g_free(lft);
+}
+
+void image_loader_backend_set_ft(ImageLoaderBackend *funcs)
+{
+ funcs->loader_new = image_loader_ft_new;
+ funcs->set_size = image_loader_ft_set_size;
+ funcs->load = image_loader_ft_load;
+ funcs->write = NULL;
+ funcs->get_pixbuf = image_loader_ft_get_pixbuf;
+ funcs->close = image_loader_ft_close;
+ funcs->abort = image_loader_ft_abort;
+ funcs->free = image_loader_ft_free;
+
+ funcs->get_format_name = image_loader_ft_get_format_name;
+ funcs->get_format_mime_types = image_loader_ft_get_format_mime_types;
+}
+
+#endif
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
--- /dev/null
+/*
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
+ *
+ * Author: Vladimir Nadvornik
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef IMAGE_LOAD_FT_H
+#define IMAGE_LOAD_FT_H
+
+#ifdef HAVE_FFMPEGTHUMBNAILER
+void image_loader_backend_set_ft(ImageLoaderBackend *funcs);
+#endif
+
+#endif
+
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
struct error_handler_data jerr;
lj->stereo = FALSE;
+// DEBUG_1("TG: JPG requested size w=%d:h=%d", lj->requested_width > 0, lj->requested_height);
MPOData *mpo = jpeg_get_mpo_data(buf, count);
if (mpo && mpo->num_images > 1)
lj->requested_width = lj->stereo ? cinfo.image_width * 2: cinfo.image_width;
lj->requested_height = cinfo.image_height;
+// DEBUG_1("TG: JPG requested size v2 w=%d:h=%d", lj->requested_width > 0, lj->requested_height);
lj->size_cb(loader, lj->requested_width, lj->requested_height, lj->data);
cinfo.scale_num = 1;
options->thumbnails.spec_standard = TRUE;
options->thumbnails.use_xvpics = TRUE;
options->thumbnails.use_exif = FALSE;
+ options->thumbnails.use_ft_metadata = TRUE;
+// options->thumbnails.use_ft_metadata_small = TRUE;
options->tree_descend_subdirs = FALSE;
options->view_dir_list_single_click_enter = TRUE;
gboolean spec_standard;
guint quality;
gboolean use_exif;
+ gboolean use_ft_metadata;
+// gboolean use_ft_metadata_small;
} thumbnails;
/* file filtering */
options->thumbnails.enable_caching = c_options->thumbnails.enable_caching;
options->thumbnails.cache_into_dirs = c_options->thumbnails.cache_into_dirs;
options->thumbnails.use_exif = c_options->thumbnails.use_exif;
+ options->thumbnails.use_ft_metadata = c_options->thumbnails.use_ft_metadata;
+// options->thumbnails.use_ft_metadata_small = c_options->thumbnails.use_ft_metadata_small;
options->thumbnails.spec_standard = c_options->thumbnails.spec_standard;
options->metadata.enable_metadata_dirs = c_options->metadata.enable_metadata_dirs;
options->file_filter.show_hidden_files = c_options->file_filter.show_hidden_files;
pref_checkbox_new_int(group, _("Use EXIF thumbnails when available (EXIF thumbnails may be outdated)"),
options->thumbnails.use_exif, &c_options->thumbnails.use_exif);
+#ifdef HAVE_FFMPEGTHUMBNAILER_METADATA
+ pref_checkbox_new_int(group, _("Use embedded metadata in video files as thumbnails when available"),
+ options->thumbnails.use_ft_metadata, &c_options->thumbnails.use_ft_metadata);
+
+// pref_checkbox_new_int(group, _("Ignore embedded metadata if size is too small"),
+// options->thumbnails.use_ft_metadata_small, &c_options->thumbnails.use_ft_metadata_small);
+#endif
+
group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL);
c_options->slideshow.delay = options->slideshow.delay;
WRITE_NL(); WRITE_BOOL(*options, thumbnails.spec_standard);
WRITE_NL(); WRITE_UINT(*options, thumbnails.quality);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_exif);
+ WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_ft_metadata);
+// WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_ft_metadata_small);
/* File sorting Options */
WRITE_NL(); WRITE_INT(*options, file_sort.method);
if (READ_BOOL(*options, thumbnails.spec_standard)) continue;
if (READ_UINT_CLAMP(*options, thumbnails.quality, GDK_INTERP_NEAREST, GDK_INTERP_HYPER)) continue;
if (READ_BOOL(*options, thumbnails.use_exif)) continue;
+ if (READ_BOOL(*options, thumbnails.use_ft_metadata)) continue;
+// if (READ_BOOL(*options, thumbnails.use_ft_metadata_small)) continue;
/* File sorting options */
if (READ_UINT(*options, file_sort.method)) continue;
if (!tl->fd) tl->fd = file_data_ref(fd);
- if (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE)
+ if (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE && tl->fd->format_class != FORMAT_CLASS_VIDEO)
{
thumb_loader_set_fallback(tl);
return FALSE;
tl->fd = file_data_ref(fd);
- if (!stat_utf8(fd->path, &st) || (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE))
+ if (!stat_utf8(fd->path, &st) || (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE && tl->fd->format_class != FORMAT_CLASS_VIDEO))
{
thumb_loader_std_set_fallback(tl);
return FALSE;
Viewing raster and vector images, in the following formats:\r
3FR, ANI, APM, ARW, BMP, CR2, CRW, CUR, DNG, ERF, GIF, ICNS, ICO, JPE/JPEG/JPG, JPS, KDC, MEF, MPO, MOS, MRW, NEF, ORF, PEF, PTX, PBM/PGM/PNM/PPM, PNG, QIF/QTIF (QuickTime Image Format), RAF, RAW, RW2, SR2, SRF, SVG/SVGZ, TGA/TARGA, TIF/TIFF, WMF, XBM, XPM. Animated GIFs are supported.\r
</p>\r
+ <ul>\r
+ <li>\r
+ <p>Preview and thumbnails of video clips can be displayed. Clips can be run via a defined external program.</p>\r
+ </li>\r
+ </ul>\r
</li>\r
<li>\r
<p>Images can be displayed singly in normal or fullscreen mode; static or slideshow mode; in sets of two or four per page for comparison; or as thumbnails of various sizes. Synchronised zoom when multi images are displayed.</p>\r
</ul>\r
</div>\r
</body>\r
-</html>
+</html>\r
\r
markdown\r
when compiling Geeqie, to create this file in html format\r
+\r
+ libffmpegthumbnailer 2.0.0\r
+ for thumbnailing camera video clips\r
+ enabled by default\r
+ disable with configure option: --disable-libffmpegthumbnailer\r
</code>\r
</pre>\r
</div>\r
</body>\r
-</html>
+</html>\r