LinuxCommandLibrary

mencoder

Encode video and audio files

SYNOPSIS

mencoder [options] [options]

PARAMETERS

-o
    Specifies the output file name.

-oac
    Sets the audio codec to use. Example: mp3lame, pcm.

-ovc
    Sets the video codec to use. Example: x264, mpeg4.

-vf
    Applies video filters. Examples: scale=640:480, crop=100:100:200:200.

-audio-channels
    Sets the number of audio channels.

-ffourcc
    Forces the FourCC of the output video stream.

-fps
    Sets the output framerate.

-bitrate
    Sets the output bitrate.

-profile
    Uses a predefined profile for encoding settings. Requires creating a profile file.

-really-quiet
    Suppresses almost all output.

-nomaudio
    Disable audio.

-novideo
    Disable video.

DESCRIPTION

mencoder is a free command-line video encoder, decoder, and player.
It's a powerful tool primarily used for converting video files between various formats, applying filters for image and audio manipulation, and encoding video for playback on different devices.
MEncoder is part of the MPlayer project and shares its robust decoding capabilities, supporting a wide range of video and audio codecs.
While primarily used from the command line, MEncoder offers fine-grained control over encoding parameters, allowing users to customize video and audio quality, bitrates, framerates, and more.
It supports a vast array of input and output formats, making it suitable for tasks like creating DVD-compliant MPEG files, converting videos for mobile devices, or archiving video content.
However, due to its complex command-line interface, it often requires careful configuration to achieve optimal results.

CAVEATS

MEncoder's command-line syntax can be complex and requires careful attention to detail. Incorrect options can lead to unexpected results or errors. It is generally recommended to consult the MPlayer documentation or online resources for detailed usage examples.

EXAMPLES

Encode a video to Xvid using MP3 audio:
mencoder input.avi -o output.avi -ovc xvid -oac mp3lame

Scale a video to 640x480 and convert it to MPEG4:
mencoder input.avi -o output.avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1200 -vf scale=640:480 -oac copy

HISTORY

MEncoder was developed as part of the MPlayer project, aiming to provide a powerful command-line encoding tool that leveraged MPlayer's decoding capabilities. It gained popularity for its versatility in handling various video formats and its ability to be scripted for batch processing. Over time, its development has slowed down in favor of FFmpeg, which offers a more modern and actively maintained alternative.

SEE ALSO

mplayer(1), ffmpeg(1)

Copied to clipboard