Home > Web Front-end > HTML Tutorial > ffmpeg settings to convert video to HTML5 mp4 and ogg formats

ffmpeg settings to convert video to HTML5 mp4 and ogg formats

WBOY
Release: 2023-08-30 16:53:02
forward
1160 people have browsed it

ffmpeg settings to convert video to HTML5 mp4 and ogg formats

Use ffmpeg to convert videos to the correct format for HTML5 videos on a Linux shell.

When converting to MP4, you need to use h264 video codec and aac audio codec, because IE11 and earlier only support this combination.

ffmpeg -i input.mov -vcodec h264 -acodecaac -strict -2 output.mp4
Copy after login

In this example, input.mov is converted to output2.mp4, with maximum compatibility, Quicktime support, and no audio streaming.

ffmpeg -an -i input.mov -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 output2.mp4
Copy after login

For Firefox compatible ogg videos, ffmpeg2theora should be installed. The input file here is the output file of the previous ffmpeg conversion.

The following are the commands:

ffmpeg2theora -o video_out_file.ogv output.mp4
Copy after login

The above is the detailed content of ffmpeg settings to convert video to HTML5 mp4 and ogg formats. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template