Skip to content

Instantly share code, notes, and snippets.

@jxu
Last active August 14, 2026 03:34
Show Gist options
  • Select an option

  • Save jxu/5611321ca13d0ff60c2c5a10fe9c0cc1 to your computer and use it in GitHub Desktop.

Select an option

Save jxu/5611321ca13d0ff60c2c5a10fe9c0cc1 to your computer and use it in GitHub Desktop.
# Substring(7,10) for format like dvgrab-2008.08.08_17-53-10.dv
Get-ChildItem *.dv | Sort Name | Group { $_.BaseName.Substring(7,10) } | % {
$d=$_.Name
$_.Group | % { "file '$($_.Name)'" } | Set-Content "$d.txt"
ffmpeg -f concat -i "$d.txt" -vf bwdif -c:v libx264 -preset slow -crf 22 "$d.mp4"
if ($LASTEXITCODE -eq 0) { Remove-Item "$d.txt" }
}
Get-ChildItem *.dv | Sort-Object Name | ForEach-Object { "file '$($_.Name)'" } | Set-Content files.txt
# -vf bwdif to deinterlace, but breaks sometimes
ffmpeg -f concat -i files.txt -c:v libx264 -preset slow -crf 22 concat.mp4
exiftool -ext dv "-FileName<DV:DateTimeOriginal" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" .
Get-ChildItem *.dv | % { ffmpeg -i $_.FullName -vf bwdif -c:v libx264 -preset slow -crf 22 "$($_.BaseName).mp4" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment