Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ComChap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ if ($hascommercials) {
Add-Content -Path $metafile "END=$([int]($end * 1000))"
Add-Content -Path $metafile "title=Chapter $i"
}
try {& $ffmpegPath -hide_banner -loglevel error -nostdin -i $infile -i $metafile -c copy -map_metadata 1 -y $outfile}
try {& $ffmpegPath -hide_banner -loglevel error -nostdin -i $infile -i $metafile -c copy -map 0 -map_metadata 1 -y $outfile}
catch {Write-Host "Error running ffmpeg: $infile"}
}
If (!(Test-Path $outfile)) {
Expand Down
4 changes: 2 additions & 2 deletions ComCut.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ foreach ($line in $lines) {
$tempfiles += $chapterfile
$concat += "|$chapterfile"
$duration = [double]$end - [double]$start
& $ffmpegPath -hide_banner -loglevel error -nostdin -i $infile -ss $start -t $duration -c copy -y $chapterfile
& $ffmpegPath -hide_banner -loglevel error -nostdin -i $infile -ss $start -t $duration -c copy -y -map 0 $chapterfile
$totalcutduration += $startnext - $end
}
$start = $startnext
Expand All @@ -119,7 +119,7 @@ if ($hascommercials) {
$tempfiles += $chapterfile
$concat += "|$chapterfile"
$duration = [double]$end - [double]$start
& $ffmpegPath -hide_banner -loglevel error -nostdin -i $infile -ss $start -t $duration -c copy -y $chapterfile
& $ffmpegPath -hide_banner -loglevel error -nostdin -i $infile -ss $start -t $duration -c copy -map 0 -y $chapterfile
}
& $ffmpegPath -hide_banner -loglevel error -nostdin -i $metafile -i ("concat:$($concat.Substring(1))") -c copy -map_metadata 0 -y $outfile
}
Expand Down
4 changes: 2 additions & 2 deletions comchap
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ if $hascommercials ; then
tempfile=`mktemp --suffix=."$outextension" "$outdir"/XXXXXXXX`

echo Writing file to temporary file: "$tempfile"
if $ffmpegPath -loglevel error -hide_banner -nostdin -i "$infile" -i "$metafile" -map_metadata 1 -codec copy -y "$tempfile" 1>&3 2>&4; then
if $ffmpegPath -loglevel error -hide_banner -nostdin -i "$infile" -i "$metafile" -map 0 -map_metadata 1 -codec copy -y "$tempfile" 1>&3 2>&4; then
mv -f "$tempfile" "$outfile"
echo Saved to: "$outfile"
else
echo Error running ffmpeg: "$infile" 1>&3 2>&4 >&2
exitcode=-1
fi
else
if $ffmpegPath -loglevel error -hide_banner -nostdin -i "$infile" -i "$metafile" -map_metadata 1 -codec copy -y "$outfile" 1>&3 2>&4; then
if $ffmpegPath -loglevel error -hide_banner -nostdin -i "$infile" -i "$metafile" -map 0 -map_metadata 1 -codec copy -y "$outfile" 1>&3 2>&4; then
echo Saved to: "$outfile"
else
echo Error running ffmpeg: "$infile" 1>&3 2>&4 >&2
Expand Down
4 changes: 2 additions & 2 deletions comcut
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ do
concat="$concat|$chapterfile"

duration=`echo "$end" "$start" | awk '{printf "%f", $1 - $2}'`
$ffmpegPath -hide_banner -loglevel error -nostdin -i "$infile" -ss "$start" -t "$duration" -c copy -y "$chapterfile"
$ffmpegPath -hide_banner -loglevel error -nostdin -i "$infile" -ss "$start" -t "$duration" -c copy -map 0 -y "$chapterfile"

totalcutduration=`echo "$totalcutduration" "$startnext" "$end" | awk '{print $1 + $2 - $3}'`

Expand Down Expand Up @@ -216,7 +216,7 @@ if $hascommercials ; then
concat="$concat|$chapterfile"

duration=`echo "$end" "$start" | awk '{printf "%f", $1 - $2}'`
$ffmpegPath -hide_banner -loglevel error -nostdin -i "$infile" -ss "$start" -t "$duration" -c copy -y "$chapterfile"
$ffmpegPath -hide_banner -loglevel error -nostdin -i "$infile" -ss "$start" -t "$duration" -c copy -y -map 0 "$chapterfile"
fi

$ffmpegPath -hide_banner -loglevel error -nostdin -i "$metafile" -i "concat:${concat:1}" -c copy -map_metadata 0 -y "$outfile"
Expand Down