The attached file "video-file.el" provides regular expressions to match video files by common extensions (analogous to "image-file.el"). The patch for tumme.el uses that to support thumbnails of video files.
video-file.el
Description: application/emacs-lisp
*** tumme.el 24 Aug 2006 20:45:29 +0200 1.44
--- tumme.el 08 Jan 2007 17:52:02 +0100
***************
*** 238,245 ****
Available options are %p which is replaced by
`tumme-cmd-create-thumbnail-program', %w which is replaced by
`tumme-thumb-width', %h which is replaced by `tumme-thumb-height',
! %f which is replaced by the file name of the original image and %t
! which is replaced by the file name of the thumbnail file."
:type 'string
:group 'tumme)
--- 238,252 ----
Available options are %p which is replaced by
`tumme-cmd-create-thumbnail-program', %w which is replaced by
`tumme-thumb-width', %h which is replaced by `tumme-thumb-height',
! %f which is replaced by the file name of the original image, %t
! which is replaced by the file name of the thumbnail file and %x which
! is replaced by `tumme-temp-image-file'."
! :type 'string
! :group 'tumme)
!
! (defcustom tumme-cmd-create-video-thumbnail-command "ffmpeg -itsoffset -4 -i \"%f\" -vcodec png -vframes 1 -an -f rawvideo -y \"%x\"; %p \"%x\" -resize %wx%h jpeg:\"%t\""
! "Command used to create thumbnail of video file. Available
! options are described in `tumme-cmd-create-thumbnail-options'."
:type 'string
:group 'tumme)
***************
*** 494,499 ****
--- 501,515 ----
:type 'string
:group 'tumme)
+ (defcustom tumme-external-video-viewer
+ (cond ((executable-find "mplayer"))
+ ((executable-find "xine")))
+ "Name of external viewer for video files.
+ Including parameters. Used when displaying original image from
+ `tumme-thumbnail-mode'."
+ :type 'string
+ :group 'tumme)
+
(defcustom tumme-external-viewer
;; TODO: Use mailcap, dired-guess-shell-alist-default,
;; dired-view-command-alist.
***************
*** 614,624 ****
original-file)))))
(thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png"
thumbnail-file))
(command
(format-spec
! (if (eq 'standard tumme-thumbnail-storage)
! tumme-cmd-create-standard-thumbnail-command
! tumme-cmd-create-thumbnail-options)
(list
(cons ?p tumme-cmd-create-thumbnail-program)
(cons ?w width)
--- 630,645 ----
original-file)))))
(thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png"
thumbnail-file))
+ (temp-file (expand-file-name tumme-temp-image-file))
(command
(format-spec
! (if (string-match (video-file-name-regexp) original-file)
! (progn
! (if (file-exists-p temp-file) (delete-file temp-file))
! tumme-cmd-create-video-thumbnail-command)
! (if (eq 'standard tumme-thumbnail-storage)
! tumme-cmd-create-standard-thumbnail-command
! tumme-cmd-create-thumbnail-options))
(list
(cons ?p tumme-cmd-create-thumbnail-program)
(cons ?w width)
***************
*** 626,632 ****
(cons ?m modif-time)
(cons ?f original-file)
(cons ?q thumbnail-nq8-file)
! (cons ?t thumbnail-file))))
thumbnail-dir)
(when (not (file-exists-p
(setq thumbnail-dir (file-name-directory thumbnail-file))))
--- 647,654 ----
(cons ?m modif-time)
(cons ?f original-file)
(cons ?q thumbnail-nq8-file)
! (cons ?t thumbnail-file)
! (cons ?x temp-file))))
thumbnail-dir)
(when (not (file-exists-p
(setq thumbnail-dir (file-name-directory thumbnail-file))))
***************
*** 852,864 ****
displayed."
(interactive "DDir: ")
(dired dir)
! (dired-mark-files-regexp (image-file-name-regexp))
(let ((files (dired-get-marked-files)))
(if (or (<= (length files) tumme-show-all-from-dir-max-files)
(and (> (length files) tumme-show-all-from-dir-max-files)
(y-or-n-p
(format
! "Directory contains more than %d image files. Proceed? "
tumme-show-all-from-dir-max-files))))
(progn
(tumme-display-thumbs)
--- 874,887 ----
displayed."
(interactive "DDir: ")
(dired dir)
! (dired-mark-files-regexp
! (concat (image-file-name-regexp) "\\|" (video-file-name-regexp)))
(let ((files (dired-get-marked-files)))
(if (or (<= (length files) tumme-show-all-from-dir-max-files)
(and (> (length files) tumme-show-all-from-dir-max-files)
(y-or-n-p
(format
! "Directory contains more than %d files for thumbnails. Proceed? "
tumme-show-all-from-dir-max-files))))
(progn
(tumme-display-thumbs)
***************
*** 1646,1652 ****
;;;###autoload
(defun tumme-display-thumb ()
! "Shorthard for `tumme-display-thumbs' with prefix argument."
(interactive)
(tumme-display-thumbs t nil t))
--- 1669,1675 ----
;;;###autoload
(defun tumme-display-thumb ()
! "Shorthand for `tumme-display-thumbs' with prefix argument."
(interactive)
(tumme-display-thumbs t nil t))
***************
*** 1711,1717 ****
(if (not file)
(message "No original file name found")
(call-process shell-file-name nil nil nil shell-command-switch
! (format "%s \"%s\"" tumme-external-viewer file))))))
;;;###autoload
(defun tumme-dired-display-external ()
--- 1734,1744 ----
(if (not file)
(message "No original file name found")
(call-process shell-file-name nil nil nil shell-command-switch
! (format "%s \"%s\""
! (if (string-match (video-file-name-regexp) file)
! tumme-external-video-viewer
! tumme-external-viewer)
! file))))))
;;;###autoload
(defun tumme-dired-display-external ()
***************
*** 1816,1824 ****
(message "No thumbnail at point")
(if (not file)
(message "No original file name found")
! (tumme-create-display-image-buffer)
! (display-buffer tumme-display-image-buffer)
! (tumme-display-image file arg))))))
;;;###autoload
--- 1843,1853 ----
(message "No thumbnail at point")
(if (not file)
(message "No original file name found")
! (if (string-match (video-file-name-regexp) file)
! (tumme-thumbnail-display-external)
! (tumme-create-display-image-buffer)
! (display-buffer tumme-display-image-buffer)
! (tumme-display-image file arg)))))))
;;;###autoload
_______________________________________________ gnu-emacs-sources mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
