55$loc = get-location
66if ($args.count -lt 1 ) {
77 write-output " Usage: addVideoorImg.ps1 trajpath"
8+ write-output " First create a folder for the trajectory eg 20241113_192754.345_UK"
9+ write-output " Copy any additional mp4, mov or jpgs into it, then run this script"
810 exit
911}else {
1012 $pth = $args [0 ]
1113}
14+ set-location $PSScriptRoot
15+ # load the helper functions
16+ . .\helperfunctions.ps1
17+ $ini = get-inicontent analysis.ini
18+ Set-Location $Loc
1219$traj = (split-path - leaf $pth )
1320
1421$yr = $traj.Substring (0 , 4 )
@@ -22,11 +29,13 @@ $pref = '<a href="'
2229$mid = ' "><video width="20%"><source src="'
2330$tail = ' " width="20%" type="video/mp4"></video></a>'
2431
32+ echo $pth
33+ dir $pth /* .mov
2534$fils = (get-childitem $pth /* .mov)
2635foreach ($fil in $fils ){
2736 $fnam = $fil.name
2837 $ofnam = $fnam.replace (' .mov' , ' .mp4' )
29- ffmpeg - i $fname - vcodec h264 $ofnam
38+ ffmpeg - i $fil - vcodec h264 $pth / $ofnam
3039}
3140$fils = (get-childitem $pth /* .mp4)
3241foreach ($fil in $fils ){
@@ -46,7 +55,7 @@ foreach ($fil in $fils){
4655 aws s3 cp ${fil} s3:// ukmda- website${imgpth}
4756}
4857
49- aws s3 sync ${pth} s3:// ukmda- website/ reports/ ${yr} / orbits/ ${ym} / ${ymd} / ${traj} / -- exclude " *" -- include " extra*.html"
58+ aws s3 sync ${pth} s3:// ukmda- website/ reports/ ${yr} / orbits/ ${ym} / ${ymd} / ${traj} / -- exclude " *" -- include " extra*.html"
5059$pickle = (get-childitem $pth /* .pickle).fullname
5160aws s3 cp ${pickle} s3:// ukmda- shared/ matches/ RMSCorrelate/ trajectories/ ${yr} / ${ym} / ${ymd} / ${traj} /
5261Write-Output " uploaded $pickle at $ ( get-date ) "
0 commit comments