Skip to content

Instantly share code, notes, and snippets.

@tana3n
Last active November 22, 2018 10:22
Show Gist options
  • Save tana3n/1968668382f336f430b0df1c819dab8f to your computer and use it in GitHub Desktop.
Save tana3n/1968668382f336f430b0df1c819dab8f to your computer and use it in GitHub Desktop.
DGIndexとts_parserをps1でやるやつとavsテンプレ(多重音声だと壊れる)(ついでにdefプリセットコピー+字幕抽出)
##template_20180830to20181117
src=("__vid__")
audiosrc=("_audiosrc_")
filepath=LeftStr(src,FindStr(src,".d2v"))
MPEG2Source(src)
ts_audio=aacfaw(audiosrc)
#ts_audio=LSMASHSource_LWLibavAudioSource(audiosrc).delayaudio()
audiodub(ts_audio)
##EraseLOGO+Pulldown
#EraseLOGOmod()
#pulldownmerge()
##its
#killaudio().ITS(filepath+"def",Output="filepath+"tmc",Chapter=filepath+"chapter.txt")
#set-path
$path = Split-Path $Args -Parent
$filename =[System.IO.Path]::GetFileNameWithoutExtension($Args)
#bin-path
$dgindex = "D:\Encode\bin\DGIndex.exe"
$DGIndex_opt = "-i ""$Args"" -o ""$path\$filename"" -om 0 -minimize -exit"
$ts_parser = "D:\Encode\bin\ts_parser"
$caption = "D:\Encode\Bin\Caption2Ass_PCR"
$def = "D:\Encode\dgindex\its_preset.def"
Set-Location $path
#dgindex
Start-Process -filepath $dgindex -argumentlist "$DGIndex_opt" -wait
#ts_parser
&$ts_parser --mode da --delay-type 2 "$Args"
$aac_source = @((Get-ChildItem -Filter $filename*ms.aac).FullName)
&$Caption "$args"
$avssrc = Get-Content -literalPath $path\$filename.avs
$avs_src = $avssrc | ForEach-Object { $_ -replace "_audiosrc_","$aac_source" }
$avs_src | Out-File -literalPath $path\$filename.avs -Encoding Default
&Copy-Item $def $path\$filename.def
&Remove-Item -LiteralPath "$path\$filename.log" -ErrorAction SilentlyContinue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment