mifi/lossless-cut · warning · UserFacingError
No GPS points found
Error message
No GPS points found
What it means
Thrown in GpsMap.tsx after extracting GPS points from a stream's metadata/subtitle track and (optionally) down-sampling to maxPointsToShow, when the resulting gpsPoints array is empty. The map component cannot draw a track without points, so it surfaces the failure via handleError. It indicates the selected stream was parsed but yielded zero usable coordinates.
Source
Thrown at src/renderer/src/components/GpsMap.tsx:57
const [points, setPoints] = useState<Awaited<ReturnType<typeof getGpsTrack>>>();
useEffect(() => {
(async () => {
try {
const allGpsPoints = await getGpsTrack({ filePath, streamIndex });
// limit number of points, or else severe map slowdown
const maxPointsToShow = 500;
let gpsPoints = allGpsPoints;
if (allGpsPoints.length > maxPointsToShow) {
gpsPoints = Array.from({ length: maxPointsToShow }).flatMap((_, i) => {
const p = allGpsPoints[Math.floor(i * (allGpsPoints.length / maxPointsToShow))];
return p != null ? [p] : [];
});
}
if (gpsPoints.length === 0) {
throw new UserFacingError(i18n.t('No GPS points found'));
}
setPoints(gpsPoints);
} catch (err) {
handleError({ err });
}
})();
}, [filePath, handleError, streamIndex]);
const firstPoint = points?.[0];
if (points == null || firstPoint == null) {
return null;
}
return (
<div style={{ width: '80vw', height: '60vh' }}>
<MapContainer center={[firstPoint.lat, firstPoint.lng]} zoom={16} style={{ width: '100%', height: '100%' }}>View on GitHub (pinned to 3b9a59c288)
Solutions
- Confirm the file actually contains a GPS/telemetry track using `ffprobe -show_streams` and inspect the subtitle/SRT data.
- Select the correct stream index that carries the GPS data in the streams selector.
- If the format is unsupported, extract the SRT/subtitle to a file and verify coordinates are present.
- Catch the error and show 'this stream has no GPS data' rather than failing the whole map.
Defensive patterns
Strategy: try-catch
Validate before calling
// After computing gpsPoints, decide whether to render the map at all
if (!gpsPoints || gpsPoints.length === 0) {
setPoints(undefined); // render 'no GPS data' state instead of throwing
return;
} Type guard
const hasGpsPoints = (pts: unknown): pts is GpsPoint[] => Array.isArray(pts) && pts.length > 0;
Try / catch
try {
// ...extract gpsPoints...
if (gpsPoints.length === 0) throw new UserFacingError(i18n.t('No GPS points found'));
setPoints(gpsPoints);
} catch (err) {
handleError({ err }); // already routed in source
} Prevention
- Confirm the stream actually carries GPS data with ffprobe before selecting it.
- Select the correct stream index that contains the telemetry/SRT track.
- Render an explicit empty-state UI instead of surfacing the error when no points exist.
- Handle the unsupported SRT format gracefully by warning the user.
When it happens
Trigger: Selecting a telemetry/GPS stream whose SRT or subtitle data parsed to no coordinate frames; a DJI/Garmin SRT where the regex/parser matched nothing; a stream flagged as gps but containing only non-GPS text; corrupt or truncated metadata that dropped every point.
Common situations: DJI drone footage whose SRT track is absent or in an unrecognized format; a GPS subtitle stream in a locale/format the parser does not support; selecting the wrong stream index as the GPS source; metadata stripped during a previous transcode.
AI-assisted analysis of mifi/lossless-cut@3b9a59c288 (2026-08-12).
Data as JSON: /api/errors/8dba2fd618f6c501.
Report an issue: GitHub.