Install and use mp4box

Source: Internet
Author: User

Recently, we have studied transcoding, splitting, and merging of MP4 files. We need to use the mp4box tool. At present, this tool is merged into the gpac open-source project. If you need to download and install it, you need to go to the gpac official website.

First introduce the gpac project, the goal of this project is to achieve a MPEG4 system, become a reference for the implementation of MPEG-4 standards, merge some standards to its framework, etc, currently, code submission is active every day for projects. For more information, visit http://gpac.wp.20.ut-telecom.fr /.

The following describes how to install mp4box. The official website provides the latest daily compilation and installation packages. It supports platforms such as Windows, Linux, andoid, and Mac and can be directly downloaded in binary format. However, its Linux Binary Package is based on Deb and only supports later versions than iketn10.10. Therefore, other Linux systems can only be installed from the source code.

First download the code, you need to use SVN for synchronization: SVN Co https://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac gpac

Go to http://sourceforge.net/projects/gpacto download the dependent third-party library gpac extr libs. The latest version is 0.4.5. decompress the downloaded package and copy the subdirectory to the extra_lib/directory of the gpac source code.

According to the instructions in the official documentation, you only need to execute./configure; Make; make install in the gpac source code directory. However, depending on different platforms, the makefile generated by config may be faulty. In most cases, compilation may cause various problems. At least I did not successfully compile centos5.4 or ubuntu8.04.

Most of the problems encountered are the lack of external dependencies. The most important dependencies are FreeType, freeglut, and zlib. These dependencies Need To Go To The extra_lib directory and be compiled one by one according to the instructions in this document, the compilation of the third-party library is not very smooth. Sometimes, you have to download the yum install and apt-get from the source and complete the dependency on large numbers. The problem is half solved. During gpac compilation, the compiled modules must be removed from./configure and the gpac configuration must be generated as static. The mp4box is generated as non-static. You need to./configure -- Help. After a careful review, gpac generates the final Lib, mp4box, and mp4client. Other applications cannot be compiled. However, if I only need mp4box and mp4client, I don't care about other things. If I don't generate anything, I will forget it.

Mp4client is easy to use. It can play the local MP4 file. There is a problem with remote HTTP playback and it has never been successful.

Mp4box is complex to use and has many functions. It can merge, cut, and extract track and related information from MP4 files, and rewrite the physical format of MP4 files, rewrite each structure of an MP4 file, such as copyright and language. Specific can view: http://gpac.wp.institut-telecom.fr/mp4box/mp4box-documentation/

The following describes some common options:

Mp4box generally does not transcode audio or video.

1 General option mp4box-h General

-TMP dir: Specifies the directory for generating temporary files.
-Inter Duration: media data of Chunk is staggered at specified intervals to optimize stream transmission or file access. All meta data is placed in the file header and can be played back within the downloaded content. The default value is 0.5 s. If the value is 0, all meta data exists in the file header.
-Tight performs sample-based interleaved operations on media tracks (large files are generated ). To reduce the disk search time on the server side, it is used for hint files.
-Flat is forced to use flat storage, and media data is not staggered. Meta data ends with the end of the file. When you use-add to create a new file, no temporary file will be created
-The Frag MS segments a media file, which contains Meta and media data instead of starting or ending a file. The segments are not staggered.
-Isma processes files in the Isma standard format.
-3GP: Remove MPEG4 system information, convert it to 3GP specifications, and retain the information supported by 3GP, such as audio, video, and text orbit.
-Brand ABCD: Set the primary brand
-AB ABCD settings from brand
-Rb ABCD remove from brand
-REM trackID: removes the track from the file.
-Par trackID = par
-Lang [trackID = Lang] indicates the language of the track. If no ID is specified, it indicates all tracks.
-Delay trackID = Time: Specifies the orbital delay time, in microseconds.
-Name trackID = name indicates the processing name of the specified track. The processing NAME is sometimes used to identify the content.
-CPRT string: Add copyright information to the file.
-Chap chap_file: add the chapter information in chap_fil to the target file.

2 file conversion mp4box-H import (for specific supported files, refer to the official website)

The file conversion syntax is as follows: mp4box-add file1-add file2 [-New] DeST. Generally, up to 20 add

(To be continued)

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.