Hatena::ブログ(Diary)

With malice toward none

 

2011-05-04

ffmpeg で m4v の一部分を切り出す

$ ffmpeg -ss 00:00:05 -t 2102.0 -i /path/to/file.m4v -acodec copy -vcodec copy /path/to/output.m4v
  • -ss 開始点
  • -t 開始点から何秒分を出力するか

とある講演の映像が、本編と質疑応答が 1 トラックで収録されていたため、上記の方法で分割した。

ちなみに -ss は冒頭の拍手が長かったのでそれを削るためのもの。

ところで当初 homebrew で入れた ffmpeg (0.6.2) で試したところ、音声と映像がずれてしまい大変残念な思いをしたが

$ brew install --HEAD ffmpeg

として、ffmpeg の HEAD(現時点では git-707e861)を使用したところ、ずれのない m4v が得られた。

開発者のみなさまに感謝。

2011-05-01

rvm install 時に clang を要求されたら

twitter でそのような方をお見掛けしたので調べてみた。

rvm install ruby-1.8.7-p334 gives error "You passed the --clang option and clang is not in your path" - Stack Overflow

環境変数 $rvm_clang_flag のチェックがおかしかった模様。RVM 自体を更新すると起きなくなる。

History for scripts/manage - wayneeseguin/rvm - GitHub

こちらもしばしば手を入れてらっしゃるようだ。

Dropbox の更新を知る

Dropbox - Release Notes - Simplify your life の feed をお好きな feed reader に入れておくだけ。

結構頻繁に更新してる。

Homebrew で Leopard に Subversion を入れる

Leopard 10.5.8 上の Homebrew で Subversion を入れようとしたら、 OpenSSL まわりで失敗した。

最終的に

--- /usr/local/Library/Formula/subversion.rb.orig       2011-05-01 12:39:47.000000000 +0900
+++ /usr/local/Library/Formula/subversion.rb    2011-05-01 12:39:58.000000000 +0900
@@ -69,6 +69,9 @@
   end

   def install
+    ENV.append "LDFLAGS", "-L/usr/local/Cellar/openssl/0.9.8o/lib"
+    ENV.append "CPPFLAGS", "-I/usr/local/Cellar/openssl/0.9.8o/include"
+
     if build_java?
       unless build_universal?
         opoo "A non-Universal Java build was requested."

これで通した。 CPPFLAGS いるのかな。やや適当。

上記が示す通り、先に Homebrew の OpenSSL を入れてある。


なお、以下では解決に至らなかった。

$ export LDFLAGS=-L/usr/local/Cellar/openssl/0.9.8o/lib CPPFLAGS=-I/usr/local/Cellar/openssl/0.9.8o/include
$ brew install subversion
$ brew link openssl
$ brew install subversion

失敗した際のエラーは以下の通り。

/private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libtool --silent --tag=CC --mode=link /usr/bin/cc  -rpath /usr/local/Cellar/subversion/1.6.16/lib -o libserf-0.la buckets/aggregate_buckets.lo buckets/request_buckets.lo context.lo buckets/buckets.lo buckets/simple_buckets.lo buckets/file_buckets.lo buckets/mmap_buckets.lo buckets/socket_buckets.lo buckets/response_buckets.lo buckets/headers_buckets.lo buckets/allocator.lo buckets/dechunk_buckets.lo buckets/deflate_buckets.lo buckets/limit_buckets.lo buckets/ssl_buckets.lo buckets/barrier_buckets.lo buckets/chunk_buckets.lo buckets/bwtp_buckets.lo incoming.lo outgoing.lo auth/auth.lo auth/auth_basic.lo auth/auth_digest.lo auth/auth_kerb.lo auth/auth_kerb_gss.lo /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr-util/libaprutil-1.la     -lexpat -liconv /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libapr-1.la -lpthread -lz -lssl -lcrypto
ranlib: file: .libs/libserf-0.a(auth_kerb.o) has no symbols
ranlib: file: .libs/libserf-0.a(auth_kerb_gss.o) has no symbols
ranlib: file: .libs/libserf-0.a(auth_kerb.o) has no symbols
ranlib: file: .libs/libserf-0.a(auth_kerb_gss.o) has no symbols
/private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libtool --silent --tag=CC --mode=link /usr/bin/cc  -static -o test/serf_get libserf-0.la test/serf_get.lo /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr-util/libaprutil-1.la     -lexpat -liconv /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libapr-1.la -lpthread -lz -lssl -lcrypto
Undefined symbols:
  "_BIO_set_flags", referenced from:
      _bio_bucket_read in libserf-0.a(ssl_buckets.o)
      _bio_file_read in libserf-0.a(ssl_buckets.o)
      _bio_file_gets in libserf-0.a(ssl_buckets.o)
  "_BIO_clear_flags", referenced from:
      _bio_bucket_read in libserf-0.a(ssl_buckets.o)
      _bio_bucket_write in libserf-0.a(ssl_buckets.o)
      _bio_file_read in libserf-0.a(ssl_buckets.o)
      _bio_file_write in libserf-0.a(ssl_buckets.o)
      _bio_file_gets in libserf-0.a(ssl_buckets.o)
  "_SSL_CTX_set_client_cert_cb", referenced from:
      _ssl_init_context in libserf-0.a(ssl_buckets.o)
  "_BIO_test_flags", referenced from:
      _ssl_encrypt in libserf-0.a(ssl_buckets.o)
      _ssl_encrypt in libserf-0.a(ssl_buckets.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [test/serf_get] Error 1
make: *** [external-all] Error 1
make: *** Waiting for unfinished jobs....
Error: #<BuildError: Failed executing: make >
/usr/local/Library/Homebrew/formula.rb:469:in `system'
/usr/local/Library/Formula/subversion.rb:112:in `install'
/usr/local/Library/Homebrew/install.rb:92:in `install'
/usr/local/Library/Homebrew/formula.rb:246:in `brew'
/usr/local/Library/Homebrew/formula.rb:530:in `stage'
/usr/local/Library/Homebrew/formula.rb:489:in `mktemp'
/usr/local/Library/Homebrew/formula.rb:528:in `stage'
/usr/local/Library/Homebrew/formula.rb:241:in `brew'
/usr/local/Library/Homebrew/install.rb:70:in `install'
/usr/local/Library/Homebrew/install.rb:34
/usr/local/Library/Formula/subversion.rb:159
==> Rescuing build...
When you exit this shell Homebrew will attempt to finalise the installation.
If nothing is installed or the shell exits with a non-zero error code,
Homebrew will abort. The installation prefix is:
/usr/local/Cellar/subversion/1.6.16

Snow Leopard は 3.3k JPY しかしないのだし、 Snow Leopard でないと動かないものも多くなってきたので、Lion 入り Mac 待ちなんて嘯いてないで、Snow Leopard を買ってきた方が利口かもしれない。

2010-07-04

Wanderlust on Emacs 24

久し振りに git pull して Emacs 24 を更新したら ssl.el が動かなくなっていた。

以前まで

!! File ssl uses old-style backquotes !!

と表示されつつも使えていたのが、いよいよ phase out した模様。

何とかしないと Wanderlust で Gmail IMAP が読めない。

ssl.el に手を入れても良かったのだけど、 d:id:buzztaiki:20090715:1247619151 の方法が手軽だったので導入することにした。

diff --git a/wl/init.el b/wl/init.el
index 9a22643..c41d5fd 100644
--- a/wl/init.el
+++ b/wl/init.el
@@ -15,12 +15,16 @@
 ;;; [[ Server Setting ]]
 ;; for Gmail.
 
+;; http://d.hatena.ne.jp/buzztaiki/20090715/1247619151
+(require 'tls)
+(set-alist 'elmo-network-stream-type-alist "!opentls" '(opentls nil open-tls-stream))
+
 ;; IMAP settings.
 (setq elmo-imap4-default-server "imap.gmail.com"
       elmo-imap4-default-user user-mail-address
       elmo-imap4-default-authenticate-type 'clear
       elmo-imap4-default-port '993
-      elmo-imap4-default-stream-type 'ssl)
+      elmo-imap4-default-stream-type 'opentls)

さようなら ssl.el & ありがとう id:buzztaiki :)