VideoExt aka Video

Ok, today I published the version 1.0 of the video plugin in my GitHub repository.

GitHub: https://github.com/fanningert/kirbycms-extension-video

Changes:

  • New default tag videoext, but you can reactivate the old video tag with the config parameter kirby.extension.videoext.video_tag.
  • Moved the complete logic in a class, for easier reuse on templates and other plugins.
  • The class support the media and the type attribute of the <source> HTML tag.

Future:

NOTE:

When you have ideas for a new feature, please open a new issue on the GitHub page of this plugin.

4 Likes

Release v1.2 is on GitHub available.

2 Likes

I am just wondering, where do I have to set autoplay to be ‘true’?
Is there an option to set it for each video individually or is it a global option?

Hi,
you have two options.

First you can set the config parameter in the config.php file of kirby. But this is then the default value for all videos.
Example:

c::set('kirby.extension.videoext.autoplay', true);

The second variant is the more flexible method. Set the value at the kirbytag.
Example:

(video: mp4: video.mp4 autoplay: true)

Here can you found some other examples.
https://www.fanninger.at/thomas/works/kirbycms-extension-video

EDIT::
Ok, I found there is a bug with this parameter. I created a issue for this problem.

Installed with Kirby 2.1 and crashed Kirby immediately. Deleting the videoext folder from the plugins folder brought Kirby back-to-life. Just FYI, get a serious certificate warning when I go to your website and not all sample videos loaded, at least for me.

@russlipton My website run with a certificate from cacert.org. Windows machines don’t know the root certificate and so every windows machine get a certificate error. But the test videos are working by me on a windows machine.

I don’t upgraded my installation to 2.1. I will test it on the weekend and release a new version.
In the mean time I create a issue on GitHub (https://github.com/fanningert/kirbycms-extension-video/issues/5). When you have any infos to this problem, can you please post it on the issue page.

Regards
Thomas

No worries: I am thankful that you contributed this to the community. Just for completeness, received the certificate warning on OS/X. I look forward to the updated plugin!

@russlipton
I made a fresh installation of Kirby with no other plugins (only webhelper and videoext) and I get now error or other problem. It is working out of the box.

Can you say me what other plugins are you installed, or did you any changes on kirby?

@fanningert:

Thank you for this great plugin.

As I develop on Windows, I have rewritten and expanded the script, I named this script “do_ffmpeg.bat”:


@ECHO OFF
ECHO "%~nx0" "%~1"
REM
REM # Windows-/DOS-Script
REM
REM This script ("do_ffmpeg.bat") takes any (high resolution) video file as input and converts it to MP4 (H264 & AAC), WebM (VP8 & Vorbis) and OGV (theora & vorbis) for HTML5 <video>. For each format, it creates a high quality ('.hq') and a low quality ('.lq') version.
REM
REM ffmpeg has to be installed, see http://ffmpeg.zeranoe.com/builds/ for downloads.
REM 
REM Usage: do_ffmpeg.bat <inputfile>
REM
REM Tip:   Drag the video file (inputfile) in the windows explorer and drop it on the icon of this script or the icon of a link to this script.
REM
REM This is heavily inspired by
REM - https://github.com/kornl/video-conversion/blob/master/convert_video_for_html_5.sh
REM - https://github.com/mickro/video2html5/blob/master/video2html5.sh
REM - http://diveintohtml5.info/video.html#webm-cli
REM
SET infile="%~1"
SET outfile=%~dpn1
SET filename=%~n1
REM ------------------------------------------------------
REM Start of your configuration area
REM
REM path to the utility ffmpeg.exe (surrounded by " . With or without drive like "C:". Without drive [e.g. 
for an USB-drive], if this script and the utility ffmpeg.exe are on the same drive):
SET prog="C:\path\to\the\ffmpeg.exe"
REM
REM add all options you like or need:
SET progoptions=-hide_banner
REM
REM End of your configuration area
REM ------------------------------------------------------
ECHO.
ECHO %%1       ='%1'
ECHO infile   =%infile%
ECHO outfile  ='%outfile%'
ECHO filename ='%filename%'
ECHO.
ECHO ffmpeg         =%prog%
ECHO ffmpeg-options ='%progoptions%'
ECHO.
ECHO.
IF /I "%1t" == "t" GOTO novideofile
IF /I NOT EXIST %prog% GOTO noprogfile
rem PAUSE
GOTO start
:novideofile
ECHO ERROR!
ECHO.
ECHO NO video file was passed as first parameter!
ECHO.
PAUSE
GOTO finish
:noprogfile
ECHO ERROR!
ECHO.
ECHO The file %prog% was not found (wrong path?)!
ECHO.
PAUSE
GOTO finish
:start
ECHO low quality MP4 (%filename%.lq.mp4)
START "ffmpeg lq.mp4" /WAIT %prog% -i %infile% -acodec aac -vcodec libx264 -vb 2000k -vf scale=iw/2:ih/2 -f mp4 %progoptions% -y "%outfile%.lq.mp4"
ECHO high quality MP4 (%filename%.hq.mp4)
START "ffmpeg hq.mp4" /WAIT %prog% -i %infile% -acodec aac -vcodec libx264 -vb 8000k -f mp4 %progoptions% -y "%outfile%.hq.mp4"
ECHO.
ECHO low quality WebM (%filename%.lq.webm)
START "ffmpeg lq.webm" /WAIT %prog% -i %infile% -acodec libvorbis -vcodec libvpx -vb 2000k -vf scale=iw/2:ih/2 -f webm %progoptions% -y "%outfile%.lq.webm"
ECHO high quality WebM (%filename%.hq.webm)
START "ffmpeg hq.webm" /WAIT %prog% -i %infile% -acodec libvorbis -vcodec libvpx -vb 8000k -f webm %progoptions% -y "%outfile%.hq.webm"
ECHO.
ECHO low quality OGV (%filename%.lq.ogv)
START "ffmpeg lq.ogv" /WAIT %prog% -i %infile% -acodec libvorbis -vcodec libtheora -vb 2000k -vf scale=iw/2:ih/2 %progoptions% -y "%outfile%.lq.ogv"
ECHO high quality OGV (%filename%.hq.ogv)
START "ffmpeg hq.ogv" /WAIT %prog% -i %infile% -acodec libvorbis -vcodec libtheora -vb 8000k %progoptions% -y "%outfile%.hq.ogv"
ECHO.
ECHO a single image (for "poster: %filename%.jpg")
START "ffmpeg image" /WAIT %prog% -ss 0.5 -i %infile% -vframes 1 -q:v 2 %progoptions% -y "%outfile%.jpg"
ECHO.
:ready
ECHO.
ECHO READY!
ECHO.
ECHO The seven new files wait at "%~dp1%"
ECHO.
PAUSE
:finish
EXIT



Good luck!

[Edited:]
The script has been revised (more robust against spaces in the paths and more informative).

1 Like