Commit ad92fcab authored by Flemming Staebler's avatar Flemming Staebler
Browse files

minor fixes

parent 426b31ae
......@@ -188,7 +188,6 @@ export class RecordingService extends EventTarget{
}
private saveZipFrames(){
console.log(this.frameArray);
if(this.frameArray){
//Append save script
let encode_string = new TextEncoder().encode("ffmpeg -i %05d.png -r 30 -c:v libx264 -crf 18 -pix_fmt yuv420p video.mp4");
......@@ -196,6 +195,7 @@ export class RecordingService extends EventTarget{
this.frameArray.push(encode_string);
//Save blob
let b = new Blob(this.frameArray);
console.log(`Created blob for ${this.render_frame_number} frames.`);
let a_elem = document.getElementById('downloadlink') as HTMLAnchorElement;
a_elem.setAttribute("download", "frames.tar");
a_elem.setAttribute("href", URL.createObjectURL(b));
......@@ -258,14 +258,12 @@ export class RecordingService extends EventTarget{
}
public submitFrameBlob(b: Blob) {
console.log(this.frameArray);
if(!this.frameArray)return;
this.frameArray.push(TarBall.gen_header(FormattingService.leftpad("" + this.render_frame_number , "0", 5) + ".png", b.size));
this.frameArray.push(b);
if(b.size % 512){
this.frameArray.push(new ArrayBuffer(512 - (b.size % 512)));
}
console.log(this.frameArray);
this.render_frame_number += 1;
}
......
......@@ -295,7 +295,6 @@ export class RenderService{
this.renderPipeline();
this.is_complete_frame = Services.TileCacheService.is_complete() && this.ready_to_submit_blob;
if(this.is_complete_frame && Services.RecordingService.acceptsFrames()){
console.log("Complete frame.", Services.FlexibleTimeBaseService.now());
this.ready_to_submit_blob = false;
this.context.gl.canvas.toBlob((blob) => {
Services.RecordingService.submitFrameBlob(blob);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment