Recently the company in the country double monitoring a video mp4 on-demand, later usability has not been very good, download detailed data analysis under, found that a lot of 5s even if the failure of the situation, asked the two people said is because 5s did not load the first keyframe so failed
Here's the problem:
1. Where is the first keyframe in this 256M mp4 file, which means the user needs to download a video to start playing
2. Knowing the size position of the first keyframe, what kind of network can the user need to load the first keyframe within 5s to count the success
MP4 file is out of the box, how to Know MP4 's first keyframe, and then asked the company's video Daniel, he gave a video parsing tool that can analyze the details of the MP4 to find out the position of the first keyframe
The first keyframe is the pos+size size of the first key_samples of the parsed file, such as:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/BA/wKiom1WD2FjzLaeVAAJPcA0VW-4682.jpg "title=" QQ picture 20150619165212.jpg "alt=" Wkiom1wd2fjzlaevaajpca0vw-4682.jpg "/>
From pos+size add up is 1190986 bytes, that is, Chabudu 1163kb Place, if the user wants 5s load into, need to 1163/5=232kb/s, the net speed is 2mb/s, later analysis CDN Log, found a lot of failure of the user network is not in line with 2mb/ s, inform the customer of the situation, OK
Note:
MP4 Analysis Tool accessories do not let upload, need to contact me
Usage is:./mp4_reader.reader-f h264_800k_mp4.mp4-o mp4info.txt-d SK
Last look at Mp4info.txt, you can see the top.
This article is from "Linux open Source-Continuous summary ..." Blog, be sure to keep this source http://fantefei.blog.51cto.com/2229719/1663658
How to determine where the first keyframe of a MP4 file is located