Plant Tracer Movie Processing¶
This page describes the current upload, first-frame, playback, and retrace workflow. Historical phase plans have been collapsed into the live behavior.
Upload¶
The browser computes a SHA-256 digest for the selected movie.
The browser posts metadata to
POST /api/new-movie.Flask creates a DynamoDB movie row with status
uploadingand returns a presigned S3 POST for the final object key.The browser uploads the movie directly to S3/MinIO with the returned form fields.
The upload page requests the first frame from lambda-resize and links the user to Analyze.
There is no S3 uploads/ staging prefix and no S3 bucket notification path.
Lambda is invoked by HTTP or SQS/local queue.
First Frame¶
The browser requests:
GET LAMBDA_API_BASE/resize-api/v1/first-frame?api_key=...&movie_id=...
lambda-resize validates the API key, signs the movie S3 URL, extracts frame 0, applies saved rotation, scales the frame to the analysis size, and returns a JPEG.
Playback¶
The movie list requests:
GET LAMBDA_API_BASE/api/v1/movie-data?api_key=...&movie_id=...&format=json
The compatibility route returns signed movie and optional ZIP URLs. The browser sets the video element source to the signed movie URL so playback bytes come from S3/MinIO.
Retracing¶
The user edits markers on frame
N.The browser saves frame
Ntrackpoints through FlaskPOST /api/put-frame-trackpoints.The browser posts to lambda-resize:
POST /resize-api/v1/trace-movie x-api-key: <api_key>
{ "movie_id": "m...", "frame_start": 12, "frame_end": 200 }
lambda-resize clears trackpoints after frame
N, marks the movie astracing, and queues the work.In local mode,
TRACING_QUEUE_MODE=localsends work to the in-process queue. In deployed mode,TRACING_QUEUE_URLsends work to SQS.The worker traces from frame
N + 1through optionalframe_end, writes trackpoints to DynamoDB, writes a ZIP and traced movie to S3/MinIO, and marks status astracing completed.The browser polls
/api/get-movie-metadatauntil completion.
Local Process Model¶
Use two local processes:
make run-local-lambda-debug
make run-local-debug
run-local-debug starts Flask on port 8080 and ensures a local Lambda
endpoint is available. run-local-lambda-debug starts the local HTTP bridge
on port 9811 and the local retrace worker.
Video Processing Library¶
Current lambda-resize frame extraction, scaling, JPEG generation, and tracing
use OpenCV (cv2) and Pillow. ffmpeg is legacy/local tooling, not the
Lambda runtime path.