User Tools

Site Tools


powershell:incrustar_cover_mp3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
powershell:incrustar_cover_mp3 [2026/09/22 13:48] – removed - external edit (Unknown date) 127.0.0.1powershell:incrustar_cover_mp3 [2026/09/22 13:49] (current) – adm.wiki
Line 1: Line 1:
 +{{powerhell:pasted:20260921-150545.png}}
  
 +<code powershell>
 +
 +# ==========================================
 +# CONFIGURACIÓN
 +# ==========================================
 +
 +$csv = "Z:\Downloads\aprendiz_estoico_sept_2026\lista.csv"
 +
 +$inputFolder  = "Z:\Downloads\aprendiz_estoico_sept_2026"
 +$outputFolder = "E:\carpeta_destino\sandbox"
 +
 +
 +# ==========================================
 +# CREAR CARPETA DE SALIDA
 +# ==========================================
 +
 +if (!(Test-Path $outputFolder)) {
 +    New-Item -ItemType Directory -Path $outputFolder | Out-Null
 +}
 +
 +
 +# ==========================================
 +# LEER CSV
 +# ==========================================
 +
 +$lista = Import-Csv $csv
 +
 +
 +# ==========================================
 +# PROCESAR CADA FILA
 +# ==========================================
 +
 +foreach ($item in $lista) {
 +
 +    $mp3 = Join-Path $inputFolder $item.mp3
 +    $jpg = Join-Path $inputFolder $item.cover
 +
 +    $output = Join-Path $outputFolder $item.mp3
 +
 +
 +    Write-Host ""
 +    Write-Host "========================================"
 +    Write-Host "MP3   : $($item.mp3)"
 +    Write-Host "COVER : $($item.cover)"
 +    Write-Host "========================================"
 +
 +
 +    # Comprobar MP3
 +    if (!(Test-Path $mp3)) {
 +        Write-Warning "NO EXISTE MP3: $mp3"
 +        continue
 +    }
 +
 +
 +    # Comprobar JPG
 +    if (!(Test-Path $jpg)) {
 +        Write-Warning "NO EXISTE COVER: $jpg"
 +        continue
 +    }
 +
 +
 +    # ==========================================
 +    # FFmpeg
 +    # ==========================================
 +
 +    ffmpeg -y `
 +        -i $mp3 `
 +        -i $jpg `
 +        -map 0:a `
 +        -map 1:v `
 +        -map_metadata 0 `
 +        -c:a copy `
 +        -c:v mjpeg `
 +        -disposition:v attached_pic `
 +        -metadata:s:v title="Album cover" `
 +        -metadata:s:v comment="Cover (front)" `
 +        $output
 +
 +
 +    # ==========================================
 +    # RESULTADO
 +    # ==========================================
 +
 +    if ($LASTEXITCODE -eq 0) {
 +        Write-Host "OK: $output" -ForegroundColor Green
 +    }
 +    else {
 +        Write-Warning "ERROR: $($item.mp3)"
 +    }
 +}
 +```
 +</code>
 +
 +{{powerhell:pasted:20260921-150902.png}}