remove_video_location

remove_video_location is a Flutter plugin that strips selected metadata from video files without re-encoding. The plugin remuxes the original tracks using platform-native frameworks so the process stays fast and lossless.

đź’ˇ Why this plugin?

It's important to remove location metadata from user-uploaded videos to protect privacy and prevent location-based stalking. FFmpeg-based solutions are too large and complex to bundle, while EXIF-focused plugins only work for photos. remove_video_location addresses that gap with a focused, minimal package built specifically for removing location metadata of videos.

The plugin delegates directly to native frameworks: AVFoundation on iOS and MediaExtractor/MediaMuxer on Android—to clear location metadata without re-encoding. By relying on the capabilities already shipped with each platform, the package stays small, fast, and dependency-free.

Features

  • Remove GPS coordinates (ISO 6709 metadata) from videos.
  • Optionally drop container-level creation timestamps.
  • Zero re-encoding – video and audio samples are copied as-is.
  • Works on Android (MediaExtractor/MediaMuxer) and iOS (AVFoundation).

Installation

Add the dependency to your pubspec.yaml:

dependencies:
  remove_video_location: ^0.0.1

Then fetch packages:

flutter pub get

Usage

import 'package:remove_video_location/remove_video_location.dart';

Future<void> cleanVideo() async {
  final cleanedPath = await RemoveVideoLocation.instance.removeMetadata(
    inputPath: '/storage/emulated/0/DCIM/Camera/VID_123.mp4',
    fields: const {
      VideoMetadataField.location,
      VideoMetadataField.creationTimestamp,
    },
  );

  // Use the cleaned video file.
  print('Metadata removed → $cleanedPath');
}

By default the plugin writes a sibling file with the suffix _clean. Pass an outputPath if you need full control over the destination and set overwrite: true to replace existing files.

Platform notes

  • Android: Uses MediaExtractor and MediaMuxer to remux the video. Location metadata is only retained if you do not request its removal. Creation timestamps are regenerated by the muxer; enabling their removal prevents the original value from being copied into the remuxed file.
  • iOS: Uses AVAssetExportSession with AVAssetExportPresetPassthrough and filters metadata via AVMetadataItem identifiers before exporting.

Limitations

  • Only the listed metadata fields are currently removed.
  • You must pass file-system paths that your app can read and write. Request the necessary storage permissions on Android when accessing shared storage.

🤝 Contributing

Contributions are welcome! Please open an issue with your proposal before submitting a pull request. See the CHANGELOG for release notes.