libsvtav1 编码器适应较好
ffmpeg -i input.mp4 -c:v libsvtav1 -b:v 600k output.mp4
B站1080P 下789kbps 的视频码率 196kpbs音频【音频我觉得96kpbs就够了】
动漫 1080P更低
ffmpeg -i gjj.mp4 -c:v libsvtav1 -crf 42 -b:a 96k 42.mp4
DASH切片
ffmpeg -i 42.mp4 -c:v copy -c:a copy -dash 1 -f dash output.mpd
Dplayer
<div id="dplayer"></div>
<script src="dash.min.js"></script>
DASH必须在Dplayer上面加装
<script src="DPlayer.min.js"></script>
<script>
const dp = new DPlayer({
container: document.getElementById('dplayer'),
video: {
url: 'demo.mpd',
type: 'dash',
},
pluginOptions: {
dash: {
// dash config
},
},
});
console.log(dp.plugins.dash); // Dash 实例
</script>
video: {
url: 'dplayer.mp4',
pic: 'dplayer.png',
thumbnails: 'thumbnails.jpg',
type: 'auto',
}