HTML5 lagging videos MP4

2019-01-27 11: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条回答
姐就是有狂的资本
2楼-- · 2019-01-27 11:32

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

查看更多
登录 后发表回答