Skip to content

Commit

Permalink
fixed for now
Browse files Browse the repository at this point in the history
  • Loading branch information
MoathTar committed Jun 1, 2024
1 parent 09e8fce commit 8765d21
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/GeneratorPage/generator/generator.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
<div *ngIf="ffmpegExecuting" class="d-flex justify-content-center my-5 align-items-center" style="width: 100dvw;">

<div class="mx-auto w-50">
<div class="d-flex justify-content-between"><span>{{this.executingProgressLabel()}}</span> <span>Elapsed Time <span class="fw-bold">{{this.clock + ' s'}}</span></span></div>
<div class="d-flex justify-content-between"><span>{{this.executingProgressLabel()}}</span> <span>Elapsed Time <span class="fw-bold">{{this.executingTime + ' s'}}</span></span></div>
<p-toast></p-toast>
<p-progressBar [value]="executingProgress()"></p-progressBar>
<p-progressBar [ariaValueMin]="0" [ariaValueMax]="100" [value]="executingProgress()"></p-progressBar>
</div>
</div>

Expand Down
6 changes: 4 additions & 2 deletions src/app/GeneratorPage/generator/generator.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class GeneratorComponent {

async load() {
this.loaded = false;
this.ffmpeg.on("log", ({ message,type }) => {
this.ffmpeg.on("log", ({ message }) => {
this.message = message;
});
this.ffmpeg.on("progress",({progress,time}) =>{
Expand All @@ -107,7 +107,7 @@ export class GeneratorComponent {
this.loaded = true;
};
async transcode(audios:Blob[]) {
this.ffmpegExecuting = true;

this.firstLoad = true;
this.loadedAudio = true;

Expand Down Expand Up @@ -142,6 +142,8 @@ export class GeneratorComponent {
await this.ffmpeg.writeFile('subtitles.ass',subtitleFile);
await this.ffmpeg.writeFile('/tmp/Al-QuranAlKareem',await fetchFile('/assets/fonts/Al-QuranAlKareem.ttf'));
// await this.ffmpeg.writeFile('subtitles.ass',await fetchFile('/assets/subs/test.ass'));
this.ffmpegExecuting = true;
this.executingProgress.set(0);
await this.ffmpeg.exec(['-stream_loop', '-1', '-i', 'video.mp4', '-i', 'output.mp3', '-c:v', 'copy', '-c:a', 'aac', '-map', '0:v:0', '-map', '1:a:0', '-shortest','output.mp4']);
//:fontsdir=/tmp:force_style='Fontname=Arimo,Fontsize=24,PrimaryColour=&H00FFFFFF,OutlineColour=&H000000FF,BackColour=&H00000000,Bold=1,Italic=0,Alignment=2,MarginV=40
let command = ['-i','output.mp4',"-vf","ass=subtitles.ass:fontsdir=tmp","-c:v","libx264","-preset","ultrafast","-crf","32","-c:a","copy",'outputsub.mp4'];
Expand Down
2 changes: 1 addition & 1 deletion src/app/Services/quran.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class QuranService {
map(ayahs => {
let text: string[] = [];
ayahs.forEach(ayah => {
text.push(language == 'arabic' ? ayah.arabic1 : ayah.english);
text.push(language == 'arabic' ? ayah.arabic2 : ayah.english);
});
return text;
})
Expand Down

0 comments on commit 8765d21

Please sign in to comment.