Month: January 2011

Create Your Own Subtitles For a Video

Introduction

When you are watching movies you must have seen subtitles. Subtitles are necessary to understand conversations. You may have think subtitles are embedded in to the video. But it’s not like that. Subtitles are in a separate text file. You can add, remove or change subtitles just by changing the texts in that file.

Subtitles are usually stored in .srt files. You can open those files using a text editor like Notepad.

Here are the parts of a subtitle.

A subtitle has

  1. A starting time (hours : minutes : seconds , milliseconds)
  2. “ –>” mark
  3. End time
  4. What to display. This part may contain several lines.
  5. A blank line at the end to separate two subtitles.

Creating a new one

Follow the steps to create a sample subtitles.

  1. Open Notepad.
  2. Type followings.
  3. 1
    00:01:32,973 --> 00:01:35,407
    Excuse me, sir, is there a commode?
    
    2
    00:01:44,253 --> 00:01:45,652
    Justin!
    
    3
    00:01:45,733 --> 00:01:48,645
    No, no, no! There he goes.
    
    4
    00:01:57,453 --> 00:01:59,489
    Justin, you get back here right now!
    
    5
    00:01:59,893 --> 00:02:00,882
    No, stop!
    
  4. Now save the text file as movie_name.srt in the same folder that contain movie_name.avi
  5. Now play the movie. The player will automatically recognize subtitles.

Be more creative

Change font face

Put the text you want to change between <font face=”font_name”> and </f>

Change font color

Put the text you want to change between <font color=”font_color”> and </f>

Change font size

Put the text you want to change between <font size=”25”> and </f>

Bold text

Put text between <b> and </b>

Italic text

Put text between <i> and </i>

Underline text

Put text between <u> and </u>

How to play a video in desktop background

Introduction

This feature is something very cool thing about VLC Player. So I thought to share my experience with you.

As I mentioned about you need VLC Player for this.

Steps to Follow

  1. Open VLC Player.
  2. Go to Tools à Preferences
  3. Go to Video section of that window.
  4. Select Output as DirectX (DirectDraw) video output from the drop down list.
  5. Check Enable wallpaper mode.
  6. Finally click Save button.
preferences in VLC
Figure 1

Enjoy watching movies !

Note

You may have an experience in changing Windows color scheme. But the things will be restore after you close the VLC player.

Resource:

  1. http://userend.blogspot.com/2008/08/how-to-play-video-as-desktop-background.html

Writing Shell Script on Linux

Introduction

Shell Scripts are the things in linux which can make our lives easier. If you work with Linux based operating system you must have the experience of using command line interfaces in doing work. For some purposes you may have to repeat a several set of commands with same arguments again and again. At that time you may retype or use arrow keys. But let me explain how you can make your life easier at that time.

The solution is using a Shell Script. It’s a simple text file. You can write the commands what you want to execute again and again. After that once you execute that file It’ll execute those commands. So it saves our time. (This works much similar to Batch files in Windows)

How to do it

Here are the steps to make a Shell Script on Linux (Ubuntu).

1. Goto Applications → Terminal.

2. Type “gedit”. Gedit text editor will open for you. (you can also use “vi” text editor.)

3. Type the text shown below.

#! /bin/bash
clear
echo "HELLO WORLD ..........!!!"
echo
pwd

Writing file
Figure 1

 

4.  Now save it as “first.txt”

5. Go back to Terminal and go to the location(directory) where you saved first.txt (use “cd” command).

6. Then type:

chmod 755 first

7. Type ./first

8. That’s all. You will see the commands you type in the text file is executed by the Terminal one by one.

Further more

Let’ have a closer look at what we have done.



What's there
Figure 2

The first line of the file tells what Shell you are going to use. For this example “bash” is used. (there are number of shells in /bin folder)

“clear” is to clear the screen.

“echo” is use to print HELLO WORLD …………..!!! on the Terminal. (double quotation is not necessary)

Likewise you can type commands you use in the Terminal.

When executing file we must use “chmod 755” once. It’ll give the permission “executable” to the file.

After that you can change that file according to your necessity.

Resources:

  1. How to create a simple shell script on linux: http://www.linfo.org/create_shell_1.html
  2. What is Bash shell: http://computertechnos.blogspot.com/2008/08/what-is-ubuntu-bash-shell.html
  3. More about Bash shell: http://bash.cyberciti.biz/guide/Main_Page