Solution to the problem that the video label in html5 cannot play mp4, html5mp4

Source: Internet
Author: User

Solution to the problem that the video label in html5 cannot play mp4, html5mp4

Preface

I found a question at the very beginning. I recorded a 1.mp4 file on my mobile phone, and all the mainstream browsers can play normally. However, you cannot use the format scheme to convert the rmvbfile to 2.mp4. After finding the relevant information, I finally solved the problem. I will share it for your reference and study. Here I will take a look at the detailed introduction:

Problem Analysis

Video attributes recorded by mobile phone:


 

Format the video attributes of factory transcoding:


 

First, eliminate issues such as code, path, and browser support. After transcoding, the video encoding is mp4v. This is the reason why it cannot be played. convert it to AVC (H264) encoding.

Refer to the documentation for the video formats and codes supported by video tags:

  • MPEG4 = MPEG4 file with H.264 video encoding and AAC audio encoding
  • WebM = A WebM file with VP8 video encoding and Vorbis Audio Encoding
  • Ogg = Ogg file with Theora video encoding and Vorbis Audio Encoding

Through the above information we found only h264 encoded MP4 video (MPEG-LA Company), VP8 encoded webm format video (Google) and Theora encoded ogg format video (iTouch Development) supports html5 <video> labels.

Solution

The video tag allows multiple source elements. The source element can be connected to different video files. The browser uses the first recognizable format to solve browser compatibility problems.

<video controls="controls" width="100%">  <source src="1.mp4" type="video/mp4">  <source src="1.ogg" type="video/ogg">Your browser does not support the video tag.</video>

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

Related Article

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.