Commit 2299fb15 authored by Flemming Stäbler's avatar Flemming Stäbler
Browse files

corrected TAR padding

parent de5f1a40
......@@ -166,10 +166,11 @@ export class RecordingService extends EventTarget{
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");
let encode_string = new TextEncoder().encode("ffmpeg -i %05d.png -r 30 -c:v libx264 -crf 18 -pix_fmt yuv420p video.mp4\n");
this.frameArray.push(TarBall.gen_header("create_mp4_video.sh", encode_string.length));
this.frameArray.push(encode_string);
this.frameArray.push(new ArrayBuffer(512 - (encode_string.length % 512)));
if(encode_string.length % 512)
this.frameArray.push(new ArrayBuffer(512 - (encode_string.length % 512)));
//Save blob
let b = new Blob(this.frameArray);
let a_elem = document.getElementById('downloadlink') as HTMLAnchorElement;
......@@ -238,7 +239,8 @@ export class RecordingService extends EventTarget{
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);
this.frameArray.push(new ArrayBuffer(512 - (b.size % 512)));
if(b.size % 512)
this.frameArray.push(new ArrayBuffer(512 - (b.size % 512)));
console.log(this.frameArray);
this.render_frame_number += 1;
}
......
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