emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Alan E. Davis" <lngndvs@gmail.com>
To: Memnon Anon <gegendosenfleisch@googlemail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Audio/video file playback in org mode
Date: Sun, 12 Jun 2011 09:55:43 +1000	[thread overview]
Message-ID: <BANLkTi=qdWvSJY3ke8dguAQ-0H9QYOsCrw@mail.gmail.com> (raw)
In-Reply-To: <87oc24mqrd.fsf@mean.albasani.net>

[-- Attachment #1: Type: text/plain, Size: 3457 bytes --]

I'll jump in and mention a solution to an at least similar problem I hacked,
albeit incompletely, some time ago.  I baldly stole code from
"dired-mplayer" at http://www.emacswiki.org/cgi-bin/wiki/EMMS#toc10 , and
have been using the result, "dired-vlc" ever since.   The main point of this
was to play videos asynchronously, so I could continue editing, taking notes
using the relative timer of org-mode.

Two more things would make this process work better, at least for me:

   1. write a few lines into this that would open another buffer, possibly
through capture, starting the relative timer automagically.
   2. figure out how to pause the video and the timer simultaneously.

Here is the code to dired-vlc.  I am not interested in making this work for
windows, have no idea whether it would, or how to make it do so.

;;  -*- mode: elisp -*-
;; Time-stamp: <2009-01-13 14:27:47 orm>
;; AED 05 January 2009

(require 'org)

(defvar dired-vlc-program "/usr/bin/vlc")

(defun dired-vlc (&optional timer)
  "Asynchronously start vlc on file through dired.  If an optional
argument is given (C-u), the org relative timer is started.  This
function purports to start vlc in rc mode, to leave open the
possibility of remote control."
  (interactive "P")
  (let ((file (expand-file-name (dired-get-filename)))
        ext files basename dir curr-file ;idx-file sub-file srt-file
    command options)
    (setq basename (file-name-nondirectory
            (file-name-sans-extension file)))
    (setq dir (file-name-directory file))
    (setq files (directory-files dir t basename))
    (delete file files)
    (setq command (format "\"%s\" \"%s" dired-vlc-program "--intf rc"))
    (if (y-or-n-p (format "Run command %s?" command))
        (start-process "junk" nil dired-vlc-program file)))
  (if (equal timer '(4)) (org-timer-start))

;; end dired-vlc.el

I am interested in what you are doing, also, and I will try it out in a
month or two, after I retire and relocate.

Alan Davis

On Sun, Jun 12, 2011 at 12:00 AM, Memnon Anon <
gegendosenfleisch@googlemail.com> wrote:

> Paul Sexton <psexton@xnet.co.nz> writes:
> > brian powell <briangpowellms <at> gmail.com> writes:
> >
> >
> >> * Something like this; respectively!?:
> >>
> >> [[shell:mplayer -ss 00:03:21 -endpos 00:06:54 ~/some_podcast.mp3 &]]
> >> [[shell:mplayer -ss 00:03:21 ~/some_podcast.mp3 &]]
> >> [[shell:mplayer ~/some_podcast.mp3 &]]
> >
> > The troubles with using shell commands in hyperlinks:
> > 1. Only works in the operating system and directory structure where
> >    you were when you wrote the link;
> > 2. No ability to stop playback, pause, etc, unless you run the
> >    program as a GUI, which means (horror!) doing something outside
> >    Emacs.
> If you are using different setups on different operating systems, 1)
> should probably be solved in some general fashion, like setting some
> vars to important locations depending on environmentearly in your .emacs.
> 2.)
>    [[elisp:(emms-play-file "~/tmp/video/magit.flv")]]
> or
>    [[elisp:(emms-play-file (concat MYSCREENCASTSDIR "magit.flv"))]]
> or
> [[elisp:(emms-play-file (concat MYSCREENCASTSDIR "magit.flv"))][View magit
> demo]]
> Of course, there is no problem with setting up org to treat file links to
> mediafiles special. But given the power of org hyperlinks, I think using
> "elisp:" solves your 1.) and 2.) sufficiently.
> Memnon

[-- Attachment #2: Type: text/html, Size: 4485 bytes --]

  reply	other threads:[~2011-06-11 23:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 21:55 Audio/video file playback in org mode Paul Sexton
2011-06-09 22:22 ` Eric Schulte
2011-06-10  8:28 ` Michael Brand
2011-06-10 16:10   ` brian powell
2011-06-11  4:57     ` Paul Sexton
2011-06-11 14:00       ` Memnon Anon
2011-06-11 23:55         ` Alan E. Davis [this message]
2011-06-12  8:23           ` Christian Moe
2011-06-12  9:34             ` Michael Brand
2011-06-11  4:53   ` Paul Sexton
     [not found]   ` <4DF2F3B6.2030400@xnet.co.nz>
2011-06-11  6:23     ` Michael Brand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTi=qdWvSJY3ke8dguAQ-0H9QYOsCrw@mail.gmail.com' \
    --to=lngndvs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gegendosenfleisch@googlemail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).