mcopy/app/lib/capture/index.js

42 lines
718 B
JavaScript
Raw Normal View History

'use strict';
capture-report library for creating a telecine method The purpose of this module will be to generate a report of the projector actions that can be translated into rendering instructions for a telecine. First tests will be done on a Blackmagic Pocket Cinema camera which will record a 4000 frame sequence (100ft of 16mm). The report will allow me to record the entire sequence of the projector advancing 4000 frames and will make a list of acceptable frames to pull out for stitching together into a sequence. It is amazingly inefficient in terms of disk space, but will make this setup much cheaper than one that requires purchasing hardware to capture images to disk during operation. Rubber ducking: The report will watch for projector start and end times in milliseconds, with a “start” value to be factored in later. On every projector start and end event, when capture is active, an event with the millisecond of the occurrence is logged to the report. At the end of the sequence, the report will be parsed to determine the acceptable frames to export into a new sequence. This will be determined by finding a period between proj_end and proj_start events and dividing that into frames and picking the central most frame. Acceptable frames, marked by frame numbers, get put into an render list that gets pegged to a first frame and adjusted via offset. The export list will be fed into a command that will go through either a video file or an image sequence and output the determined frames into an image sequence that will be stitched together with ffmpeg/libav.
2016-06-19 00:49:39 +00:00
const req = require('request');
capture-report library for creating a telecine method The purpose of this module will be to generate a report of the projector actions that can be translated into rendering instructions for a telecine. First tests will be done on a Blackmagic Pocket Cinema camera which will record a 4000 frame sequence (100ft of 16mm). The report will allow me to record the entire sequence of the projector advancing 4000 frames and will make a list of acceptable frames to pull out for stitching together into a sequence. It is amazingly inefficient in terms of disk space, but will make this setup much cheaper than one that requires purchasing hardware to capture images to disk during operation. Rubber ducking: The report will watch for projector start and end times in milliseconds, with a “start” value to be factored in later. On every projector start and end event, when capture is active, an event with the millisecond of the occurrence is logged to the report. At the end of the sequence, the report will be parsed to determine the acceptable frames to export into a new sequence. This will be determined by finding a period between proj_end and proj_start events and dividing that into frames and picking the central most frame. Acceptable frames, marked by frame numbers, get put into an render list that gets pegged to a first frame and adjusted via offset. The export list will be fed into a command that will go through either a video file or an image sequence and output the determined frames into an image sequence that will be stitched together with ffmpeg/libav.
2016-06-19 00:49:39 +00:00
const SerialPort = require('serialport');
const Readline = SerialPort.parsers.Readline;
const parser = new Readline('');
const newlineRe = new RegExp('\n', 'g');
const returnRe = new RegExp('\r', 'g');
capture-report library for creating a telecine method The purpose of this module will be to generate a report of the projector actions that can be translated into rendering instructions for a telecine. First tests will be done on a Blackmagic Pocket Cinema camera which will record a 4000 frame sequence (100ft of 16mm). The report will allow me to record the entire sequence of the projector advancing 4000 frames and will make a list of acceptable frames to pull out for stitching together into a sequence. It is amazingly inefficient in terms of disk space, but will make this setup much cheaper than one that requires purchasing hardware to capture images to disk during operation. Rubber ducking: The report will watch for projector start and end times in milliseconds, with a “start” value to be factored in later. On every projector start and end event, when capture is active, an event with the millisecond of the occurrence is logged to the report. At the end of the sequence, the report will be parsed to determine the acceptable frames to export into a new sequence. This will be determined by finding a period between proj_end and proj_start events and dividing that into frames and picking the central most frame. Acceptable frames, marked by frame numbers, get put into an render list that gets pegged to a first frame and adjusted via offset. The export list will be fed into a command that will go through either a video file or an image sequence and output the determined frames into an image sequence that will be stitched together with ffmpeg/libav.
2016-06-19 00:49:39 +00:00
const { exec } = require('exec');
const { delay } = require('delay');
let system = {};
let INTVAL;
async function capture_intval () {
let framePath = `${INTVAL}/frame`;
let res;
try{
res = await req(framePath);
} catch (err) {
return exit('Error triggering frame', 8);
}
if (res) {
console.log(res);
}
return true;
}
async function capture_serial () {
}
async function capture () {
}
module.exports = (sys) => {
system = sys;
return capture;
}