User Tools

Site Tools


start

This is my technical blog where I post about various stuffs. Take a look at my resume if you want to know more about me.

HTML5 video

Memo for encoding video in various formats for HTML5.

-vb parameter should be adapted if quality is too low (video bitrate).

mp4

ffmpeg -i video_src.format -vcodec libx264 -preset slow -crf 24 video.mp4

ogv

ffmpeg -i video_src.format -vb 800k -vcodec libtheora -g 30 video.ogv

webm

ffmpeg -i video_src.format -vcodec libvpx -vb 400k -maxrate 8000k -bufsize 1000K -minrate 10k -qmin 3 -qmax 30 -rc_lookahead 16 -keyint_min 0 -g 360 -skip_threshold 0 -level 116 -preset slow video.webm

HTML

<video width="1280" height="720" controls="controls" >
    <source src="video.ogv" type="video/ogg">
    <source src="video.webm" type="video/webm">
    <source src="video.mp4" type="video/mp4">
</video>

Usage in Dokuwiki

Modification of html5video plugin allowing usage of multiple video formats :

{{ videos:vid.webm|videos:vid.ogv|videos:vid.mp4|320x240|loop }}

https://www.dokuwiki.org/plugin:html5video#development

https://github.com/MaximeMorel/dokuwiki_plugin_html5video

Tags

start.txt · Last modified: 2017/05/08 00:43 by popux