HTML5 lagging videos MP4

戏子无情 提交于 2019-12-12 07:07:07

问题


I have a problem, When i upload a video to my website And play the video in my HTML5 player(video.js) They are lagging, But it's weird because not all mp4 files are lagging on the site only some videos, But when i download them from my server and play them on my computer it's playing normal.

Why are some video's lagging? Does someone have a explanation for it?


回答1:


If the problem is bandwidth, then depending on format, source bit rate, framesize etc you'll want to re-encode to a more optimal size for your intended purpose

ffmpeg -i "my.mp4" -f mp4 -vcodec mpeg4 -b 512k -r 30 -s 640x360 -acodec libfaac -ar 32000 -ab 128k -ac 2 -threads 8 -movflags faststart "my_reduced.mp4"

-b = video bit rate (lower value = smaller size of the video file... however it reduces the quality of video.

-s = resolution of the video, optimize it to match desired output (but remember to maintain the correct aspect ration)

-movflags = relocates metadata to the start of the file reducing buffering time



来源:https://stackoverflow.com/questions/25977044/html5-lagging-videos-mp4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!