Skip to content

Commit 66ef926

Browse files
committed
improve the script to add a video or image to an existing solution
1 parent 0556675 commit 66ef926

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

analysis/addVidorImg.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@
55
$loc = get-location
66
if ($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)
2635
foreach ($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)
3241
foreach ($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
5160
aws s3 cp ${pickle} s3://ukmda-shared/matches/RMSCorrelate/trajectories/${yr}/${ym}/${ymd}/${traj}/
5261
Write-Output "uploaded $pickle at $(get-date)"

0 commit comments

Comments
 (0)