MP4 page Playback code, there is no image of the sound solution ~

Source: Internet
Author: User

MP4 page Playback code, there is no image of the sound solution ~ 

About the Web play MP4 format video, find some plug-ins, here recommend Video.js

Official website: http://www.videojs.com/

github:https://github.com/videojs/video.js/

Demo:http://www.videojs.com/downloads/video-js-4.12.5.zip

How to use:

① Introducing files: Assigning a SWF file for flash playback

<link href= "//example.com/path/to/video-js.css" rel= "stylesheet" ><script src= "//example.com/path/to/ Video.js "></script><script>  videojs.options.flash.swf =" http://example.com/path/to/ Video-js.swf "</script>
② Setting the video parameter (setting the MP4 visual address)
<video id= "Example_video_1" class= "Video-js Vjs-default-skin"  controls preload= "Auto" width= "640" height= "264 "  poster=" http://video-js.zencoder.com/oceans-clip.png "  data-setup= ' {" Example_option ": true} ' > < SOURCE src= "Http://video-js.zencoder.com/oceans-clip.mp4" type= ' Video/mp4 '/> <source src= "/http VIDEO-JS.ZENCODER.COM/OCEANS-CLIP.WEBM "type= ' video/webm '/> <source src=" http://video-js.zencoder.com/ OCEANS-CLIP.OGV "type= ' Video/ogg '/> <p class=" Vjs-no-js ">to view this video, enable JavaScript, and Consid Er upgrading to a Web browser that <a href= "http://videojs.com/html5-video-support/" target= "_blank" >supports HTML5 video</a></p></video>

Use the MP4 video source inside the demo, play everything Normal, put on their own MP4 source found only the sound and no image. It makes me very embarrassed.

Want to go to this and plug-in does not matter, and the browser is not related to their own video source format encoding has a relationship.

Find a lot of ways, tried SWF play, but MP4 transcoding into SWF format, distortion is too serious, resulting in a blurry video, poor quality.

Download the format factory, try to convert a lot of formats, are unsatisfactory.

There are three types of video encoding found in MP4: MPEG4 (DivX), MPEG4 (Xvid), AVC (H264), I use a format factory to try one.

The final discovery translates into AVC (H264) encoding, which solves the problem perfectly.

Summary: Web play MP4 video, there is no image problem with sound, first use the Format factory conversion mp4->mp4 format, output encoding select AVC (H264), and then in the Web page code calls to see if the problem is resolved.

MP4 page Playback code, there is no image of the sound solution ~

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.