MP4Box常用命令

MP4Box是一款强大的MP4容器操作工具,用于文件转换、合并、切分、流提示等。本文介绍了MP4Box的下载地址、查看帮助的方法,以及包括信息查看、文件转换、文件拆分和合并、媒体轨道提取、场景描述编码等功能的常用命令。例如,使用`mp4box -info test.mp4`检查文件问题,`mp4box -add test.mp4 test-new.mp4`修复格式问题,`mp4box -hint file.mp4`为RTP准备等。
摘要由CSDN通过智能技术生成

首先给大家分享一个巨牛巨牛的人工智能教程,是我无意中发现的。教程不仅零基础,通俗易懂,而且非常风趣幽默,还时不时有内涵段子,像看小说一样,哈哈~我正在学习中,觉得太牛了,所以分享给大家!点这里可以跳转到教程

               

1. 下载地址

     GPAC下载地址:http://gpac.wp.mines-telecom.fr/downloads/

     参考文档:MP4Box使用命令大全

2. 如何查看帮助

    1) mp4box -h

         查看mp4box中的所有帮助信息

    2) mp4box -h general

         查看mp4box中的通用帮助信息

3. 常用命令

    1) mp4box -info test.mp4 
        查看test.mp4文件是否有问题

    2) mp4box   -add    test.mp4   test-new.mp4
        修复test.mp4文件格式不标准的问题,并把新文件保存在test-new.mp4中

    3) mp4box  -inter  10000 test-new.mp4 
        解决开始播放test-new.mp4卡一下的问题,为HTTP下载快速播放有效,10000ms

    4) mp4box -add file.avi new_file.mp4
        把avi文件转换为mp4文件

    5) mp4box -hint file.mp4 
        为RTP准备,此指令将为文件创建RTP提示跟踪信息。这使得经典的流媒体服务器像darwinstreamingserver或QuickTime的流媒体服务器通过RTSP/RTP传输文件

    6) mp4box -cat test1.mp4 -cat test2.mp4 -new test.mp4 
        把test1.mp4和test2.mp4合并到一个新的文件test.mp4中,要求编码参数一致

    7) mp4box -force-cat test1.mp4 -force-cat test2.mp4 -new test.mp4 
        把test1.mp4和test2.mp4强制合并到一个新的文件test.mp4中,有可能不能播放

    8) mp4box -add video1.264 -cat video2.264 -cat video3.264 -add audio1.aac -cat audio2.aac -cat audio3.aac -new muxed.mp4 -fps 24 
        合并多段音视频并保持同步

    9) mp4box -split time_sec test.mp4
        切取test.mp4中的前面time_sec秒的视频文件

    10) mp4box -split-size size test.mp4 
          切取前面大小为size KB的视频文件

    11) mp4box -split-chunk S:E test.mp4 
          切取起始为S少,结束为E秒的视频文件

    12) mp4box -add 1.mp4#video -add 2.mp4#audio -new test.mp4

          test.mp4由1.mp4中的视频与2.mp4中的音频合并生成


4. 英文原文

MP4Box是一个不错的MP4容器操作工具,可以实现MP4文件的合并、切分,还可以对流进行Hint操作,便于流媒体服务器进行Injection和Streaming,MP4Box的原文介绍是:


     MP4Box is a  MP4 multiplexer. It can import MPEG-4 video, DivX, XviD, 3ivx, h264 etc, audio streams and subtitles into the .mp4 container. The end result is a compliant MP4 stream. It can also extract streams from a .mp4. MP4Box is a command line tool, but can be used with graphical user interfaces such as  YAMB

使用指令介绍(来源于MP4Box的官方文档),如果觉得命令行的方式比较难操作,可以使用图形工具“YAMB”,主页: http://www.videohelp.com/tools/YAMB

This document may refer to IsoMedia files. IsoMedia is a generic name for all formats based on the MPEG-4 Part 12 specification: MP4, 3GP and MJ2K files. Support for MJ2K files has not be tested in GPAC yet.

As of version 0.2.4, MP4Box performs in-place rewrite of IsoMedia files (the input file is overwritten). You can change this behaviour by using the -out Filename option.

For older versions, when MP4Box is used to modify an existing IsoMedia file, the original file (for example AFILE.mp4) is NOT overwritten, the resulting file is stored in out_AFILE.mp4. To specify another name for the resulting file, use the -out Filename option.

As of version 0.2.4, MP4Box always stores the file with 0.5 second interleaving and meta-data at the begining, making it suitable for HTTP streaming.

MP4Box usually generates a temporary file when creating a new IsoMedia file. The location of this temporary file is OS-dependent, and it may happen that the drive/partition the temporary file is created on has not enough space or no write access. In such a case, you can specify a temporary file location with the -tmp path_to_dir option.

MP4Box does NOT perform audio/video/image transcoding (re-encoding media tracks to a different coded format). If you need to transcode content, you will need other tools.

As of version 0.2.2, you don't need to follow any specific option ordering at prompt.

Please be aware that this page documents the latest version of MP4Box and may therefore give details on options available only on GPAC CVS. If your version of MP4Box does not support an option please upgrade.

General operations ("MP4Box -h general")

Most of these options are used to specify how to store a given file, either just created/converted or existing.

-tmp dir: specifies where the temporary file(s) used by MP4Box shall be created. This is quite usefull on Windows systems where user may not has the rights to create temporary files. By default, MP4Box uses the OS temporary file handling as provided in C stdio.

-inter Duration : interleaves media data in chunks of desired duration (in seconds). This is usefull to optimize the file for HTTP/FTP streaming or reducing disk access. All meta data are placed first in the file, allowing a player to start playback while downloading the content. By default MP4Box always stores files with half a second interleaving and performs drift checking between tracks while interleaving. Specifying a 0 interleaving time will result in the file being stored without interleaving, with all meta-data placed at beginning of the file.

-tight : performs sample-based interleaving of media tracks (!!the created file is much larger !!). This is normally used when hinting a file, in order to reduce disk seeks at server side (depending on server implementation).

-flat : forces flat storage of the file: media data placed at the begining of the file without interleaving, and meta-data at the end of the file. When used with -add to create a new file, no temporary file is created (faster storage).

-frag time_ms : fragments the file with fragments of given duration. Movie fragmenting allows meta data (timing and co) to be interleaved with media data rather than at the begining or at the end of the file. Frgamenting a file will always disable interleaving.

-out fileName : specifies to store the modified file to a different file, rather than overriding the input file.

-new : forces creation of a new destination file. This is usefull when importing media in batch processes for example. If not set and an existing file with the given name is found, all media import operations will be done on this file. This option is ignored when encoding scenes.

-no-sys : removes all MPEG-4 systems tracks and keeps an empty InitialObjectDescriptor will be left in the file for MPEG-4 Level@Profile indications.

-no-iod : removes the file InitialObjectDescriptor.

-isma: converts file to ISMA 1.0 specification. This is extremely usefull since most MPEG-4 players only understand ISMA-like content. All systems information and tracks numbering are rewritten to comply to the specification. 
WARNING: some media tracks may be removed.

-3gp : converts to 3GPP specification. This will remove all MPEG-4 Systems information, leaving only the audio/video/text media tracks supported by 3GPP. This option is always turned on

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值