Java video processing mencoder

Source: Internet
Author: User
Navigation of this series of articles

FFmpeg Quick Start in Windows

FFmpeg parameter description

Detailed description of mencoder and ffmpeg parameters (Java video processing)

Java generates video thumbnails (ffmpeg)

Use ffmpeg to convert video files to FLV

Java video processing mencoder

Java video processing ffmped + mencoder

 

Mencoder is a built-in encoding tool for Mplayer (Mplayer is an open-source player in Linux and supports playing in almost all video formats. Currently, it is available in windows and Mac versions ).

Mplayer acquisition and configuration: mplayer Windows Version Download list: http://www5.mplayerhq.hu/mplayer/releases/win32/#/url] the version release date is displayed in the list. You can select the latest version or old version to download, I used the July version. Download the package and decompress it to a folder. Codecs download list: http://www5.mplayerhq.hu/MPlayer/releases/codecs/ select windows-all -********. zip (* indicates the year, month, and day) to download all the files in the folder in the zip package, including *. DLL ,*. ACM ,*. ax and so on are all copied to the codecs folder under the root directory of mplayer. You 'd better add the mplayer.exe‑path, which is also the path of mencoder.exe to the environment variable path. Now you can try playing a video with mplayer. For example, a video is located at D:/music/aperfectmatch. WMV, you can open a cmd window and enter mplayer "D:/music/aperfectmatch. WMV ", feel the player from Linux, you can use the keyboard to manipulate it. Mencoder video format conversion: convert various formats to FLV format (FLV format is the video format supported by flash): mencoder "E:/test. m2p "-o" E:/output. FLV "-Of lavf-lavfopts audio-OAC mp3lame-lameopts ABR: Br = 56-OVC lavc-lavcopts vcodec = FLV: vbitrate = 500: mbd = 2: mv0: trell: v4mv: White: last_pred = 3: Dia = 4: CMP = 6: vb_strategy = 1-VF scale = 512: -3-ofps 12-srate 22050 enter this line of code in the command line (Note: Windows command line does not support line breaks). Press enter to run the command. After a while, you will get. FLV file. Play the file to see how it works (you can play it directly with mplayer ). It is the comparison of the conversion results on my side, the original video on the left, and the converted video on the right:

 
Everyone will think that the quality of the converted file has dropped a lot. This is indeed the case. At the same time, we can find that the converted file has changed from 13 m to 1 M. To improve the quality, you can change vbitrate = 500 to vbitrate = 5000. Comparison of converted results: the original video on the left and the converted video on the right:

 
The quality is almost the same, but at the same time, the conversion file is changed to 6 m. For some parameters in the command, explain:-o "E:/output. FLV ": the output file path;-of lavf: the output file format. Here, FLV is not FLV but lavf because FLV belongs to libavformat;-lavfopts I _certify_that_my_video_stream_does_not_use_frb_ames: -lavfopts indicates some settings for lavf. The setting content is watermark, which is translated into Chinese: I'm sure my video does not use B frames. It is best to add this parameter to convert the FLV format, otherwise, an error may be reported,

-OAC mp3lame: OAC = Output Audio Codec: Output Audio Encoder. The mp3lame is used here.-lameopts ABR: Br = 56: lame options is used to set parameters for mp3lame. ABR: BR = 56, is set the audio bit rate to 56 (bit rate: the audio size output per second, in kb/s); blog Source: http://huqilong.blog.51cto.com/53638/136987

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.