SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Streaming Video In Grails


GVPS (Grails Video Pseudo Streaming
               Plugin)


            Ryan Vanderwerf
             Chief Architect
                ReachForce
         www.reachforce.com
Streaming Video In Grails


                   My Background
Currently building a Grails and Cloud based infrastructure for
ReachForce


Architected a Grails solution for Developerprogram.com that
allows rapid deployment of Developer Program portals for all
kinds of companies, specializing in the mobile industry.
Streaming Video In Grails


                      My Background

Built Java and Linux based webcasting for events such as
SXSW, built telecom software, and ASPs for the financial
sector
Worked with Java since 1996, and built server-side
applications ever since
Enticed into the Groovy and Grails space by speakers at the
early NFJS conferences
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

 Common Need – Light Video Streaming For
 Grails
Options
 Youtube
 Vimeo
 Flickr
 Slideshare
 Screencast
 Animoto
 … and more

 Yes they are great but.....
Streaming Video In Grails

              What About Security?
What if you want your users to be able to upload video
assets into your app?

If they do upload, how are you going to manage all
kinds of video formats and stream them?

How can I handle streaming if users upload all kinds of
different formats?

How do I divide up the load as to not slow down my
server after they upload them?
Streaming Video In Grails

               What About Security?
How do I lock the video streams down to authorized
users?

Are your video assets public or private?

How can I do all of this for little to no license cost?
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

            Video Plugin History


   Abandonware created by Cantina Consulting
made for Grails 1.0 RC1 - 2007
   Fixed up for Grails 1.3.X by KPI Consulting
(Ryan Vanderwerf and Shawn McKisson) – 2011
   – Also fixed streaming, used Tomcat byte
      range support so mp4 streaming will work
Fixed up for Grails 2.x by Ryan – 2012
   Updated to use JWFLV 5.10
Renamed to GVPS plugin and published on
Grails Public Repository
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails




Video Upload Process
Streaming Video In Grails




Video Transformation Process
Streaming Video In Grails




Video Transformation Process
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

Answers to our questions.. yes I want to add video
support into my application
Security: Override either of these actions In
MovieController
   streamflv (Streaming FLV only)
   display (mp4)

   Add your security to your own actions with either
    Spring Security @Secured closure
   Use SpringSecurity or other framework and protect via
    URI
   Feel free to take what you need out of those methods
    or extend them to do any specialty work
Streaming Video In Grails

Security and Usage Continued:

   use VideoService class directly in your own controllers
    (If not using the plugin's tag libraries) that handle
    whatever security you need)

             Use methods streamMp4() or streamflv()
             directly
Streaming Video In Grails

FFmpeg (bundled with libavcodec) – quick overview
Is a complete, cross-platform solution to record,
convert and stream audio and video

Includes libavcodec - the leading audio/video
codec library

FFmpeg is free software licensed under the
LGPL or GPL depending on your choice of
configuration options

Takes care of the hard work of video & audio
transcoding
Streaming Video In Grails

FFmpeg (bundled with libavcodec) – installation

Ubuntu & Debian based Linux
  sudo apt-get install ffmpeg
Redhat/Centos
  su -c yum install ffmpeg

Windows
   Builds available at Zeranoe FFmpeg builds
   http://ffmpeg.zeranoe.com/builds/
Streaming Video In Grails

FFmpeg (bundled with libavcodec) – quick overview
Tool will try to make its best guess to use fewest
parameters possible

     ex. conversionArgs = "-b 600k -r 24 -ar
         22050 -ab 96k"
          “-b 600k” set video bitrate of video to
             600kbps
      “-r 24” set framerate to 24 fps
      “-ar 22050” audio sampling frequency rate
      “-ab 96k” audio bit rate
Streaming Video In Grails

Wait, Isn't ffmpeg dead? I keep hearing this!


  Not quite – apparently the avconv developers tried to
      take over ffmpeg code and domain
  Attempt failed – forked to create avconv
  Either way they are largely compatible with same
      command line args
Streaming Video In Grails

Why Do I Have To Run A Binary, Why No Pure
Java/Groovy?

 Attempts have been made to port ffmpeg to java
       however they are very out of date

 ffmpeg/avconv development is very fast paced and
    hard for a Java based port to keep up
 Not all features are ported from original
 Some options:
        jjmpeg http://code.google.com/p/jjmpeg/
        Jffmpeg http://jffmpeg.sourceforge.net/
Streaming Video In Grails

           Managing Video Formats

Shells and runs ffmpeg to transcode video into
common format
   Users can upload anything you can throw at
     ffmpeg, the most common video transcoding
     engine available (You can plug something else in
     without too much trouble)
   Uses YAMDI to extract metadata from video
   Uses ffprobe to extract mp4 data from footer and
     move to front of file to make streaming work
   Has support out of the box for Flowplayer and Jw-
     Flv
Streaming Video In Grails

                       yamdi
yamdi stands for Yet Another MetaData Injector and is
a metadata injector for FLV files. It adds the
onMetaData event to your FLV files.
Some key features of yamdi are:

H.264 support

onMetaData, onLastSecond, onLastKeyframe events

XML metadata output

More @ http://yamdi.sourceforge.net/
Streaming Video In Grails

                     qtfaststart

Moves metadata (moov atom) in Quicktime movie
from end of file to beginning
   This allows fast forward / rewind
   Allows player to tell how long the movie is to
populate progress bar
Part of ffmpeg as native c code
Java Version here: http://www.wired-
space.de/media/JQTFaststart.java
Python version available
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

                Distribute the load

Uses Quartz plugin to transcode uploads
 Pair with Clustered Quartz or Terracotta to
  distribute the load for large number of
  uploads (or offload to a separate set of
  servers that just process video)
 See my distributed Quartz slides for setting up
  JDBCJobStore with clustering or Terracotta
  setup
Streaming Video In Grails




Uses Quartz plugin to transcode uploads
 Pair with Clustered Quartz or Terracotta to
  distribute the load for large number of
  uploads (or offload to a separate set of
  servers that just process video)
 See my distributed Quartz slides for setting up
  JDBCJobStore with clustering or Terracotta
  setup
Streaming Video In Grails
Streaming Video In Grails

                       What Is Quartz?


Open source Java API Used to schedule, persist, and
distribute jobs

Great Grails support

Great community support and large usage (thousands)
Most common solution for scheduling execution in Java
applications
Streaming Video In Grails

                  Why Cluster Quartz


Distribute Load

Scale easily

Handle many batch jobs at once

Persist scheduled work queue in case of crash

Fail-over
Streaming Video In Grails

        JDBCJobStore Clustering


Most common and least work to configure

Set up JobStore and Delegate

Configure database table prefix

Setup database schema

Works with Grails 'quartz' (Quartz 1.8) or

'quartz2' (Quartz 2) plugin
Streaming Video In Grails

                    Terracotta Clustering

No Database setup required

Currently only works with Quartz 1.8 and 'quartz' plugin

Doesn't work with Quartz2 plugin because it implements a
different class for the JobDetails interface that is not
JobDetailsImpl. Terracotta will throw errors because it
assume JosDetailsImpl class is used. JIRA logged at
https://jira.terracotta.org/jira/browse/QTZ-310 if you'd like to
vote on it
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

                       Taglib setup
Include the player resources:

   JWFlv:
   <vid:includes player="jwflv"/>

   Flowplayer
   <vid:includes player="flowplayer"/>
Streaming Video In Grails

                      JW-FLV Player
http://www.longtailvideo.com/players/jw-flv-player/

Open sourced flash and HTML5 video player, Cross platform
playback

Rich ecosystem of plugins (hundreds!)

3 ways to embed:
   manual javascript
   gvps taglib
   JW player setup wizard at
     http://www.longtailvideo.com/support/jw-player-setup-
     wizard
Streaming Video In Grails

                JW-FLV Player Direct Embed
<script type='text/javascript' src='jwplayer.js'></script>
<div id='mediaspace'>This text will be replaced</div>
<script type='text/javascript'>
 jwplayer('mediaspace').setup({
   'flashplayer': 'player.swf',
   'file': 'http://content.longtailvideo.com/videos/flvplayer.flv',
   'provider': 'http',
   'streamer': 'http://localhost:8080/gvps/movie/display/1',
   'controlbar': 'bottom',
   'width': '470',
   'height': '320'
 });
</script>
Streaming Video In Grails

                       JW-FLV Player


Embed player directly (i.e. content page)

Or use taglib of plugin:
     <vid:display movie='${movie}' player="jwflv"
stream='true'/>
Streaming Video In Grails

         JW-FLV Player Taglib Parameters
                        Movie domain object
movie

id                      Id of movie object

stream                  true/false stream or download

player                  jwflv or flowplayer

height                  Force video to height in pixels
width                   Force video to width in pixels
Streaming Video In Grails
                         Flowplayer
http://flowplayer.org/demos/plugins/streaming/index.html

Or Use taglib of plugin: (currently uses older version of
flowplayer)
      <vid:display movie='${movie}' player="flowplayer"
stream='true'/>

Branded player free for commercial and personal use

Community plugins bundled on Github

HTML5 and RTMP support not added yet (Flowplayer 5)
Streaming Video In Grails
         Flowplayer Taglib Parameters


movie                       Movie domain object


id                          Id of movie object


stream                      true/false stream or download


player                     jwflv or flowplayer
                           Force video to height in pixels
height
width                      Force video to width in pixels
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

                     Plugin Installation
Grails 1.3.x
   grails install-plugin gvps

Grails 2.x
   BuildConfig.groovy
       plugins {
           compile (“:gvps:0.2”)

       }
Streaming Video In Grails

                     Config.groovy
video{
   location="/tmp/" // or shared filesystem drive for a cluster
   yamdi{
      path="/usr/bin/yamdi" // FLV metadata injector (IF
TYPE= FLV)
   }
   ffmpeg {
      fileExtension = "flv" // use flv or mp4
      conversionArgs = "-b 600k -r 24 -ar 22050 -ab 96k"
      path="/usr/bin/ffmpeg"
      makethumb = "-an -ss 00:00:03 -an -r 2 -vframes 1 -y -f
mjpeg"
   }
Streaming Video In Grails
    ffprobe {
        path="/usr/bin/ffprobe" // finds length of movie
        params=""
    }
    flowplayer {
        version = "3.1.2" // use empty string for no
version on file
    }
    swfobject {
        version = "" // used for jw-flv player
    }
    qtfaststart {
        path= “/usr/sbin/qtfaststart” // if type == mp4
rearrage metadata
    }
Streaming Video In Grails


    // these are defaults, taglib params override
    player.height = '260'
    player.width = '320'
}
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

          Demo
Streaming Video In Grails

                   Flowplayer Plugins

http://flowplayer.org/documentation/api/index.html

Flowplayer supports various plugins to give special
effects, enhanced control. They are checked into github
project called 'flowplayer-flash' and are broken up
between flash and javascript plugins.

More info here:
http://code.google.com/p/flowplayer-plugins/
Streaming Video In Grails

                   JW Player Plugins

http://www.longtailvideo.com/addons/

JW Player supports various plug-ins to give special
effects, enhanced control and skins. Many are free for
any use and some restricted to non-commercial without
license. There are hundreds available.

More info here:

http://www.longtailvideo.com/addons/
Streaming Video In Grails
                    What We Will Cover
Reasons for usage
Plugin history
Video processing flows
ffmpeg / yamdi / qtfaststart usage
Distributed video processing
Taglib usage
Plugin Configuration
Code review / Demo
How you can help
Streaming Video In Grails

                     You Can Help
Need to revamp code for taglib to use current
scheme of invoking flowplayer (currently uses old
version style)

RTMP and Flowplayer 5 support
Change how taglibs render player embed tags (use GSP
includes instead of spitting out Javascript)
Enhance Movie domain objects to support AWS S3 store

Enhance Movie domain objects store output file in DB

Could also use RabbitMQ implementation to swap for Quartz
Streaming Video In Grails

               More Information
https://github.com/rvanderwerf/grails-
video
http://terracotta.org/downloads/open-
source/catalog
http://flowplayer.org/
http://www.longtailvideo.com/players/jw-
flv-player/
http://ffmpeg.org/
https://github.com/flowplayer/flash
Streaming Video In Grails

         Contact Me


Via twitter:
https://twitter.com/RyanVanderwerf
Google+/email: rvanderwerf@gmail.com
Blog: http://rvanderwerf.blogspot.com
Streaming Video In Grails

     Copyright Information


Cover pic by Courtney Emery's via
Creative Commons License

Weitere ähnliche Inhalte

Was ist angesagt?

CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineVeaceslav Gaidarji
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservicesLuram Archanjo
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc projectAlexandre Gouaillard
 
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYC
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYCPractical webRTC - from API to Solution - webRTC Summit 2014 @ NYC
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYCAlexandre Gouaillard
 
Real-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTCReal-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTCAlexandre Gouaillard
 
Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013jsievers
 
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise ApplicationsDaniel Oh
 
Test Engineering on Mobage
Test Engineering on MobageTest Engineering on Mobage
Test Engineering on MobageMasaki Nakagawa
 
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsMigrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsTeodor Madan
 
Continuous deployment
Continuous deploymentContinuous deployment
Continuous deploymentDaniel
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Steffen Gebert
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneyWeaveworks
 
How We Build Features
How We Build FeaturesHow We Build Features
How We Build FeaturesAsh Maurya
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineSlawa Giterman
 
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOpsBaruch Sadogursky
 
WebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SF
WebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SFWebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SF
WebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SFAlexandre Gouaillard
 
Succesful testing-continuous-delivery-testnet
Succesful testing-continuous-delivery-testnetSuccesful testing-continuous-delivery-testnet
Succesful testing-continuous-delivery-testnetHarald Rietman
 
2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The Art2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The ArtAlexandre Gouaillard
 

Was ist angesagt? (20)

CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins Pipeline
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservices
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc project
 
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYC
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYCPractical webRTC - from API to Solution - webRTC Summit 2014 @ NYC
Practical webRTC - from API to Solution - webRTC Summit 2014 @ NYC
 
Real-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTCReal-Time Communication Testing Evolution with WebRTC
Real-Time Communication Testing Evolution with WebRTC
 
Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013Tycho Tutorial EclipseCon 2013
Tycho Tutorial EclipseCon 2013
 
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications[RHFSeoul2017]6 Steps to Transform Enterprise Applications
[RHFSeoul2017]6 Steps to Transform Enterprise Applications
 
Test Engineering on Mobage
Test Engineering on MobageTest Engineering on Mobage
Test Engineering on Mobage
 
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsMigrating from PDE to Tycho builds
Migrating from PDE to Tycho builds
 
Continuous deployment
Continuous deploymentContinuous deployment
Continuous deployment
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
 
Ash sxsw
Ash sxswAsh sxsw
Ash sxsw
 
How We Build Features
How We Build FeaturesHow We Build Features
How We Build Features
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
 
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
 
WebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SF
WebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SFWebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SF
WebRTC Infrastructure scalability notes - Geek'n Kranky - June 2014 @ Google SF
 
Succesful testing-continuous-delivery-testnet
Succesful testing-continuous-delivery-testnetSuccesful testing-continuous-delivery-testnet
Succesful testing-continuous-delivery-testnet
 
2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The Art2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The Art
 
Maven 3 / Tycho
Maven 3 / TychoMaven 3 / Tycho
Maven 3 / Tycho
 

Ähnlich wie Streaming in grails

Webrtc plugins for Desktop Browsers
Webrtc plugins for Desktop BrowsersWebrtc plugins for Desktop Browsers
Webrtc plugins for Desktop BrowsersAlexandre Gouaillard
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Diego Zuluaga
 
HTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're goingHTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're goingbrucelawson
 
HTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're goingHTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're goingbrucelawson
 
Scalable Real Time Chat (Text, Audio, Video) - Implemented using XMPP
Scalable Real Time Chat (Text, Audio, Video) - Implemented using XMPPScalable Real Time Chat (Text, Audio, Video) - Implemented using XMPP
Scalable Real Time Chat (Text, Audio, Video) - Implemented using XMPPUdaya Kiran
 
Technology And Life
Technology And LifeTechnology And Life
Technology And LifeSunil Swain
 
Technology And Life
Technology And LifeTechnology And Life
Technology And LifeSunil Swain
 
How to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environmentHow to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environmentMichelantonio Trizio
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthDanno Ferrin
 
Magic with groovy & grails
Magic with groovy & grailsMagic with groovy & grails
Magic with groovy & grailsGeorge Platon
 
Simplifying and accelerating converged media with Open Visual Cloud
Simplifying and accelerating converged media with Open Visual CloudSimplifying and accelerating converged media with Open Visual Cloud
Simplifying and accelerating converged media with Open Visual CloudLiz Warner
 
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudMeet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudLyzun Oleksandr
 
TaraVault Overview Presentation (2021)
TaraVault Overview Presentation (2021)TaraVault Overview Presentation (2021)
TaraVault Overview Presentation (2021)Inflectra
 
JS Days HTML5 Flash and the Battle for Faster Cat Videos
JS Days HTML5 Flash and the Battle for Faster Cat VideosJS Days HTML5 Flash and the Battle for Faster Cat Videos
JS Days HTML5 Flash and the Battle for Faster Cat VideosGreg Schechter
 
From Mediasoup WebRTC to Livekit Self-Hosted .pdf
From Mediasoup WebRTC to  Livekit Self-Hosted .pdfFrom Mediasoup WebRTC to  Livekit Self-Hosted .pdf
From Mediasoup WebRTC to Livekit Self-Hosted .pdfatyenoria
 
Responsive browser-based video recording and playback
Responsive browser-based video recording and playbackResponsive browser-based video recording and playback
Responsive browser-based video recording and playbackOliver Friedmann
 
Griffon: Swing just got fun again
Griffon: Swing just got fun againGriffon: Swing just got fun again
Griffon: Swing just got fun againJames Williams
 
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0Amir Zmora
 
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Rhinofly
 

Ähnlich wie Streaming in grails (20)

Webrtc plugins for Desktop Browsers
Webrtc plugins for Desktop BrowsersWebrtc plugins for Desktop Browsers
Webrtc plugins for Desktop Browsers
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0
 
HTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're goingHTML5 Multimedia: where we are, where we're going
HTML5 Multimedia: where we are, where we're going
 
HTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're goingHTML5 multimedia - where we are, where we're going
HTML5 multimedia - where we are, where we're going
 
Scalable Real Time Chat (Text, Audio, Video) - Implemented using XMPP
Scalable Real Time Chat (Text, Audio, Video) - Implemented using XMPPScalable Real Time Chat (Text, Audio, Video) - Implemented using XMPP
Scalable Real Time Chat (Text, Audio, Video) - Implemented using XMPP
 
Technology And Life
Technology And LifeTechnology And Life
Technology And Life
 
Technology And Life
Technology And LifeTechnology And Life
Technology And Life
 
How to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environmentHow to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environment
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In Depth
 
Magic with groovy & grails
Magic with groovy & grailsMagic with groovy & grails
Magic with groovy & grails
 
Simplifying and accelerating converged media with Open Visual Cloud
Simplifying and accelerating converged media with Open Visual CloudSimplifying and accelerating converged media with Open Visual Cloud
Simplifying and accelerating converged media with Open Visual Cloud
 
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudMeet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento Cloud
 
TaraVault Overview Presentation (2021)
TaraVault Overview Presentation (2021)TaraVault Overview Presentation (2021)
TaraVault Overview Presentation (2021)
 
JS Days HTML5 Flash and the Battle for Faster Cat Videos
JS Days HTML5 Flash and the Battle for Faster Cat VideosJS Days HTML5 Flash and the Battle for Faster Cat Videos
JS Days HTML5 Flash and the Battle for Faster Cat Videos
 
From Mediasoup WebRTC to Livekit Self-Hosted .pdf
From Mediasoup WebRTC to  Livekit Self-Hosted .pdfFrom Mediasoup WebRTC to  Livekit Self-Hosted .pdf
From Mediasoup WebRTC to Livekit Self-Hosted .pdf
 
Responsive browser-based video recording and playback
Responsive browser-based video recording and playbackResponsive browser-based video recording and playback
Responsive browser-based video recording and playback
 
Griffon: Swing just got fun again
Griffon: Swing just got fun againGriffon: Swing just got fun again
Griffon: Swing just got fun again
 
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
WebRTC Standards & Implementation Q&A - Testing WebRTC 1.0
 
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Streaming in grails

  • 1. Streaming Video In Grails GVPS (Grails Video Pseudo Streaming Plugin) Ryan Vanderwerf Chief Architect ReachForce www.reachforce.com
  • 2. Streaming Video In Grails My Background Currently building a Grails and Cloud based infrastructure for ReachForce Architected a Grails solution for Developerprogram.com that allows rapid deployment of Developer Program portals for all kinds of companies, specializing in the mobile industry.
  • 3. Streaming Video In Grails My Background Built Java and Linux based webcasting for events such as SXSW, built telecom software, and ASPs for the financial sector Worked with Java since 1996, and built server-side applications ever since Enticed into the Groovy and Grails space by speakers at the early NFJS conferences
  • 4. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 5. Streaming Video In Grails Common Need – Light Video Streaming For Grails Options Youtube Vimeo Flickr Slideshare Screencast Animoto … and more Yes they are great but.....
  • 6. Streaming Video In Grails What About Security? What if you want your users to be able to upload video assets into your app? If they do upload, how are you going to manage all kinds of video formats and stream them? How can I handle streaming if users upload all kinds of different formats? How do I divide up the load as to not slow down my server after they upload them?
  • 7. Streaming Video In Grails What About Security? How do I lock the video streams down to authorized users? Are your video assets public or private? How can I do all of this for little to no license cost?
  • 8. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 9. Streaming Video In Grails Video Plugin History Abandonware created by Cantina Consulting made for Grails 1.0 RC1 - 2007 Fixed up for Grails 1.3.X by KPI Consulting (Ryan Vanderwerf and Shawn McKisson) – 2011 – Also fixed streaming, used Tomcat byte range support so mp4 streaming will work Fixed up for Grails 2.x by Ryan – 2012 Updated to use JWFLV 5.10 Renamed to GVPS plugin and published on Grails Public Repository
  • 10. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 11. Streaming Video In Grails Video Upload Process
  • 12. Streaming Video In Grails Video Transformation Process
  • 13. Streaming Video In Grails Video Transformation Process
  • 14. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 15. Streaming Video In Grails Answers to our questions.. yes I want to add video support into my application Security: Override either of these actions In MovieController streamflv (Streaming FLV only) display (mp4) Add your security to your own actions with either Spring Security @Secured closure Use SpringSecurity or other framework and protect via URI Feel free to take what you need out of those methods or extend them to do any specialty work
  • 16. Streaming Video In Grails Security and Usage Continued: use VideoService class directly in your own controllers (If not using the plugin's tag libraries) that handle whatever security you need) Use methods streamMp4() or streamflv() directly
  • 17. Streaming Video In Grails FFmpeg (bundled with libavcodec) – quick overview Is a complete, cross-platform solution to record, convert and stream audio and video Includes libavcodec - the leading audio/video codec library FFmpeg is free software licensed under the LGPL or GPL depending on your choice of configuration options Takes care of the hard work of video & audio transcoding
  • 18. Streaming Video In Grails FFmpeg (bundled with libavcodec) – installation Ubuntu & Debian based Linux sudo apt-get install ffmpeg Redhat/Centos su -c yum install ffmpeg Windows Builds available at Zeranoe FFmpeg builds http://ffmpeg.zeranoe.com/builds/
  • 19. Streaming Video In Grails FFmpeg (bundled with libavcodec) – quick overview Tool will try to make its best guess to use fewest parameters possible ex. conversionArgs = "-b 600k -r 24 -ar 22050 -ab 96k" “-b 600k” set video bitrate of video to 600kbps “-r 24” set framerate to 24 fps “-ar 22050” audio sampling frequency rate “-ab 96k” audio bit rate
  • 20. Streaming Video In Grails Wait, Isn't ffmpeg dead? I keep hearing this! Not quite – apparently the avconv developers tried to take over ffmpeg code and domain Attempt failed – forked to create avconv Either way they are largely compatible with same command line args
  • 21. Streaming Video In Grails Why Do I Have To Run A Binary, Why No Pure Java/Groovy? Attempts have been made to port ffmpeg to java however they are very out of date ffmpeg/avconv development is very fast paced and hard for a Java based port to keep up Not all features are ported from original Some options: jjmpeg http://code.google.com/p/jjmpeg/ Jffmpeg http://jffmpeg.sourceforge.net/
  • 22. Streaming Video In Grails Managing Video Formats Shells and runs ffmpeg to transcode video into common format Users can upload anything you can throw at ffmpeg, the most common video transcoding engine available (You can plug something else in without too much trouble) Uses YAMDI to extract metadata from video Uses ffprobe to extract mp4 data from footer and move to front of file to make streaming work Has support out of the box for Flowplayer and Jw- Flv
  • 23. Streaming Video In Grails yamdi yamdi stands for Yet Another MetaData Injector and is a metadata injector for FLV files. It adds the onMetaData event to your FLV files. Some key features of yamdi are: H.264 support onMetaData, onLastSecond, onLastKeyframe events XML metadata output More @ http://yamdi.sourceforge.net/
  • 24. Streaming Video In Grails qtfaststart Moves metadata (moov atom) in Quicktime movie from end of file to beginning This allows fast forward / rewind Allows player to tell how long the movie is to populate progress bar Part of ffmpeg as native c code Java Version here: http://www.wired- space.de/media/JQTFaststart.java Python version available
  • 25. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 26. Streaming Video In Grails Distribute the load Uses Quartz plugin to transcode uploads Pair with Clustered Quartz or Terracotta to distribute the load for large number of uploads (or offload to a separate set of servers that just process video) See my distributed Quartz slides for setting up JDBCJobStore with clustering or Terracotta setup
  • 27. Streaming Video In Grails Uses Quartz plugin to transcode uploads Pair with Clustered Quartz or Terracotta to distribute the load for large number of uploads (or offload to a separate set of servers that just process video) See my distributed Quartz slides for setting up JDBCJobStore with clustering or Terracotta setup
  • 29. Streaming Video In Grails What Is Quartz? Open source Java API Used to schedule, persist, and distribute jobs Great Grails support Great community support and large usage (thousands) Most common solution for scheduling execution in Java applications
  • 30. Streaming Video In Grails Why Cluster Quartz Distribute Load Scale easily Handle many batch jobs at once Persist scheduled work queue in case of crash Fail-over
  • 31. Streaming Video In Grails JDBCJobStore Clustering Most common and least work to configure Set up JobStore and Delegate Configure database table prefix Setup database schema Works with Grails 'quartz' (Quartz 1.8) or 'quartz2' (Quartz 2) plugin
  • 32. Streaming Video In Grails Terracotta Clustering No Database setup required Currently only works with Quartz 1.8 and 'quartz' plugin Doesn't work with Quartz2 plugin because it implements a different class for the JobDetails interface that is not JobDetailsImpl. Terracotta will throw errors because it assume JosDetailsImpl class is used. JIRA logged at https://jira.terracotta.org/jira/browse/QTZ-310 if you'd like to vote on it
  • 33. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 34. Streaming Video In Grails Taglib setup Include the player resources: JWFlv: <vid:includes player="jwflv"/> Flowplayer <vid:includes player="flowplayer"/>
  • 35. Streaming Video In Grails JW-FLV Player http://www.longtailvideo.com/players/jw-flv-player/ Open sourced flash and HTML5 video player, Cross platform playback Rich ecosystem of plugins (hundreds!) 3 ways to embed: manual javascript gvps taglib JW player setup wizard at http://www.longtailvideo.com/support/jw-player-setup- wizard
  • 36. Streaming Video In Grails JW-FLV Player Direct Embed <script type='text/javascript' src='jwplayer.js'></script> <div id='mediaspace'>This text will be replaced</div> <script type='text/javascript'> jwplayer('mediaspace').setup({ 'flashplayer': 'player.swf', 'file': 'http://content.longtailvideo.com/videos/flvplayer.flv', 'provider': 'http', 'streamer': 'http://localhost:8080/gvps/movie/display/1', 'controlbar': 'bottom', 'width': '470', 'height': '320' }); </script>
  • 37. Streaming Video In Grails JW-FLV Player Embed player directly (i.e. content page) Or use taglib of plugin: <vid:display movie='${movie}' player="jwflv" stream='true'/>
  • 38. Streaming Video In Grails JW-FLV Player Taglib Parameters Movie domain object movie id Id of movie object stream true/false stream or download player jwflv or flowplayer height Force video to height in pixels width Force video to width in pixels
  • 39. Streaming Video In Grails Flowplayer http://flowplayer.org/demos/plugins/streaming/index.html Or Use taglib of plugin: (currently uses older version of flowplayer) <vid:display movie='${movie}' player="flowplayer" stream='true'/> Branded player free for commercial and personal use Community plugins bundled on Github HTML5 and RTMP support not added yet (Flowplayer 5)
  • 40. Streaming Video In Grails Flowplayer Taglib Parameters movie Movie domain object id Id of movie object stream true/false stream or download player jwflv or flowplayer Force video to height in pixels height width Force video to width in pixels
  • 41. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 42. Streaming Video In Grails Plugin Installation Grails 1.3.x grails install-plugin gvps Grails 2.x BuildConfig.groovy plugins { compile (“:gvps:0.2”) }
  • 43. Streaming Video In Grails Config.groovy video{ location="/tmp/" // or shared filesystem drive for a cluster yamdi{ path="/usr/bin/yamdi" // FLV metadata injector (IF TYPE= FLV) } ffmpeg { fileExtension = "flv" // use flv or mp4 conversionArgs = "-b 600k -r 24 -ar 22050 -ab 96k" path="/usr/bin/ffmpeg" makethumb = "-an -ss 00:00:03 -an -r 2 -vframes 1 -y -f mjpeg" }
  • 44. Streaming Video In Grails ffprobe { path="/usr/bin/ffprobe" // finds length of movie params="" } flowplayer { version = "3.1.2" // use empty string for no version on file } swfobject { version = "" // used for jw-flv player } qtfaststart { path= “/usr/sbin/qtfaststart” // if type == mp4 rearrage metadata }
  • 45. Streaming Video In Grails // these are defaults, taglib params override player.height = '260' player.width = '320' }
  • 46. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 47. Streaming Video In Grails Demo
  • 48. Streaming Video In Grails Flowplayer Plugins http://flowplayer.org/documentation/api/index.html Flowplayer supports various plugins to give special effects, enhanced control. They are checked into github project called 'flowplayer-flash' and are broken up between flash and javascript plugins. More info here: http://code.google.com/p/flowplayer-plugins/
  • 49. Streaming Video In Grails JW Player Plugins http://www.longtailvideo.com/addons/ JW Player supports various plug-ins to give special effects, enhanced control and skins. Many are free for any use and some restricted to non-commercial without license. There are hundreds available. More info here: http://www.longtailvideo.com/addons/
  • 50. Streaming Video In Grails What We Will Cover Reasons for usage Plugin history Video processing flows ffmpeg / yamdi / qtfaststart usage Distributed video processing Taglib usage Plugin Configuration Code review / Demo How you can help
  • 51. Streaming Video In Grails You Can Help Need to revamp code for taglib to use current scheme of invoking flowplayer (currently uses old version style) RTMP and Flowplayer 5 support Change how taglibs render player embed tags (use GSP includes instead of spitting out Javascript) Enhance Movie domain objects to support AWS S3 store Enhance Movie domain objects store output file in DB Could also use RabbitMQ implementation to swap for Quartz
  • 52. Streaming Video In Grails More Information https://github.com/rvanderwerf/grails- video http://terracotta.org/downloads/open- source/catalog http://flowplayer.org/ http://www.longtailvideo.com/players/jw- flv-player/ http://ffmpeg.org/ https://github.com/flowplayer/flash
  • 53. Streaming Video In Grails Contact Me Via twitter: https://twitter.com/RyanVanderwerf Google+/email: rvanderwerf@gmail.com Blog: http://rvanderwerf.blogspot.com
  • 54. Streaming Video In Grails Copyright Information Cover pic by Courtney Emery's via Creative Commons License