How to use video conversion software under Linux operating system

  
                  

Video conversion under Linux: mencoder

Make mpeg4 video for viewing on smartphones and PDAs.

There is a very powerful video and audio conversion software on Linux, which is the mencoder (MPlayer's Movie Encoder) that comes with Mplayer. The mencoder is like a fully manual camera with a lot of options to adjust, but here is just the most common case.

Convert the avi file and embed the subtitles into the video. First assume the following conditions:

File name: video.avi

Subtitle file name: video.srt

Target file: new.avi

Target file format: mpeg4

Target file Video bit rate: 200

Target file Audio bit rate: 64

Target file resolution: 320:240

Fonts needed to create embedded subtitles: simsun.ttf

(The above items can be adjusted according to the actual situation)

The conversion commands are as follows:

mencoder-oac Mp3lame -lameopts vbr=3:br=64 -ovc lavc

-lavcoptsvcodec=mpeg4:mbd=1:vbitrate=200 -sub video.srt -o new.avi

-fontsimsun. Ttf video.avi -subcp cp936 -subfont-text-scale 4

-vfscale=320:240

The meaning of each option:

-oac The audio part of the encoded file . Here is the use of lame to encode audio into mp3, mp3lame. Other available options can be viewed by mancoder's man page.

-lameopts As the name implies, the lame option, you only need to define the code rate.

vbr Set the audio bit rate in the format vbr=

0 cbr average bitrate

1 mt

2 rh constant bitrate Also forces CBR Mode encoding on subsequent ABR presets modes.

3 abr

4 mtrh

is used here, 3, abr.

br is to set the rate value we need, the format is br=, this option can only be used if vbr is 0 and 3.

-ovc The video portion of the encoded file. There are mainly the following options

-ovc copy

Do not encode, just copy the video stream

-ovc divx4

code into DivX4/DivX5 < Br>

-ovc raw

Encode into any uncompressed format (set the specific format with '-vf format')

-ovc lavc

Use Libavcodec encoding

-lavcopts is the option for libavcodec.

vcodec=Use the specified video encoding, the following list of the main values ​​

h264

H.264

h263

H.263

h263p

H.263+

mpeg4

MPEG-4 (DivX 4/5)

msmpeg4

DivX 3

msmpeg4v2

MS MPEG4v2

wmv1

Windows Media Video, version 1 (aka WMV7)

wmv2

Windows Media Video, version 2 (aka WMV8)

rv10

Old RealVideo format

mpeg1video

MPEG-1 video

mpeg2video

MPEG-2 video

mbd The algorithm for determining the video macroblock, which only needs mbd=1. The rest can view the man page.

vbitrate Set the bit rate of the video (default is 800).

-sub Set subtitle file

-o Target video file

-font Path to create fonts for embedded subtitles

-subcp Subtitles Coding, Simplified Chinese is cp936

-subfont-text-scale Size of subtitle font

-vf scale Resolution of video

If you do not need to embed video files in subtitles Just remove the -sub, -font, -subcp, -subfont-text-scale options. The same is true for converting rmvb to mpeg4.

Video conversion under Linux: ffmpeg

Format: ffmpeg [[input file option] - i input file name] {[input file option] output file name}

Copyright © Windows knowledge All Rights Reserved