Showing posts with label HOWTO. Show all posts
Showing posts with label HOWTO. Show all posts

Wednesday, May 27, 2015

How to disable CTRL-ALT-DEL from rebooting a Linux system

The action taken for CTRL-ALT-DEL is defined in /etc/inittab and if we will look in that file we will see a line similar to the one from bellow (taken from a Debian system):
# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
Here is another example: on RedHat based systems this line will look like:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
If we want to disable this action we only have to change this line. We can delete it, comment it, or even replace it with something like:
ca:12345:ctrlaltdel:/bin/echo "CTRL-ALT-DEL is disabled"
After making any changes to the inittab file, you will have to tell init to reload it, in order to activate the changes. To do that, simply run as root:
init q

Thursday, March 6, 2014

How to combine MP4 files on the Debian linux

How to combine MP4 files on the Debian linux

If you are looking to combine MP4 files from the command line here is the easiest solution.  First you need to use the following command to install the program.

sudo apt-get install gpac

Once installed you will be able to run the following command to join the files.

MP4Box -cat mp4_file_part_1.mp4 -cat mp4_file_part_2.mp4 -new joined_file.mp4

You should now be able to combine MP4 files from the command line, and pretty quick at that.

Sunday, July 22, 2012

How-to: Mount a Network drive in Ubuntu

Recently, one of my roommates bought an external network drive, so everyone in the house can upload their music and movies. It’s hooked right into the network through the router so it’s easy for anyone to access– pretty cool stuff. It was pretty simple to setup in Windows, but it took a little bit of research for Ubuntu. Specifically, we have Maxtor “Shared Storage II” hard-drive, and I wanted it to auto-mount each time I reboot my computer. I figured it out using the tutorial here, but the basics are below.
  1. First you will need to install the “smbfs” package. This is what we will use to mount the drive.
    sudo aptitude install smbfs
  2. We will also need a folder to mount the drive in. I used /media/public.
    sudo mkdir /media/public
  3. Then, we need to edit /etc/fstab. This is where we add all the information needed to find and mount the drive. Open /etc/fstab using the command:
    gksudo gedit /etc/fstab
    At the end of the file add the following lines:
    # Mount our network drive
    //SERVER/SHARE /MOUNT-POINT smbfs guest 0 0
    Where “SERVER” is the name of your drive on the network. This can be either a name or IP address. For example, mine was “MAXTOR”. Replace “SHARE” with the folder in the drive you’d like to mount– mine was “Public”. “MOUNT-POINT” is the directory we created earlier, such as “/media/public”. The rest of the parameters have to do with permissions, and also where you can add advanced options. For more information on the advanced preferences, see
    man mount.smbfs
  4. The final step is to tell the system to reload /etc/fstab and mount our drive. Do this with the command:
    sudo mount -a
    Then, you’re done! At this point you should be able to see the files in your drive with the command
    ls /MOUNT-POINT

Wednesday, August 3, 2011

How to Setup Hotmail on iDevice

Microsoft today rolled out Exchange ActiveSync (EAS), which lets users get push notifications on phones and other mobile devices, as part of the Wave 4 release of Windows Live Hotmail. Some users reported EAS working for them two months ago, but only now has Microsoft made it official: e-mail, calendar, and contacts can be pushed automatically to your phone from Hotmail. To enable EAS, use the following settings:

Field Setting
Server/URL m.hotmail.com
Username Full e-mail address (such as: yourname@hotmail.com)
Domain Leave this blank
SSL Enable this
Certificate Accept the SSL certificate when prompted
Mail, Contacts, Calendar, Tasks All can be enabled

Many phones already support ActiveSync for connecting to an Exchange server, but the feature will be particularly useful on phones that support dual ActiveSync accounts, including devices running Microsoft's upcoming Windows Phone 7 OS. Users who don't connect to an Exchange Server, but still have a device with ActiveSync support can also use the new Hotmail feature. Microsoft says over 300 million mobile devices currently support EAS; a full list is available on the Windows Live Solution Center.

Hotmail users have been begging for IMAP and other enhanced syncing capabilities for ages. Microsoft still won't budge on IMAP, but the company did rollout POP3 last year, and now with EAS support this year, it's clear the software giant is finally listening.

Try, Setup Hotmail ActiveSync on iPad device

Microsoft has provided steps for enabling Hotmail ActiveSync on iPad devices.

An iPad supports only a single ActiveSync profile. If your iPad has the existing ActiveSync profile, back up the data and delete it.

1. ON the Home Screen, tap Settings >“Mail, Contacts, Calendar” > “Add Account” > “Microsoft Exchange”
2. Enter the following in fields:

Email: your full Hotmail email address
Domain: Leave blank
Username: your full Hotmail email address
Password: your password
Description: Hotmail

Server: m.hotmail.com

SSL: Enabled
Certificate: Accept the SSL certificate when prompted
Mail, Contacts, Calendar, Tasks: All can be enabled.

3. After finishing the configure, select the data to sync and tap on Save button.

iPad will connect to Hotmail ActiveSync and perform an initial sync for the selected data. You are able to push email, calendar, and contacts with Exchange ActiveSync now. Enjoy it!

Monday, February 16, 2009

Update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Question/Issue:
Your primary Symantec AntiVirus Corporate Edition server cannot automatically download virus definitions using LiveUpdate. Alternately, you want the process of downloading the daily definitions update download by hand.


Solution:
Download the attached *.vdb files.


To download an .vdb file from Symantec

  1. Go to the vdb folder on the Symantec FTP site.
  2. Click the .vdb file with the latest date, and select Save to disk from the dialog box.
  3. If the .vdb file downloads with a .zip extension, remove the .zip extension by renaming the file.
    The file name should be similar to the following:
    vd2ca005.vdb

To copy an .vdb file to a Symantec AntiVirus server
  • Copy the .vdb file to the Symantec AntiVirus program folder.
    • For NetWare servers, the default location is SYS:SAV.
    • For antivirus servers on Windows computers, the default is C:\Program Files\SAV\ for Symantec AntiVirus 8.x, or C:\Program Files\Symantec AntiVirus for Symantec AntiVirus 9.x.
The location of the folder can vary if you upgraded from a previous version.
For help with this, see the "To find the Symantec AntiVirus program folder" section in the Technical Information section of this document.

How to automatically update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

How to automatically update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Question/Issue:
Your primary Symantec AntiVirus Corporate Edition server cannot automatically download virus definitions using LiveUpdate. Alternately, you want to automate the process of downloading the daily definitions update download by using an FTP script.


Solution:
Download and modify the attached Cegetter.bat and Cescript.txt files, and then use the Windows Task Scheduler to schedule them to download daily virus definition updates.


Notes:
  • These files are provided as an example to assist administrators with downloading the virus definitions without using LiveUpdate. Symantec does not provide technical support for these files, so use them at your own risk.

    The location of the files downloaded by these files may change, causing the updates to fail. In this case, you may need to manually edit the files to point to the new location or refer back to this document for updated versions of the attached files.
  • Cescript.txt was last updated on February 8, 2005. If you are using a previous copy of Cescript, replace it with the current file attached to this document. For additional information about recent changes to the file, read the article Cegetter.bat fails to download daily virus definitions after February 8, 2005.



Download the Cegetter.bat and Cescript.txt files.
  • You must modify the Cegetter.bat to copy definitions to the directory where Symantec AntiVirus Corporate Edition is installed on the Primary Symantec AntiVirus Server.
  • Both the Cegetter.bat and Cescript.txt should be stored on the root of the Windows boot drive on the computer where it will be executed. If Windows is installed on a drive other than C:, edit the Cescript.txt file to change the drive letter. See the section below titled "To modify the Cescript.txt file to reflect the proper drive letter."
To modify Cegetter.bat to run from the Primary Server
If you plan to schedule and execute Cegetter.bat on the Primary Server, use the following procedure. If you plan to run Cegetter.bat on a computer that is not the Primary Server, skip to the section "To modify Cegetter.bat to run from a computer that is not the Primary Server."
  1. Right-click the Cegetter.bat file, and click Edit.
  2. Find the following line in the Cegetter.bat file:

    move %systemdrive%\*.xdb
  3. If you are using Windows 2000, XP, or 2003, add the characters /y after the word move. The line should look like the following:

    move /y %systemdrive%\*.xdb

    If you are using Windows NT 4.0, do not add /y.
  4. Replace with the path to the folder in which Symantec AntiVirus Corporate Edition is installed. The default path depends on the version of Symantec AntiVirus:
    • Symantec AntiVirus Corporate Edition 8.x:
      C:\Program Files\SAV
    • Symantec AntiVirus Corporate Edition 9.x:
      C:\Program Files\Symantec AntiVirus

      If long path names are used, then make sure to enclose all path names in quotations, as shown in the Examples section.
  5. Test Cegetter.bat by executing each command, line by line, from a command prompt.
    A DOS window shows the progress of the download.
  6. Schedule Cegetter.bat to get regular definition updates. Cegetter will download the version of Navup8.exe that is released daily.

Examples
The Cegetter.bat file should appear as follows if Symantec AntiVirus Corporate Edition 8.x was installed to the default path:

ftp -s:cescript.txt
call "%systemdrive%\navup8.exe"
move %systemdrive%\*.xdb "C:\Program Files\SAV"
del /q %systemdrive%\navup8.exe


The Cegetter.bat file should appear as follows if Symantec AntiVirus Corporate Edition 9.x was installed to the default path:

ftp -s:cescript.txt
call "%systemdrive%\navup8.exe"
move %systemdrive%\*.xdb "C:\Program Files\Symantec AntiVirus"
del /q %systemdrive%\navup8.exe


To modify Cegetter.bat to run from a computer that is not the Primary Server
  1. Right-click the Cegetter.bat file, and click Edit.
  2. Find the following line in the Cegetter.bat file:

    move %systemdrive%\*.xdb
  3. If you are using Windows 2000, XP, or 2003, add the characters /y after the word move. The line should look like the following:

    move /y %systemdrive%\*.xdb

    If you are using Windows NT 4.0, do not add /y.
  4. Change to the directory where Symantec AntiVirus Corporate Edition is installed on the Primary Server. By default, this directory is shared as VPHOME.

Note: can be a mapped drive to the Primary Server or a UNC path. Symantec recommends using short file names. For example, if the server is mapped as drive x, you could use the following line:

move %systemdrive%\*.xdb x:\VPHOME

You can also specify a UNC path such as the example below, where you replace with the name or IP address of the Primary Server:

move %systemdrive%\*.xdb \\\VPHOME


To copy files into the VPHOME share, change the share permissions to allow access (Full Control) to the account that Cegetter is running under. The default permissions on that share is "Read" for "Everyone."
  1. If you are running Windows 95/98/Me, then remove the "/q" from the following line:

    del /q %systemdrive%\navup8.exe
  2. Test Cegetter.bat by executing each command, line by line, from a command prompt.
    A DOS window shows the progress of the download.
  3. Schedule Cegetter.bat to get regular definition updates. Cegetter will download the version of Navup8.exe that is released daily.

To modify the Cescript.txt file to reflect the correct drive letter
  1. Right-click the Cescript.txt file, and then click Edit.
  2. Find the following line in the Cescript.txt file:

    lcd C:\
  3. Change the C to the drive letter of the drive where Windows is installed.
  4. Save your changes.

Common problems and solutions
  • Incorrect path: Verify that the path to the directory where Symantec AntiVirus Corporate Edition is installed is correct. The file path should use short file names (DOS). If using long file names, enclose the path in quotation marks.
  • Proxy or firewall issues: If you are using a proxy or firewall that blocks FTP communications, Cegetter will not work. You must allow FTP traffic for the FTP session to succeed. If your proxy or firewall requires authentication, be sure to run the scheduled event using a user name and password that will authenticate and allow access.
  • Permissions: Verify that you can copy the .XDB file into the location on the Primary Server under the account that Cegetter is scheduled with.
  • Running under Windows 95/98/Me: A modified Cegetter.bat file is needed to run under Windows 95/98/Me. For additional information, read the document entitled Error: "File not found - C:\temp\*.vdb - 0 file(s) copied" when using Cegetter.bat to update virus definitions.
    Edit Cegetter.bat to contain the following text:

    ftp -s:cescript.txt
    choice /n/t:c,30/c:cc
    "%systemdrive%\navup8.exe"
    choice /n/t:c,30/c:cc
    move %systemdrive%\*.xdb
    del %systemdrive%\navup8.exe

Updating virus definitions for Symantec AntiVirus Corporate Edition 8.x and 9.x

Updating virus definitions for Symantec AntiVirus Corporate Edition 8.x and 9.x

Question/Issue:
This document describes the procedures to update virus definitions for Symantec AntiVirus Corporate Edition.


Solution:


Before you begin:
If you use ymantec AntiVirus Corporate Edition 10.x or Symantec Client Security 3.x, read the document Updating virus definitions for Symantec AntiVirus Corporate Edition 10.x and Symantec Client Security 3.x.


There are four methods for updating virus definitions:
  • The Virus Definition Transport Method (VDTM)
  • LiveUpdate
  • Copying an .xdb file
  • Intelligent Updater

Read the following descriptions, and choose a method or combination of methods that works best for your environment.

The Virus Definitions Transport Method (VDTM)
The VDTM is a fully automated solution for virus definitions distribution, and is enabled by default between servers and their managed clients. With the VDTM, it is only necessary to update one server in order to update all computers in the network. The server gets definitions updates using LiveUpdate or an .xdb file, and then automatically distributes the definitions to each of its clients on the network. Read the document How to use the Virus Definitions Transport Method (VDTM) in Symantec AntiVirus Corporate Edition for an overview and instructions. LiveUpdate
LiveUpdate is a program that connects to a server, downloads the latest definitions, and applies the definitions to the computer on which it is running. You can run LiveUpdate from Symantec System Center, or within Symantec AntiVirus. LiveUpdate can retrieve definitions files either from the Symantec server (which it does by default) or from an internal Web, FTP, or file server created with the LiveUpdate Administration Utility.

To run LiveUpdate on a primary server from the Symantec System Center Console
  1. Right-click the primary server, and then click All Tasks > Symantec AntiVirus > Virus Definition Manager.
  2. Click Configure.
  3. Click Update Now.
    LiveUpdate now runs silently in the background on the primary server. If the VDTM is enabled, it will distribute virus definitions to any secondary servers and clients when LiveUpdate finishes.
To run LiveUpdate on managed clients from the Symantec System Center Console
  1. Right-click a client or client group, and then click All Tasks > Symantec AntiVirus > Virus Definition Manager.
  2. Click Configure.
  3. Click Update Now.
    The affected clients try to obtain virus definitions from the parent server. After this attempt, the managed clients then run LiveUpdate.

To run LiveUpdate from the Symantec AntiVirus Corporate Edition interface
  1. Start Symantec AntiVirus Corporate Edition.
  2. Click LiveUpdate.
  3. Follow the on-screen prompts to download the latest definitions. If the computer is a parent server and the VDTM is enabled, it will distribute virus definitions to any subordinate servers and clients when LiveUpdate finishes.

Schedule LiveUpdate
You can schedule LiveUpdate to run periodically, either from the Virus Definition Manager within Symantec System Center, or by clicking File > Schedule Updates from within Symantec AntiVirus.

The LiveUpdate Administration Utility
On very large or widely distributed networks, it may be desirable to create an internal server and have clients use LiveUpdate to retrieve updates from that server, rather than using the VDTM.
For information on how to determine whether the LiveUpdate Administration Utility is necessary, and for instructions for its implementation, read the document How to configure the LiveUpdate Administration Utility.

Copying an .xdb file
You can update any Symantec AntiVirus server or client by downloading the .xdb file from Symantec. You can also copy an .xdb file from the VPHOME share on any Symantec AntiVirus server. The modified date of the .xdb file matches the date of the virus definitions. When you use this method, Rtvscan.exe checks for new .xdb files and then initiates the update process. Rtvscan.exe checks for new .xdb files approximately every 10 minutes by default. If you do not want to wait, you can manually initiate the update process by stopping and restarting the Symantec AntiVirus Server process.

To download an .xdb file from Symantec
  1. Go to the xdb folder on the Symantec FTP site.
    You can also find the file from the Symantec Security Response Virus Definitions Download Page.
  2. Click the .xdb file with the latest date, and select Save to disk from the dialog box.
  3. If the .xdb file downloads with a .zip extension, remove the .zip extension by renaming the file.
    The file name should be similar to the following:
    vd12bc02.xdb

To copy an .xdb file to a Symantec AntiVirus server
  • Copy the .xdb file to the Symantec AntiVirus program folder.
    • For NetWare servers, the default location is SYS:SAV.
    • For antivirus servers on Windows computers, the default is C:\Program Files\SAV\ for Symantec AntiVirus 8.x, or C:\Program Files\Symantec AntiVirus for Symantec AntiVirus 9.x.
The location of the folder can vary if you upgraded from a previous version.
For help with this, see the "To find the Symantec AntiVirus program folder" section in the Technical Information section of this document.

To copy an .xdb file to a Symantec AntiVirus client
  • Copy the .xdb file to the correct folder, depending on the program version:
    • For clients that run Windows 2003/XP/2000, the default folder is one of the following:
      • C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5\
      • C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5\

        The Application Data folder may be hidden. To show hidden and system folders, read the document How to make Windows show all files.
    • For clients that run Windows 98/Me, the following is the default folder:
      C:\Program Files\Symantec_Client_Security\Symantec AntiVirus\ or C:\Program Files\Symantec AntiVirus\
    • For clients that run Windows NT 4.0, the following is the default folder:
      C:\WinNT\Profiles\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5\

Automatically updating definitions using the .xdb file
Symantec provides a batch file that you can schedule to update the definitions with the latest .xdb file. This batch file automatically downloads and extracts the latest .xdb file from a statically named executable (Navup8.exe), and copies the .xdb file to the appropriate location. For more information, read the document How to automatically update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate.

Intelligent Updater
The Intelligent Updater file is an executable file that you can use to update virus definitions on legacy (Norton AntiVirus Corporate Edition) servers.


WARNING: If you are updating a Symantec AntiVirus server, then you must download the .xdb file from Symantec, as described in the "Copying an .xdb file" section in this document. If you apply the x86.exe or .vdb definition update then you may experience problems updating secondary servers and clients. Read the document Primary server does not update secondary servers or clients using the VDTM for more information.



To download and apply the Intelligent Updater
  1. Go to the Symantec Security Response Virus Definitions Download Page.
  2. Select the appropriate Language and Product (Symantec AntiVirus Corporate Edition), and then click Download Updates.
  3. Download and run the -x86.exe file, where indicates the date and version of the definition file.




Technical Information:
To find the Symantec AntiVirus program folder

  1. On the Windows taskbar, click Start > Run.
  2. In the Open box, type the following text:

    cmd

  3. Click OK.
  4. At the command prompt, type the following:

    net share

  5. Under Share name, find the VPHOME listing.
    The folder that is listed in the Resource column is the Symantec AntiVirus program folder.

Thursday, February 12, 2009

How to update Symantec AntiVirus Corporate Edition definitions without using LiveUpdate

Question/Issue:
Your primary Symantec AntiVirus Corporate Edition server cannot automatically download virus definitions using LiveUpdate.

Solution:
Download navup8.exe and *.xdb files into the location on the Primary Server., and then run navup8.exe to update virus definition. :

The default location on the Primary Server depends on the version of Symantec AntiVirus:
  • Symantec AntiVirus Corporate Edition 8.x:
    C:\Program Files\SAV
  • Symantec AntiVirus Corporate Edition 9.x:
    C:\Program Files\Symantec AntiVirus


Source:
navup8.exe: ftp://ftp.symantec.com/AVDEFS/norton_antivirus/static/navup8.exe
or
ftp://ftp.symantec.com/AVDEFS/norton_antivirus/static/

*.xdb: ftp://ftp.symantec.com/AVDEFS/norton_antivirus/xdb/

Run: Run navup8.exe to update virus definition and then remove navup8.exe. Finish.

I use Symantec AntiVirus Corporate Edition server Version 8, it's ok.

Tuesday, February 10, 2009

Nero 7: don't want to install NeroScout or How to remove it?

You need to put the below code into a .reg file and merge it with the Registry:


Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace \{3D6BE802-FC0D-4595-A304-E611F97089DC}]
@="Nero Scout"


No need to restart, the Nero Scout will be removed imediately.

Put my own maded Logo into System Properties Tab below the Windows Logo in XP and Support Information.

To put my own maded logos on system properties tab.
Like other companies does. (IBM, DELL, SONY etc.)
and also how can i put a button of Support Information on System Tab to put Some cutomized Information.

Create your logo of size 128*128 or less and save it with name "oemlogo.bmp". i.e. it should be with extension bmp only, jpg/gif not allowed..
Then put this bmp image in c:\windows\system32 folder and restart pc. that's it. you have done.. now check out system properties...

Add Logo To Windows Vista System Properties

How could you add a logo or portrait of dream girl to Windows Vista System Properties?

Well, this is just a little Vista trick that involves editing Windows Registry and preparing a BMP file format in a size measured at 120 x 120 pixel.

How to add a logo or portrait to Windows Vista System window?

Adding logo or portrait of dream girl to Windows Vista System window.
  1. Using your favourite image editor to resize or crop the target image (logo or portrait of your dream girl) to 120 x 120 pixels in size and save it as BMP file format.

  2. Copy / move the 120x120 pixels BMP file to System32 directory, e.g.
    move Logo.BMP C:\Windows\System32
    (assuming you've saved the BMP file as Logo.BMP)

  3. Open up Windows Registry (i.e. click the Vista Orb button, type regedit.exe in the Start Search textbox, click the regedit.exe shortcut listed in the Program list)

  4. Browse to this Registry key path:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation
  5. While at the OEMInformation Registry key, right-click on the right-pane, select New then String Value and name it as logo

  6. Double-click the logo Registry and enter the full path of BMP file in System32, i.e. C:\Windows\System32\Logo.BMP
Now, the Windows Vista System window should display the new logo/portrait immediately.


* If you want to add manufacturer information to Windows Vista System window;

  • Browse to Register key path:
     HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation
  • At the OEMInformation Registry key, right-click on the right-pane, select New then String Value and name it as Manufacturer
  • Double-click the Manfacturer Registry and enter the manufacturer information, i.e. IBM, Sony, HP, or yourname.

Monday, November 17, 2008

HOWTO Convert video files

Introduction

There are many good reasons to convert video files you made yourself - or video files forwarded to you which you plan to distribute.

Good reasons to change a video file can be:

  • Playability
  • Size

This howto will to introduce to you some of the basic commands to use the most common Linux command-line program to convert video files from one format to another.

The file-size

Size is important, a videofile reduced by 100 MB will save you 100 GB of bandwidth if 1000 people download it; obviously the reduction of 100 MB pr. file will save you 1 GB of harddrive space if you host 10 video-files on a web-server.

Thus; You will likely want files to be as small as possible without reducing the video quality

Playability

There is no point in sending someone a video file if they can not play it. The most common media formats on the Internet today are divx and xvid.

There is a myth among Windows-users that .wmv (Windows Media Video) is some kind of standard. However, this format is extremely poor and limited to users of that OS.

Basics

Mencoder:

input_filename.mpg
-ovc codec for video output
-oac codec for audio output
-o output_filename.avi


$ mencoder -ovc lavc -oac lavc -o


Transcode:

-i input_filename.mpg

-y codec for audio/video output
-o output_filename.avi


$ transcode -i movie.mpg -o movie.avi -y divx


These are just the basics. There are many more advanced options for choosing codecs, bitrate and so on for both these tools. dad

XviD Encoding

Using MPlayer (mencoder)

You can encode XviD using one or two passes of the original file. You will get better quality if you use two-pass encoding, but does take longer to encode the video.

One-Pass Encoding

You can only set the bitrate or fixed_quant using one-pass encoding. You can only choose bitrate if you do two-pass encoding.

You must set one of these when encoding XviD using mencoder.

By setting bitrate

  • Using bitrate will encode the video to a constant bitrate (CBR).
  • Set bitrate=
  • Higher = better quality with larger files, and
  • lower = less quality with smaller files.
  • A bitrate of 800 will give you near DVD quality when encoding hi-quality video like a DVD disc.
  • VCD quality is around 400-500.
  • Internet streaming quality is generally around 80-150.
  • Mencoder's default bitrate is 687 kbits/s.
  • You need about ~800kb/s to get high quality on a 720x480 sized movie.

Encoding example by setting the bitrate:



$ mencoder -ovc xvid -oac mp3lame -xvidencopts bitrate=687 -o


Setting the audio bitrate

You may also want to change the audio bitrate for the audio encoded using mp3lame when you are making a XviD file with the goal of making a small file using -lameopts abr:br=. For example, an audio bitrate of 92 (-lameopts abr:br=92) will do nicely for a video bitrate of 150.



$ mencoder \
-ovc xvid \
-oac mp3lame \
-lameopts abr:br=92 \
-xvidencopts bitrate=150 \
-o


By bitrate calculated by a fixed file-size

You can set the filesize you want in KiloBytes in order to make mencoder calculate the bitrate for you. This can be done by setting a "negative" bitrate, bitrate=-700000 will give you a movie file which fits nicely on a CD.



$ mencoder -ovc xvid -oac mp3lame -xvidencopts bitrate=-700000 -o


By setting a fixed quality

fixed_quant can also be used when doing one-pass encoding.

  • fixed_quant=<1-31> specifies what "quality level" you want and will make mencoder automatically try to obtain the best quality/size ratio.
  • 1 is the highest quality, and will result in very large file if you use it.
  • 31 is the lowest, and the video will look very poor.
  • 4 and 5 are good setting for high-quality video. 1, 2 and 3 will give you very little improvement compared to 4, but give you way bigger files.(example:1 is 20mb if 4 is 5mb)


$ mencoder -ovc xvid -oac mp3lame -xvidencopts fixed_quant=4 -o


Two-Pass Encoding


$ nice -n 19 mencoder file.wmx -ofps 23.976 -oac mp3lame -lameopts abr:br=92 -ovc xvid -xvidencopts pass=2:bitrate=150 -o audiofix-150bit-xvid.avi



Windows Media files (.wmv/.asf/.wmx)

mencoder can convert wmv files. However, it seems that files created with mencoder from .wmv can not be played in many mediaplayers, namely xine. Adding -ofps 23.976 to the command-line makes files made with mencoder from .wmv play in xine.



$ mencoder infile.wmv -ofps 23.976 -ovc lavc -oac copy -o outfile.avi


xvid from .wmv or .wmx, using two-pass xvid encoding:



$ mencoder file.wmx \
-ofps 23.976 \
-oac mp3lame \
-ovc xvid \
-xvidencopts pass=1 -o /dev/null


$ mencoder file.wmx \
-ofps 23.976 \
-oac mp3lame \
-ovc xvid \
-xvidencopts pass=2:bitrate=250 \
-o 250bit-xvid.avi


The audio track on Windows Media files are sometimes low. You can use midentify to get information about a video file.



midentify file.wmx
ID_AUDIO_BITRATE=64064


With a bitrate of 64k, add -lameopts abr:br=64 when you encode a divx:



$ mencoder file.wmx -ofps 23.976 \
-oac mp3lame \
-ovc xvid \
-xvidencopts pass=1 \
-o /dev/null


$ mencoder file.wmx \
-ofps 23.976 \
-oac mp3lame \
-lameopts abr:br=64 \
-ovc xvid \
-xvidencopts pass=2:bitrate=250 \
-o 250bit-xvid.avi


Storage space is simply wasted if you encode the audio track on the new video file with a higher bitrate than the audio bitrate on the original track.


Convert a video to xVid format:



$ transcode -i movie.mpg -o movie.avi -y xvid


divx

Using transcode

-i ((input file) -o (output) -y (format - xvid/divx)



$ transcode -i movie.mpg -o movie.avi -y divx


Video-CD

Using FFMPEG

ffmpeg can make VCD mpeg video files using -target where the target can be "vcd", "svcd", "dvd", "dv", "pal-vcd", "ntsc-svcd". These switches will set the output format options (bitrate, codecs, buffer sizes) automatically.

The default vcd switch makes a PAL vcd.



$ ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg


A ntsc vcd:



$ ffmpeg -i myfile.avi -hq -target ntsc-vcd /tmp/vcd.mpg


Same example using same quality as source:



$ ffmpeg -i myfile.avi -sameq -target vcd /tmp/vcd.mpg



Converting a file for VCD format using a and b frames for MPEG 2:



$ ffmpeg -i myfile.avi -target ntsc-vcd -bf 2 /home/user/Video/vcd.mpg


Flash video (flv)

ffmpeg is the best choice for making flash video sites (.flv files). The syntax is simple:



ffmpeg -i inputfile.avi flashfile.flv


A parameter you likely want is -ab, audio bitrate. The default is 64, which may be fine for home videos, but is is too poor if you want to promote your local talented singer in a music video. Example:



ffmpeg -i musicvideo.mpg -ab 256 Som_du_visnar2.flv



Also note that .flv files do not support a samlerate of 48000, but it will convert using the original file's rate anyway and fault on exit. Flash video can have a sample rate of 44100, 22050 and 11025. Set the audio sampling frequency with -ar freq (usually -ar 44100) if the original file has something other than the valid rates.

Options you may want to consider:

-ab (number)     # audio bitrate
-ar freq # audio sampling frequency
-b video bitrate # defaults to 200, which is kind of low

You should also be aware of -sameq. This makes the video the same quality as the original, but tends to make flash video files twice the size as original mpeg's. This is bad when it comes to serving files, but it may be worth it if you really want your flash video to have high quality (and you have the bandwidth..).


DVD

Using FFMPEG

ffmpeg can also make DVD video files using -target, where the target can be "vcd", "svcd", "dvd", "dv", "pal-vcd", "ntsc-svcd".



ffmpeg -i myfile.avi -target ntsc-dvd /tmp/dvd.mpg