Preview Paper-edit video

Component/part description

Implementations Options considered

BBC Video context "EDL JSON"

BBC Video context previously video compositor.

Preview/ BBC Video compositor

This is the sequence taken in by tge BBC video compositor to be able to render a video preview in canvas. It takes two tracks, but for our porpuses we can just pass one track. Needs adding type “video”, change startTime to start. And add duration instead of endTime.

var playlist = {
[{type:"image", src:"assets/aston.png", start:0, duration:10, id:"aston"}],
[{type:"video", src:"assets/title.mp4", start:0, duration:2, id:"title"},
{type:"video", src:"assets/title.mp4", start:2, duration:8, id:"clip1"}]

Popcorn js

Vanilla js

Two players

Various options see jsfiddle example. Overall popcornjs altho deprecated, was the smoothest one.

Option: PopcornJS preview sequence.

Downside is that it creates canvas(?) and need to re-implement “video” controls for preview as well as progress bar etc.. becomes a very involved component.

It uses Canvas?

JSfiddle: Not working, coz no popcorn js CDN but code is correct.


Option: HTML5 Video

JSfidde: Description: a plain vanilla javascript that makes the most of the HTML5 Video element to play a sequence of video segments continuosly, where src, inp point and out point are specified. Notes: Needs refactoring to remove side effects from methods.

→ Option: HTML5 Video - media fragment

JSFiddle: HTML5 Video Play sequence of video segments using format,4

More on media fragments:

Webm example for nwjs (nwjs does not support mp4)

var videoSequence = [{"src": "
", "inPoint":3.2 , "outPoint":6},
{"src": "
", "inPoint": 1, "outPoint":3},
{"src": "
", "inPoint": 10, "outPoint":15}] 

Issue: flicker white in between videos

Issue sometimes it says src undefined. I think I needs some if counter < videosequence.kength

Improved version : using setTimeout

Version with namespace

→ Version with pause state object to resume from paused point within clip segment Relies on adding vars to window object.

HML5 video API Option: client side ffmpeg video concat

Option: moviemasher

It’s in angular tho

Option: BBC HTML5 Video compositor

EDL Json / playlist:

var playlist = { "tracks":[ 
{type:"image", src:"assets/aston.png", start:0, duration:10, id:"aston"}
{type:"video", src:"assets/title.mp4", start:0, duration:2, id:"title"},
{type:"video", src:"assets/title.mp4", start:2, duration:8, id:"clip1"}

Media source:

    id:"title",             //A unique ID used to identify the created MediaSource
    type:"video",           //A type can be either 'canvas', 'video', or 'image'
    src:"assets/title.mp4", //A URL to load the media from, only works for 'image' and 'video' types.  (See Element vs Source below) 
    start:0,                //The time at which to start playing the created MediaSource 
    sourceStart: 10         //Only applicable to type 'video', the time from within the source file to start playing.
    duration:2              //How long to display the created MediaSource for.

However this is now deprecated in favour of BBC video context.

Option: BBC Video Context

Some more research has been done

To try and add as script tag while figure out how to include in browserify. Add it in nwjs folder and reference from there. With just /

Current implementation

Data structures in view components.

What needs refactoring

Last updated