Merge branch 'master' of ssh://vps.jankratochvil.net/var/lib/git/nethome
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 31 Jul 2013 13:53:17 +0000 (15:53 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 31 Jul 2013 13:53:17 +0000 (15:53 +0200)
.bashrc
bin/avitowebm [new file with mode: 0755]

diff --git a/.bashrc b/.bashrc
index 321bc2e..a63f2ed 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -153,8 +153,11 @@ eval '
        function gdbn { gdb -nx --command=~/.gdbinit "$@"; }
        function hd { od -Ax -tx1; }
        function wget {(unset wget; ( wget --no-check-certificate "$@"; ); );}
+       function ucwkbd { setxkbmap -layout us,cz -variant ,ucw -option grp:caps_switch; }
 '
 
+unset command_not_found_handle
+shopt -u progcomp # Disable 'bash-completion' rpm
 export IGNOREEOF=10
 # '2>/dev/null' to prevent: TMOUT: readonly variable
 [ -n "$SSH_TTY" ] && export TMOUT=900 2>/dev/null
@@ -341,8 +344,6 @@ function gdbcvscheckout { sourcewarecvscheckout gdb; }
 function binutilscvscheckout { sourcewarecvscheckout binutils; }
 function uri_escape   { perl -MURI::Escape -le '$_=<>;chomp;print uri_escape   $_;'; };
 function uri_unescape { perl -MURI::Escape -le '$_=<>;chomp;print uri_unescape $_;'; };
-# It cannot be a function - unset does not work for it.
-alias youtube-dl='youtube-dl --format 38/37/45/22/44/35/34/18/6/5/17/13'
 alias fetchmail='n fetchmail'
 function rpmsrclist
 {
diff --git a/bin/avitowebm b/bin/avitowebm
new file mode 100755 (executable)
index 0000000..e78c697
--- /dev/null
@@ -0,0 +1,35 @@
+#! /bin/bash
+n -p $$
+set -ex
+which mencoder
+which vpxenc
+which ffmpeg
+#w=848 # Nokia 900
+w=640 # FinePix
+h=480
+for avi in $*
+do
+  ext=avi
+  base=`basename $avi .$ext`
+  if [ $base = $avi ]
+  then
+    ext=ogg
+    base=`basename $avi .$ext`
+  fi
+  if [ $base = $avi ]
+  then
+    ext=mp4
+    base=`basename $avi .$ext`
+  fi
+  [ $base != $avi ]
+  test ! -e $base.webm
+  test ! -e $base.video.webm
+  test ! -e $base.yuv
+  test ! -e $base.audio.$ext
+  mencoder $base.$ext -ovc raw -of rawvideo -vf format=i420 -nosound -o $base.yuv
+  vpxenc -t 8 -o $base.video.webm -p 2 --best -w $w -h $h $base.yuv
+  ffmpeg -y -i $base.$ext -acodec copy -vn $base.audio.$ext
+  ffmpeg -y -i $base.video.webm -i $base.audio.$ext -acodec libvorbis -vcodec copy $(: -ab 16k) $base.webm
+  rm -f $base.video.webm $base.yuv $base.audio.$ext
+done
+echo done