1 year ago
#357194
Rasitha Ariyarathna
Extract GPS meta data of a video using C#
I have tried following libraries in c# (.net core)
- Media Info
- Metadata Extractor
- Tag Lib
- Media Tool Kit
I wasn't able to retrieve GPS metadata from any of these libraries of a video. But for an image, it worked fine. Also, I tried the Exif tool, but no luck.
Following are some code samples I used. Looking for help on this.
// using metadata extractor
var byteArray = await File.ReadAllBytesAsync("./meta_video.mp4");
Stream stream = new MemoryStream(byteArray);
var directories = QuickTimeMetadataReader.ReadMetadata(stream);
var directories1 = ImageMetadataReader.ReadMetadata("./meta_image1.jpg");
// using tag lib
var tfile = TagLib.File.Create(@"./meta_video.mp4");
// using media tool kit
var inputFile = new MediaToolkit.Model.MediaFile {Filename = @"./meta_video.mp4"};
using (var engine = new Engine())
{
engine.GetMetadata(inputFile);
}
// using media info
string fileNameAndPath = "./video2.mp4";
var myVideo = new MediaFile(fileNameAndPath);
c#
gps
metadata
exiftool
metadata-extractor
0 Answers
Your Answer