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}
In the existing embedded LINUX system development process, all engineers are tired
Installation instructions 1, this installation package can be deployed on all Linux systems of Alib
In terms of file system, Linux® can be regarded as the Swiss Army Knife in the operating syste
Installing VMware in Linux System Due to the project needs, you need to virtuali
Ultra-simple Centos vpn build method only needs three, quickly build vpn
How to configure vsftpd virtual account
The bridge implementation of the linux protocol stack
How to implement DNS service under Linux
One hard disk installed two Linux methods
Persistent mounting of partitions under Ubuntu
Wrong way to modify linux system file permissions
The whole process of automatically generating Makefile is detailed.
Nginx configuration file nginx.conf Chinese detailed solution
How to cancel the function of win7 window automatically occupying half screen
Retrieving the Metro version of IE10 browser disappeared in Windows 8
Win7 system Sogou browser favorites location description
How to solve the problem of Windows 10 system IE browser without Flash
How to solve Win8.1 Modern IE11 strike/flashback problem
Microsoft's official operating system has been upgraded