Sunday, December 26, 2010

Add Subtitle to an Avi in a Black Rectangle with Mencoder

With the command below it is possible to add a subtitle to a movie which allready had a subtitle  embedded. It is impossible to make readable a second subtitle on it without this command.

Not: This works on Linux OS.

mencoder -oac copy -ovc xvid -xvidencopts fixed_quant=3 -sub-bg-alpha 1 -subpos 90 -subcp cp1254 -sub "Akira.Kurosawa.Seven.Samurai.1.sub" -o "a1.avi" "Akira.Kurosawa.Seven.Samurai.1.avi"

-sub-bg-alpha 1 (Draws a black rectangle, 150 draws semi transparant rect.)
-subpos 90 ( 90 is the bottom, 50 is the middle of the screen)
-subcp cp1254 ( For Turkish encoding )

Monday, June 21, 2010

Sample emms .emacs configuration

You should install mp3info linux package with emms, if you want to see the song title instead of filename with the full path. For Ubuntu it is;
sudo apt-get install emms mp3info

Below configuration prints the song title if exists, else it removes the path info and displays only filename on the mod-line. And also it defines some global keys and auto loads a playlist.

(display-time)
(require 'emms)
(require 'emms-setup)
(emms-default-players)
(emms-standard)
(emms-all)
(require 'emms-player-simple)
(require 'emms-source-file)
(require 'emms-source-playlist)
(setq emms-info-asynchronously nil)
(setq emms-player-list '(emms-player-mpg321
emms-player-ogg123
emms-player-mplayer))

;;(require 'emms-mode-line)
;;(emms-mode-line 1)
(require 'emms-playing-time)
(emms-playing-time 1)

(setq emms-mode-line-mode-line-function
(lambda nil
(let ((track (emms-playlist-current-selected-track)))
(let ((title (emms-track-get track 'info-title)))
(let ((name (emms-track-get track 'name)))
(if (not (null title))
(format emms-mode-line-format title)
(if (not (null (string-match "^url: " (emms-track-simple-description track))))
(format emms-mode-line-format "Internet Radio")
(setq name2 (replace-regexp-in-string ".*\/" "" name))
(format emms-mode-line-format name2))))))))
(emms-mode-line-disable)
(emms-mode-line-enable)
(load "emms")
(global-set-key (kbd "C-c p") 'emms-pause)
(global-set-key (kbd "C-c u") 'emms-volume-raise)
(global-set-key (kbd "C-c d") 'emms-volume-lower)
(global-set-key (kbd "C-c f") 'emms-show)
(global-set-key (kbd "C-c n") 'emms-next)
(global-set-key (kbd "C-c P") 'emms-previous)
(global-set-key (kbd "C-c r") 'emms-random)
(global-set-key (kbd "C-c s") 'emms-stop)
(autoload 'emms "/home/barol/mp3/sample.mp3" t) ;;must be valid path
(emms-add-playlist "/home/barol/sample.playlist")
(emms-shuffle)

Thursday, January 7, 2010

Connect to AIX 6.1 with XDMCP Query

Remote dtlogin is disabled in AIX 6.1. To make dtlogin listen UDP 177 port for remote connections, you have to make following modifications.

1. Comment out this line in the /usr/lib/X11/xdm/xdm-config
DisplayManager.requestPort: 0

2. Comment out these three lines in the /usr/lib/X11/xdm/Xaccess
* #any host can get a login window
* CHOOSER BROADCAST #any indirect host can get a chooser
LISTEN * ff02:0:0:0:0:0:0:12b

3. Comment the "local" line and add
:0 foreign /usr/lpp/X11/defaults/xserverrc -T -force :0

4. Be sure X11.Dt filesets are installed.

5. startsrc -s dtsrc

6. ps -ef|grep dtlogin
netstat -an|grep 177
tail /var/dt/Xerrors

If everything is ok, you can try it with Exceed or from a Linux PC's xterm "X :0 -query IP".

Ignore "A graphics adapter was not found." errors. You can get rid of it by adding "DT_NO_DISPLAY_CHECK=true" to /etc/environment.

dtlogin listens the UDP 177 port, then redirects connection back to the source's 6000 port.