如何将 webm 视频文件转换为 3gp?

如何将 webm 视频文件转换为 3gp?

有没有办法使用任何 Ubuntu 软件包将 webm 视频文件转换为 3gp。我的文件大小超过 55 mb,因此不支持在线转换?

答案1

这可以用 ffmpeg 来完成

需要了解:
3GP 文件格式将视频流存储为 H.263 或 H.264 编解码器,并允许使用各种音频流格式。

此格式的重要限制是 H.263 视频流的分辨率。由于 3GP 格式是为在 3G 手机上运行而开发的,因此它只能在 128x96、176x144、352x288、704x576 或 1408x1152 像素的尺寸下运行。

本机有效的 3GP 格式

ffmpeg -i inputVideo.avi \
  -f 3gp -vcodec h263 -vf scale=352x288 \
  -acodec amr_nb -ar 8000 -ac 1 \
outputVideo.3gp

-f 3gp : Output file format is 3GP.
-vcodec h263 : Output file will use H.263 codec for video stream.
-acodec amr_nb : Output file will use AMR_NB codec for audio stream.
-vf scale=352x288 : Resize the image to a supported resolution
-acodec amr_nb : Specifies output audio codec
-ar 8000 : Convert audio streams into 8000Hz audio streams. This is required by the AMR_NB encoder.
-ac 1 : Transform audio from stereo into mono. This is also required by the AMR_NB encoder.

复杂吗?
是的,很复杂...幸运的是,3GP 已扩展为支持 H264:不再有图像大小限制,并支持大量音频编解码器。

使用 H.264 视频编解码器和 AAC 音频编解码器

ffmpeg -i inputVideo.avi -f 3gp -vcodec libx264 -acodec aac outputVideo.3gp

-f 3gp : output file will be using 3GP format.
-vcodec libx264 : use libx264 encoder to produce H.264 encoded streams.
-acodec aac : audio stream will be encoded using AAC encoder.

相关内容