Get EXIF information from a Quicktime Movie - macos

For a JPG image, I can just use CGImageSourceCopyPropertiesAtIndex to obtain the various bits of EXIF information from the image. However, this API does not work with quicktime movie files.
What similar Cocoa APIs can I use to extact EXIF information from a Quicktime movie file?

EXIF is a standard for image files, not for movies. There's no EXIF information defined for movies and correspondingly there's no API to retrieve them from quicktime movie files.

Related

How can I get thumbnail image from multipartfile video without storing it in local storage

I'm trying to make thumbnail image from multipartfile video input.
Below logic is I'm trying to:
Spring receive uploaded video as multipartFile from user
Store video directly in s3
Extract thumbnail image from video in Java using jcodec
Store thumbnail image in s3
AWS Media Convert needs to convert full video as well, so the price is too expensive to use.
I just want only one frame/image from video and store it.
I've tried ffmpeg as well, but it needs storeing video in local area which I don't want.
Is there any easier way to get thumbnail image.. or is it possible to get from front-end?

Thumbnail from compressed RAW

I need to create thumbnail images for various RAW photo files:
NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys:
(id)kCFBooleanTrue,kCGImageSourceCreateThumbnailFromImageIfAbsent,
(id)[NSNumber numberWithInteger:256],kCGImageSourceThumbnailMaxPixelSize,
(id)kCFBooleanTrue,kCGImageSourceCreateThumbnailWithTransform,
nil];
thumbnail = CGImageSourceCreateThumbnailAtIndex(source,0,(CFDictionaryRef)options);
This works for image formats supported by macOS.
There are however files that macOS correctly identifies as images, but does not fully support. Typically these are the compressed variants of supported RAW formats. These share the same extension and type as the supported non-compressed variants.
For these files I would like to extract JPEG previews and thumbnails embedded in the RAW files. Basically, what I would expect from kCGImageSourceCreateThumbnailFromImageIfAbsent: Use the existing previews where available.
I have checked with exiftool. My images include both a preview and a thumbnail.
I just can't get CGImageSourceCreateThumbnailAtIndex() to use it. Is there an API or library that does extract the thumbnail even when the file format is not fully supported?

How to extract Geolocation metadata from an Apple Live Photo?

I'm trying to organize my photo collection and convert .mov files to .jpeg files while retaining all of the meta data that has been stored. I'm running into a problem with Apple's "Live Photos" though...
I recently downloaded all of the photos from my iCloud account and found that many have been stored as .mov files as "Live Photos". As I only want to include photos in this collection, I'd like to convert all of these .mov files to .jpg files.
So... I'm trying to use python and shell commands to do this. Here's an extract of my code:
# Convert the .mov file into a series of jpegs using ffmpeg
os.system(f'ffmpeg -i {movie} -r {numFrames} -map_metadata 0 -movflags use_metadata_tags {imageRoot}_%0004d.jpg')
# ... some code to find the best slice of the movie to keep as an image ...
# Add any meta tags that may have been missed
os.system(f'exiftool -tagsFromFile {movie} {image}"
Unfortunately, the Geolocation metadata isn't being copied from the .mov file to the .jpg files. exiftool {movie}.mov doesn't list any GPS or Geolocation tags either, but I know that this data is included somewhere within the file as Apple is able to map the location that the 2 second video was taken. Any thoughts as to how I can extract this meta data from Apple's Live Photo .mov clips?
Thanks in advance.
PP
think I found it. The latitude and longitude are there, but then I have to convert that to a City, State,and Country using geopy. Seems to work now

How is image shown in player while playing a mp3 stored?

When we play a mp3 file, an image is shown in audio player (generally is album poster or something related). How is that image stored within mp3 file ?
The image is stored in form of an ID3 tag in the MP3. ID3 tag is basically metadata which contains information like which artist made the song, which album it is from, etc.
The cover images are fetched from online collections (e.g. from Last.fm) and saved in the file.

If i am making a image sharing service website using the standard file upload form what images can i say it supports, other then jpg, png, gif

If i am making a image sharing service website using the standard file upload form what images can i say it supports, other then jpg, png, gif. Is there a list that shows what browsers supports what? I know that jpg png and gif are most common but what are the others. I want to be sure.
Honestly, that's pretty much all you should be concerned with. Any other file formats (like svg) are not widely supported enough.
I would suggest converting other types of files to those 3
Examples:
jpeg (simple renaming)
bmp
tiff
pcx

Resources