Apply File Creation Time as TimeCode
mkdir tc | |
$files = Get-ChildItem * -include @("*.mp4", "*.mov") | |
foreach ($file in $files) { | |
$fileDate=(Get-Item $file).creationTime | |
$dateParts = $filedate -split " " | |
$fileParts = $file.Name -split "\." | |
$fbname = $fileParts[0] | |
$fext = $fileParts[1] | |
$ftime = $dateParts[1] | |
$fbase = $file.BaseName | |
$cm = " C:\Users\Jason\Downloads\ffmpeg-4.3-win64-static\bin\ffmpeg.exe -i $file -vcodec copy -timecode $ftime```:00 tc/$fbname-tc.$fext" | |
echo $cm | |
iex $cm | |
$newFile = Get-ChildItem tc/$fbname-tc.$fext | |
$newFile.CreationTime = $file.CreationTime | |
$newFile.LastWriteTime = $file.LastWritetime | |
$newFile.LastAccesstime = $file.LastAccesstime | |
} |
This comment has been minimized.
This comment has been minimized.
https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system describes what to do if you get: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
For updating the timecode of a video file based on the file creation date. Not as good as proper timecode / clapboard, but at least gets you started. Run in the same directory as the source files, a subdirectory 'tc' is created and all input files placed there.