Allow for longer videos by using longer padded numbers for sequences

This commit is contained in:
sixteenmillimeter 2020-02-21 01:58:56 -05:00
parent 549cd3cc04
commit 32fe873707
10 changed files with 20 additions and 20 deletions

View File

@ -11,7 +11,7 @@ const { BrowserWindow } = require('electron');
function padded_frame(i) { function padded_frame(i) {
let len = (i + '').length; let len = (i + '').length;
let str = i + ''; let str = i + '';
for (let x = 0; x < 5 - len; x++) { for (let x = 0; x < 8 - len; x++) {
str = '0' + str; str = '0' + str;
} }
return str; return str;

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ class FFMPEG {
padded_frame(i) { padded_frame(i) {
let len = (i + '').length; let len = (i + '').length;
let str = i + ''; let str = i + '';
for (let x = 0; x < 5 - len; x++) { for (let x = 0; x < 8 - len; x++) {
str = '0' + str; str = '0' + str;
} }
return str; return str;
@ -118,7 +118,7 @@ class FFMPEG {
//if (system.platform !== 'nix') { //if (system.platform !== 'nix') {
ext = 'png'; ext = 'png';
//} //}
tmpoutput = path_1.join(tmppath, `export-%05d.${ext}`); tmpoutput = path_1.join(tmppath, `export-%08d.${ext}`);
try { try {
await fs_extra_1.mkdir(tmppath); await fs_extra_1.mkdir(tmppath);
} }
@ -163,7 +163,7 @@ class FFMPEG {
return true; return true;
} }
/** /**
* Delete all frames in temp directory. * Deletes all frames in temp directory.
* *
**/ **/
async clearAll() { async clearAll() {
@ -188,7 +188,7 @@ class FFMPEG {
} }
/** /**
* Checks if mcopy temp directory exists. If it doesn't, * Checks if mcopy temp directory exists. If it doesn't,
* create it. * creates it.
**/ **/
async checkDir() { async checkDir() {
let fileExists; let fileExists;

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ const { BrowserWindow } = require('electron');
function padded_frame(i) { function padded_frame(i) {
let len = (i + '').length; let len = (i + '').length;
let str = i + ''; let str = i + '';
for (let x = 0; x < 5 - len; x++) { for (let x = 0; x < 8 - len; x++) {
str = '0' + str; str = '0' + str;
} }
return str; return str;

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ class FFMPEG {
padded_frame(i) { padded_frame(i) {
let len = (i + '').length; let len = (i + '').length;
let str = i + ''; let str = i + '';
for (let x = 0; x < 5 - len; x++) { for (let x = 0; x < 8 - len; x++) {
str = '0' + str; str = '0' + str;
} }
return str; return str;
@ -118,7 +118,7 @@ class FFMPEG {
//if (system.platform !== 'nix') { //if (system.platform !== 'nix') {
ext = 'png'; ext = 'png';
//} //}
tmpoutput = path_1.join(tmppath, `export-%05d.${ext}`); tmpoutput = path_1.join(tmppath, `export-%08d.${ext}`);
try { try {
await fs_extra_1.mkdir(tmppath); await fs_extra_1.mkdir(tmppath);
} }
@ -163,7 +163,7 @@ class FFMPEG {
return true; return true;
} }
/** /**
* Delete all frames in temp directory. * Deletes all frames in temp directory.
* *
**/ **/
async clearAll() { async clearAll() {
@ -188,7 +188,7 @@ class FFMPEG {
} }
/** /**
* Checks if mcopy temp directory exists. If it doesn't, * Checks if mcopy temp directory exists. If it doesn't,
* create it. * creates it.
**/ **/
async checkDir() { async checkDir() {
let fileExists; let fileExists;

File diff suppressed because one or more lines are too long

View File

@ -8,14 +8,13 @@
import spawn = require('spawn'); import spawn = require('spawn');
import { join as pathJoin } from 'path'; import { join as pathJoin } from 'path';
import { delay } from 'delay'; import { delay } from 'delay';
import { exec } from 'exec';
const { BrowserWindow } = require('electron'); const { BrowserWindow } = require('electron');
function padded_frame (i : number) { function padded_frame (i : number) {
let len = (i + '').length; let len = (i + '').length;
let str = i + ''; let str = i + '';
for (let x = 0; x < 5 - len; x++) { for (let x = 0; x < 8 - len; x++) {
str = '0' + str; str = '0' + str;
} }
return str; return str;

View File

@ -49,7 +49,7 @@ class FFMPEG {
private padded_frame (i : number) { private padded_frame (i : number) {
let len = (i + '').length; let len = (i + '').length;
let str = i + ''; let str = i + '';
for (let x = 0; x < 5 - len; x++) { for (let x = 0; x < 8 - len; x++) {
str = '0' + str; str = '0' + str;
} }
return str; return str;
@ -140,7 +140,8 @@ class FFMPEG {
ext = 'png'; ext = 'png';
//} //}
tmpoutput = join(tmppath, `export-%05d.${ext}`); tmpoutput = join(tmppath, `export-%08d.${ext}`);
try { try {
await mkdir(tmppath); await mkdir(tmppath);
} catch (err) { } catch (err) {
@ -190,7 +191,7 @@ class FFMPEG {
} }
/** /**
* Delete all frames in temp directory. * Deletes all frames in temp directory.
* *
**/ **/
public async clearAll () { public async clearAll () {
@ -214,7 +215,7 @@ class FFMPEG {
/** /**
* Checks if mcopy temp directory exists. If it doesn't, * Checks if mcopy temp directory exists. If it doesn't,
* create it. * creates it.
**/ **/
private async checkDir () { private async checkDir () {
let fileExists : boolean; let fileExists : boolean;