Use mencoder to Convert flv to mp4 format that can be played on ipad/iphone

Source: Internet
Author: User

This is because you need to compile a system for collecting video files from a specific website, converting the format, and automatically uploading and publishing video files. This is not a problem with collection, uploading, and publishing. However, the conversion of video formats has plagued a long time, so I will record and share this technology for your reference.

Generally, ffmpeg and mencoder are used for video format conversion. However, according to online materials, ffmpeg has high performance and mencoder has better functions. So come on with mencoder.

String mencoderargs = "-oac faac-faacopts mpeg = 4: object = 2: raw: br = 128-ovc x264-x264encopts global_header: no8x8dct: nocabac: weightp = 0: bframes = 0: level_idc = 30-of lavf-vf scale =-3: 488, harddup ";

String args = string. Format ("{0}-o {1} {2}", FLVFILEPATH, MP4FILEPATH), mencoderargs );
Process p = CreateProcess ("mencoder.exe", args, string. Empty );
P. Start ();
P. BeginOutputReadLine ();
P. StandardInput. WriteLine ("exit"); // enter the exit command
P. WaitForExit ();
P. Close ();
P. Dispose ();

 

The key point is mencoderargs. Many parameters have been found on the Internet, which can be converted to MP4. android can play, but ios iphone and ipad cannot play. Later I found an English document, the specific link is missing. We can say that mp4 in ios has specifications for audio and video. However, if you forget the specifications, you can search for them online and cannot find them, I can refer to this article, but it is not the one I have read before. I mentioned a little bit for your reference:
Http://blog.jharding.org/2008/05/encoding-video-for-iphone-with-mencoder.html

I will not go into the details. The technology will solve the problem.

I will learn new knowledge points in the future, but I still need to summarize them in a timely manner. I have forgotten all the time, so it's better to remember them!

 

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.