Afegir un clip de títol

Feu clic amb el botó dret en un espai buit a la safata del projecte, o cliqueu la icona kdenlive-add-clipgo-downAfegeix clip a la barra d'eines de la safata del projecte i seleccioneu Afegeix un clip de títol.

project_bin_add_title

Afegir un clip de títol

Això obre l'editor de títols integrat.

Vegeu Clips de títol per a més detalls.

Aquí hi ha un script cortesia de Grog (vegeu el seu post per a més detalls i com fer-lo servir en el Windows) que converteix subtítols en títols que després es poden editar a l'editor de títols:

 1#!/bin/bash
 2
 3read -p "frame rate:"$'\n' frate
 4[ "$frate" = "" ] && frate=60
 5echo "..."
 6
 7[ -d ./Kden_Titles/ ] && rm -r ./Kden_Titles
 8mkdir -p Kden_Titles
 9
10readarray -t frm < <( (sed -n '2~4p' ./*.srt) )
11readarray -t sub < <( (sed -n '3~4p' ./*.srt) )
12
13n=1
14w=$(bc<<<"length(${#sub[@]}*2)")
15
16for i in "${!frm[@]}"; do
17
18        b=$(date -d "${frm[i]:0:12}" "+%S.%3N")
19        e=$(date -d "${frm[i]:17:12}" "+%S.%3N")
20        ee=$(date -d "${frm[i-1]:17:12}" "+%S.%3N")
21
22        if [ "$i" -eq 0 ]; then ee=0; fi
23        if [ "$(bc<<<"$b<$ee && $i!=0")" -eq 1 ]; then b="$(bc<<<"$b+60")"; fi
24        if [ "$(bc<<<"$e<$b")" -eq 1 ]; then e="$(bc<<<"$e+60")"; fi
25
26        blank="$(bc <<< "($b*$frate+0.5)/1-($ee*$frate+0.5)/1")"
27        duration="$(bc <<< "($e*$frate+0.5)/1-($b*$frate+0.5)/1")"
28
29        if [ "$blank" -gt 0 ]; then
30        sed -e "s/30/$blank/" -e "s/%s//" ./*.kdenlivetitle* > ./Kden_Titles/"$(printf "%0*d" "$w" "$n")"_.kdenlivetitle
31        ((n++))
32        fi
33
34        sed -e "s/30/$duration/" -e "s/%s/${sub[i]}/" ./*.kdenlivetitle* > ./Kden_Titles/"$(printf "%0*d" "$w" "$n")".kdenlivetitle
35        ((n++))
36
37done
38
39sleep 1
40echo "Titles in $PWD/Kden_Titles"$'\n'
41touch ./Kden_Titles/*_*
42
43$SHELL

Les línies ressaltades apunten a la variable %s (la mateixa utilitzada com a marcador de posició estàndard per als títols de plantilles). Podeu canviar això a qualsevol cosa que preferiu, com ara marcador de posició, per exemple.

Aquí hi ha el mateix script, però per al Powershell al Windows (deseu-lo com a .ps1):

# Prompt for frame rate
$frate = Read-Host "frame rate"
if (-not $frate) { $frate = 60 }
Write-Host "..."

# Remove existing Kden_Titles directory if it exists
if (Test-Path -Path "./Kden_Titles/") { Remove-Item -Path "./Kden_Titles/" -Recurse -Force }
New-Item -ItemType Directory -Path "Kden_Titles"

# Read frames and subtitles from SRT files
$frm = Get-Content -Path '*.srt' | Select-Object -Skip 1 | ForEach-Object -Begin {$i=0} -Process {if ($i++ % 4 -eq 0) {$_}}
$sub = Get-Content -Path '*.srt' | Select-Object -Skip 2 | ForEach-Object -Begin {$i=0} -Process {if ($i++ % 4 -eq 0) {$_}}
# output File name width / counter
$w = [math]::Ceiling($sub.Count * 2)
$w = "$w".length
$n = 1
# Template file placeholders
[regex] $p_1='30'
[regex] $p_2='%s'

for ($i = 0; $i -lt $frm.Count; $i++) {
    # Timing
   $b = [datetime]::ParseExact($frm[$i].Substring(0, 12), "hh:mm:ss,fff", $null).ToString("ss.fff")
   $e = [datetime]::ParseExact($frm[$i].Substring(17, 12), "hh:mm:ss,fff", $null).ToString("ss.fff")
   $ee = if ($i -gt 0) { [datetime]::ParseExact($frm[$i - 1].Substring(17, 12), "hh:mm:ss,fff", $null).ToString("ss.fff") } else { 0 }
   # Add 60s if necessary
   if ($i -eq 0) { $ee = 0 }
   if ($b -lt $ee -and $i -ne 0) { $b = [math]::Round([double]$b + 60, 3) }
   if ($e -lt $b) { $e = [math]::Round([double]$e + 60, 3) }
   # Clip length / padding
   $blank = [math]::Round([decimal]$b * $frate + 0.1) - [math]::Round([decimal]$ee * $frate + 0.1)
   $duration = [math]::Round([decimal]$e * $frate + 0.1) - [math]::Round([decimal]$b * $frate + 0.1)
   # Replace placeholders
   if ($blank -gt 0) {
      Get-Content -Path ./*.kdenlivetitle* |
           ForEach-Object { $p_1.replace("$_", "$blank", 1) } |
           ForEach-Object { $p_2.replace("$_", '',1) } |
      Set-Content -Path "./Kden_Titles/$($n.ToString("D$w"))_.kdenlivetitle"
      $n++
   }
   Get-Content -Path ./*.kdenlivetitle* |
   ForEach-Object { $p_1.replace("$_", "$duration", 1) } |
   ForEach-Object { $p_2.replace("$_", $sub[$i],1) } |
   Set-Content -Path "./Kden_Titles/$($n.ToString("D$w")).kdenlivetitle"
   $n++
}

Start-Sleep -Seconds 1
Write-Host "`nTitles in $PWD\Kden_Titles`n"
# Set date modified for blank clips
(Get-ChildItem -Path ./Kden_Titles/*_*) | % {$_.LastWriteTime = (Get-Date)}