Video conversion in Linux

Source: Internet
Author: User

Video conversion in Linux: mencoder


Make mpeg4 videos suitable for watching on smartphones and PDAs.
On Linux, there is a powerful video/audio conversion software, that is, the mencoder (Mplayer's Movie Encoder) that comes with MPlayer ). Mencoder is like a full-manual camera, and there are many options to adjust, but here we just talk about the most common situation.

Convert the avi file and embed Subtitles into the video. 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
Font required for creating embedded Subtitles: simsun. ttf
(The above items can be adjusted according to the actual situation)
The conversion command is as follows:

Mencoder-oac mp3lame-lameopts vbr = 3: br = 64-ovc lavc-lavcopts vcodec = mpeg4: mbd = 1: vbitrate = 200-sub video. srt-o new. avi-font simsun. ttf video. avi-subcp cp936-subfont-text-scale 4-vf scale = 320: 240
Meaning of each option:
-The audio part of the oac-encoded file. Here we use lame to encode the audio into mp3, that is, mp3lame. You can call mencoder's man page to view other available options.
-As the name suggests, lameopts is the lame option. You only need to define the bit rate here.
Vbr: Specifies the audio bit rate in the format of vbr = <0-4>

0 cbr average bitrate
1 mt
2 rh constant bitrate Also forces CBR mode encoding on subsequent ABR presets modes.
3 abr
4 mtrh

Here we use 3, abr.
The required bit rate value is set in the format of br = <0-1024>. This option can only be used when the vbr is 0 and 3.
-The video part of the ovc-encoded file. Mainly has the following options

-Ovc copy
No encoding, just copying video streams
-Ovc divx4
Encoded as DivX4/DivX5
-Ovc raw
Encode it into any uncompressed format (use '-vf format' to set the specific format)
-Ovc lavc
Use libavcodec for encoding

-Lavcopts is the libavcodec option.
Vcodec = use the specified video encoding. The following lists the main values.

H264
H.264
H263
H.263
H263p
H.263 +
Mpeg4
MPEG-4 (DivX 4/5)
Msmpeg4
DivX 3
Msmpeg4v2
MPEG4v2 MS
Wmv1
Windows Media Video, version 1 (also known as WMV7)
Wmv2
Windows Media Video, version 2 (also known as WMV8)
Rv10
Old RealVideo format
Mpeg1video
MPEG-1 video
Mpeg2video
MPEG-2 video

Mbd determines the algorithm of the video macro block. Here we only need mbd = 1. The rest can be viewed on man page.
Vbitrate specifies the video bit rate (800 by default ).
-Sub: Set the subtitle file
-O target video file
-Font: Path of the font needed to create embedded subtitles
-Subcp subtitle encoding. The simplified Chinese is cp936.
-Subfont-text-scale subtitle font size
-Vf scale video resolution
If you do not need to embed Subtitles into a video file, you only need to remove the options-sub,-font,-subcp, and-subfont-text-scale. This is also true for converting rmvb to mpeg4.

 

 

Video conversion in Linux: ffmpeg


Format: ffmpeg [[input file options]-I input file name] {[input file options] output file name}
Main options:
-L copyright description of ffmpeg
-H Show Help
-Version: display version
-Formats: displays supported file formats, encoding, and protocols.
-F format name: Forced format
-The img file format name is forced to use the slice format.
-I. Name of the file to be converted
-Y overwrites the output file with the same name
-T time: Specifies the video length.
-Fs maximum size: sets the maximum size of the file.
-Ss time point: set the time point for conversion.
-Title text set title
-Author text setting author
-Copyright text setting copyright notice
-Comment text setting remarks

Video options:
-B bit rate: sets the file bit rate (unit: kbit/s)
-R speed limit speed (Hz value)
-S size, width, and height
-Newvideo adds a video stream to the current video stream.

Audio options:
-The aframes number specifies the number of frames to be converted.
-AB bitrate: sets the bit rate of Music (unit: kbit/s)
-AQ quality: Specifies the audio quality (encoding)
-Ar sampling rate set audio sampling rate (unit: Hz)
-Set the number of audio channels for the AC channel number.
-An cancel audio
-Acodec encoding: Forced Audio Encoding ('copy' to copy Stream)
-Vol volume: changes the volume (256 is normal)
-Newaudio append music


Open source resources:
Software Download http://software.lupaworld.com
Open source image http://mirror.lupaworld.com
Manual center http://man.lupaworld.com
You are welcome to visit and provide suggestions and comments.

 

 

From: http://blog.lupaworld.com/blog/htm/uid_980.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.