Bonus Round: Adaptive Streaming
What? the act of producing many resolutions (bit rates) and split the media into chunks and serve them via http.
Why? to provide a flexible media that can be watched on a low end smartphone or on a 4K TV, it’s also easy to scale and deploy but it can add latency.
How? creating an adaptive WebM using DASH.
- # video streams
- $ ffmpeg -i bunny_1080p_60fps.mp4 -c:v libvpx-vp9 -s 160x90 -b:v 250k -keyint_min 150 -g 150 -an -f webm -dash 1 video_160x90_250k.webm
- $ ffmpeg -i bunny_1080p_60fps.mp4 -c:v libvpx-vp9 -s 320x180 -b:v 500k -keyint_min 150 -g 150 -an -f webm -dash 1 video_320x180_500k.webm
- $ ffmpeg -i bunny_1080p_60fps.mp4 -c:v libvpx-vp9 -s 640x360 -b:v 750k -keyint_min 150 -g 150 -an -f webm -dash 1 video_640x360_750k.webm
- $ ffmpeg -i bunny_1080p_60fps.mp4 -c:v libvpx-vp9 -s 640x360 -b:v 1000k -keyint_min 150 -g 150 -an -f webm -dash 1 video_640x360_1000k.webm
- $ ffmpeg -i bunny_1080p_60fps.mp4 -c:v libvpx-vp9 -s 1280x720 -b:v 1500k -keyint_min 150 -g 150 -an -f webm -dash 1 video_1280x720_1500k.webm
- # audio streams
- $ ffmpeg -i bunny_1080p_60fps.mp4 -c:a libvorbis -b:a 128k -vn -f webm -dash 1 audio_128k.webm
- # the DASH manifest
- $ ffmpeg \
- -f webm_dash_manifest -i video_160x90_250k.webm \
- -f webm_dash_manifest -i video_320x180_500k.webm \
- -f webm_dash_manifest -i video_640x360_750k.webm \
- -f webm_dash_manifest -i video_640x360_1000k.webm \
- -f webm_dash_manifest -i video_1280x720_500k.webm \
- -f webm_dash_manifest -i audio_128k.webm \
- -c copy -map 0 -map 1 -map 2 -map 3 -map 4 -map 5 \
- -f webm_dash_manifest \
- -adaptation_sets "id=0,streams=0,1,2,3,4 id=1,streams=5" \
- manifest.mpd
PS: I stole this example from the Instructions to playback Adaptive WebM using DASH
当前内容版权归 leandromoreira 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 leandromoreira .