使用FFMPEG将MP4转换为支持MP4的MP4 [英] Convert mp4 to maximum mobile supported MP4 using FFMPEG

查看:837
本文介绍了使用FFMPEG将MP4转换为支持MP4的MP4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 ffmpeg mp4 转换为low size mp4 ...

I would like to use ffmpeg to convert an mp4 to 'low size' mp4 ...

我需要一个 mp4 文件与 h263 视频和 aac 音频(或低成本手机支持的其他一些设置)。我的主要关注点是视频可在大多数设备上播放

I need an mp4 file with h263 video and aac audio (or some other settings supported by low cost mobile.) My main concern is that the video be playable on most devices.

要实现这一点,可能会有什么可能的 ffmpeg 命令?

What would be some possible ffmpeg commands to accomplish this?

提前感谢

推荐答案

有许多方法可以对mp4视频进行编码,并为移动设备编码更复杂。我不确定你的意思是低成本移动,你的意思是低成本的设备,还是播放视频所需的带宽?

There are numerous ways to encode mp4 videos, and encoding them for mobile devices is even more complex. I'm not sure what you mean by "low cost mobile" do you mean low cost as in the device, or the bandwidth needed to play said video?

,这里有一篇文章让你走: H.264 WEB使用FFMPEG的视频编码指南

Either way, here a post to get you going: H.264 WEB VIDEO ENCODING TUTORIAL WITH FFMPEG

这里有一些 ffmpeg 发布的示例...

Here are some ffmpeg examples from the post ...


标准网络视频(480p,500kbit / s):

"Standard" web video (480p at 500kbit/s):

ffmpeg -i input_file.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k-maxrate 500k -bufsize 1000k - vf scale = -1:480 -threads
0 -acodec libvo_aacenc -b:一个128k output_file.mp4

ffmpeg -i input_file.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k output_file.mp4

360p视频为旧的手机(360p在250kbit / s在基线
配置文件):

360p video for older mobile phones (360p at 250kbit/s in baseline profile):

ffmpeg -i inputfile .avi -vcodec libx264 -vprofile baseline -preset slow -b:v 250k-maxrate 250k -b ufsize 500k -vf scale = -1:360 -threads 0
-acodec libvo_aacenc -ab 96k output.mp4

ffmpeg -i inputfile.avi -vcodec libx264 -vprofile baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k -vf scale=-1:360 -threads 0 -acodec libvo_aacenc -ab 96k output.mp4

480p视频的iPad和平板电脑(480p在400kbit / s在主要配置文件):

480p video for iPads and tablets (480p at 400kbit/s in main profile):

ffmpeg -i inputfile.avi - vcodec libx264 -vprofile main -preset slow -b:v 400k-maxrate 400k -bufsize 800k -vf scale = -1:480 -threads 0 -acodec libvo_aacenc -ab 128k output.mp4

ffmpeg -i inputfile.avi -vcodec libx264 -vprofile main -preset slow -b:v 400k -maxrate 400k -bufsize 800k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -ab 128k output.mp4

用于存档/存储的高质量SD视频(PAL为1Mbit / s,高
配置文件):

High-quality SD video for archive/storage (PAL at 1Mbit/s in high profile):

ffmpeg -i inputfile.avi -vcodec libx264 -vprofile high -preset faster -b:v 1000k -vf scale = -1:576 -threads 0 -acodec libvo_aacenc -ab
196k output.mp4

ffmpeg -i inputfile.avi -vcodec libx264 -vprofile high -preset slower -b:v 1000k -vf scale=-1:576 -threads 0 -acodec libvo_aacenc -ab 196k output.mp4



比特率,比例和配置文件...



从这些示例中,您可能需要注意的一些关键事项是...

Bitrates, scale and profiles ...

From the examples there, some of the key things you might need to pay attention to are ...

-b:v 500k

-b:一个128k

这些是视频的比特率 v 和音频 a 数字越低,质量越低,但也可能在低端设备上玩越好。

Those are bitrates of the video v and audio a, the lower the number the lower the quality but also the better it might 'play' on a low end device.

scale = -1:480

将视频缩小到较小的尺寸,查看有关该视频的更多信息)

That will scale the video down to a smaller size, see more info about that in the post)

-vprofile baseline

这似乎很奇怪 code>(或另一个适当的个人资料参数)在编码某些较低成本(例如Android)设备...

This seemly odd baseline (or another appropriate profile parameter) can be important when encoding for certain lower-cost (e.g. Android) devices ...


基准配置文件(BP)

主要用于需要额外数据丢失的低成本应用程序
稳健性,此配置文件用于某些视频会议和移动
应用程序。此配置文件包括
受约束基线配置文件中支持的所有功能,以及
可用于丢失健壮性的三个附加功能(或用于其他用途,如
低延迟多点视频流合成)。
的这个配置文件的重要性自2009年
约束基线配置文件的定义以来有所退化。所有约束基线配置文件
比特流也被认为是基准配置文件比特流,如
这两个配置文件共享相同的配置文件标识符代码值。

Primarily for low-cost applications that require additional data loss robustness, this profile is used in some videoconferencing and mobile applications. This profile includes all features that are supported in the Constrained Baseline Profile, plus three additional features that can be used for loss robustness (or for other purposes such as low-delay multi-point video stream compositing). The importance of this profile has faded somewhat since the definition of the Constrained Baseline Profile in 2009. All Constrained Baseline Profile bitstreams are also considered to be Baseline Profile bitstreams, as these two profiles share the same profile identifier code value.

这篇关于使用FFMPEG将MP4转换为支持MP4的MP4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆