MP3/ses dosyasından kayıpsız video dışa aktarma (CPU/GPU) - #1
Merged
Conversation
Yeni "Video Disa Aktar" ozelligi: secilen bir ses dosyasi, mevcut gorsel ayarlarla kayipsiz H.264 MP4'e donusturulur. Ekran/ses kaydi yapilmaz — gizli bir render penceresi her kareyi offline ve deterministik cizer, FFT'yi loopback-helper.js ile birebir ayni olcekte hesaplar, ham RGBA kareleri geri basincli IPC ile ana surece akitir; ffmpeg-static ile yuv420p H.264'e kodlanir ve ses kaynaktan -c:a copy ile birebir gomulur. - CPU (libx264) / GPU (NVIDIA NVENC) kodlayici secimi; NVENC fonksiyonel olarak algilanir, yoksa otomatik CPU'ya duser. - Cozunurluk (720p-4K), FPS (30/60), kalite kademeleri ve ilerleme/iptal. - ffmpeg-static bagimliligi eklendi ve asarUnpack'e dahil edildi. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Bu PR, seçilen bir ses dosyasını (MP3/WAV/FLAC vb.) mevcut görselleştirici ayarlarıyla offline/deterministik şekilde kare kare render ederek H.264 MP4 olarak dışa aktaran yeni “Video Dışa Aktar” özelliğini ekliyor (ekran/ses kaydı olmadan). Ana süreç ffmpeg ile kodlamayı yönetiyor; render tarafı gizli bir BrowserWindow içinde RGBA kareler üretiyor ve IPC ile ana sürece akıtıyor.
Changes:
- Offline render penceresi + render motoru (
src/exporter/*) eklendi; görselleştirici modları yeniden kullanılıyor. - Ana süreçte ffmpeg boru hattı, NVENC doğrulama (GPU/CPU fallback), dışa aktarma IPC’leri ve iptal/ilerleme akışı eklendi.
- Admin UI’da “🎬 Video Dışa Aktar” bölümü ve ffmpeg-static bağımlılığı/paketleme ayarları eklendi.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/defaults.js | Dışa aktarma için varsayılan ayarları (export.*) ekler. |
| src/main/preload-exporter.js | Exporter render penceresi için IPC köprüsünü (window.exp) ekler. |
| src/main/preload-admin.js | Admin UI’ın dışa aktarma IPC çağrılarını ve event aboneliklerini ekler. |
| src/main/main.js | ffmpeg pipeline’ı, GPU NVENC doğrulaması, render penceresi oluşturma ve export yaşam döngüsü yönetimini ekler. |
| src/exporter/index.html | Offline render penceresi HTML’i ve gerekli script import’larını ekler. |
| src/exporter/exporter.js | Ses çözme + FFT + kare render + IPC ile frame akıtma yapan offline render motorunu ekler. |
| src/admin/admin.js | Admin paneline ses seçimi, export seçenekleri ve ilerleme/iptal UI mantığını ekler. |
| src/admin/admin.css | Export paneli için UI stillerini ekler. |
| package.json | ffmpeg-static bağımlılığını ve asarUnpack kapsamını ekler; sürümü 1.0.1’e çıkarır. |
| package-lock.json | ffmpeg-static ve transitif bağımlılıkları kilit dosyasına ekler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+384
to
+406
| opts = opts || {}; | ||
| const audioPath = opts.audioPath; | ||
| const outputPath = opts.outputPath; | ||
| if (!audioPath || !fs.existsSync(audioPath)) return { ok: false, error: 'Ses dosyası bulunamadı.' }; | ||
| if (!outputPath) return { ok: false, error: 'Çıktı yolu seçilmedi.' }; | ||
|
|
||
| const [w, h] = RES_MAP[opts.resolution] || RES_MAP['1080p']; | ||
| const fps = opts.fps === 30 ? 30 : 60; | ||
|
|
||
| // Kodlayıcı seçimi: GPU (NVENC) istendi ama yoksa sessizce CPU'ya düş. | ||
| let encoder = opts.encoder === 'gpu' ? 'gpu' : 'cpu'; | ||
| if (encoder === 'gpu' && !(await detectGpuEncoder())) encoder = 'cpu'; | ||
| const videoArgs = buildVideoArgs(encoder, opts.quality); | ||
|
|
||
| // Ses akışını kayıpsız kopyala (mp4 uyumlu kodek). Değilse şeffaf AAC'e dön. | ||
| const ext = path.extname(audioPath).toLowerCase(); | ||
| const audioCopy = ['.mp3', '.m4a', '.aac'].includes(ext); | ||
| const audioArgs = audioCopy ? ['-c:a', 'copy'] : ['-c:a', 'aac', '-b:a', '320k']; | ||
|
|
||
| const args = [ | ||
| '-y', | ||
| '-f', 'rawvideo', | ||
| '-pixel_format', 'rgba', |
Comment on lines
+420
to
+426
| const ff = resolveFfmpeg(); | ||
| let audioBuf; | ||
| try { | ||
| audioBuf = fs.readFileSync(audioPath); | ||
| } catch (err) { | ||
| return { ok: false, error: 'Ses dosyası okunamadı: ' + err.message }; | ||
| } |
Comment on lines
+485
to
+488
| ipcMain.handle('export:cancel', () => { | ||
| if (exportState) exportState.cancel = true; | ||
| return true; | ||
| }); |
Comment on lines
31
to
34
| "dependencies": { | ||
| "audify": "^1.10.1" | ||
| "audify": "^1.10.1", | ||
| "ffmpeg-static": "^5.3.0" | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Genel Bakış
Bir ses dosyasını (MP3/WAV/FLAC…) mevcut görsel ayarlarla kayıpsız H.264 MP4'e dönüştüren "Video Dışa Aktar" özelliği eklendi. Ekran/ses kaydı yapılmaz — her video karesi offline ve deterministik render edilir, ses kaynaktan birebir kopyalanır.
Ne değişti
src/exporter/): gizli birBrowserWindow, mevcut görselleştirici modlarını (WebGL gradyan + 2D bar/dalga/çember + logo) yeniden kullanarak her kareyit = frame/fpsile deterministik çizer. FFT,loopback-helper.jsile birebir aynı ölçekte hesaplanır (Hann pencere, dB ölçeği) — böylece çıktı canlı görünümle aynıdır.ffmpeg-staticile yuv420p H.264'e kodlanır, ses-c:a copy(mp3/m4a/aac) ile yeniden kodlanmadan gömülür (aksi halde AAC 320k).libx264(CPU) veyah264_nvenc(NVIDIA NVENC, GPU). NVENC bu makinede gerçekten çalışıyor mu diye fonksiyonel olarak test edilir; yoksa otomatik CPU'ya düşülür (hem UI hemexport:starttarafında).ffmpeg-staticbağımlılığı eklendi veasarUnpack'e dahil edildi.Neden
Görselleştirmeyi ekran kaydı kalite kaybı olmadan, kare-doğru ve sesi bozmadan video olarak paylaşabilmek için.
Gözden geçiren için notlar
ffmpeg-static,npm installsırasında yalnızca o anki platformun ikilisini indirir.dist:macbir mac üzerinde derlenmeli; aksi halde mac paketine ffmpeg girmez.🤖 Generated with Claude Code