Metadata
Many files contain interesting information about their contents. This is called "metadata". Transloadit automatically extracts this metadata for all uploaded, imported, and processed files.
At the very minimum, each file will have the information such as:
{
"id": "ae52b7f8c1b3426e8c29ea0a9daf8306",
"name": "straw-apple.jpg",
"basename": "straw-apple",
"ext": "jpg",
"size": 92230,
"mime": "image/jpeg",
"type": "image",
"field": "test_file",
"url": "http://tmp.maynard.transloadit.com/upload/1324a798a99fce7f5f8289a95a74f02b.jpg",
"original_id": "4af24fb2595f44809f3adc2f77bc9bfa",
"meta": {
// …
}
}
The information we can extract depends on the media file, its type, but also who produced it. If it
was an iPhone, there's probably latitude in there for geo-positioning. More common keys include
height, and duration.
To see what information we can extract from files that you will throw at us, you could try one of our demos and inspect our response after uploading a file there.
idA random and unique ID used internally by Transloadit to track the file.
nameThe name of the file. Transloadit will change the extension used for this field if the file undergoes processing into a different format.
basenameThe name of the file without the extension.
extThe extension of the file.
sizeThe size of the file, in bytes.
mimeThe determined MIME type for this file.
typeAn abstract type describing the file, which can currently be
"image","video","audio", ornull.fieldThe name of the form field used to submit this file.
urlThe URL at which this file can be accessed. This is either a URL in your S3 bucket, or a temporary URL on our servers. Since temporary URLs expire after a few hours, you should make sure to move your files elsewhere unless you are using a storage robot.
original_idThe unique ID of the original upload file from which this file was generated. This is useful to determine which file of a multi-file upload was used to generate a given file, after several Steps of processing.
metaAn object containing additional metadata extracted from the file, as shown below.
Image Metadata
Although it depends on the file at hand, files whose mime type is image can typically contain data
such as the following inside the meta property:
widthThe width of the input image, in pixels.
heightThe height of the input image, in pixels.
aspect_ratioThe aspect ratio of the image, which is its width divided by its height. Will be 0 if for some reason the image height is 0.
date_recordedThe date and time at which this image was taken, in the format
YYYY/MM/DD HH:MM:SS TZ, such as"2010/06/30 22:16:06 GMT".date_file_createdThe creation time for the file system.
date_file_modifiedThe modification time for the file system.
titleThe title of this image, such as
"Tree".keywordsAn array of keywords for this image, such as
["tree", "nature"].descriptionA description of this image, such as
"This tree is very old.".locationThe location at which this image was taken, which is usually the street, such as
"Zingster Str. 32".creatorThe creator that took the image.
authorThe author that took the image. Some cameras populate this field as opposed to
creator.copyrightThe copyright metadata field.
copyright_noticeThe copyright notice metadata field.
cityThe city in which this image was taken, such as
"Berlin".stateThe state in which this image was taken, such as
"Berlin".countryThe country in which this image was taken, such as
"Germany".country_codeThe country code of the country in which this image was taken, such as
"de".apertureThe aperture setting for this image, such as
5.7.exposure_compensationThe exposure compensation for this image, such as
"+4/3".exposure_modeThe exposure mode for this image, such as
"Auto".exposure_timeThe exposure time for this image, such as
"1/30".flashThe flash settings for this image, such as
"Off, Did not fire".focal_lengthThe focal length for this image, such as
"55.0 mm".f_numberThe f-number for this image, such as
5.6.isoThe ISO value for this image, such as
800.light_valueThe light value for this image, such as
6.9.metering_modeThe metering mode for this image, such as
"Multi-segment".shutter_speedThe shutter speed for this image, such as
"1/32".white_balanceThe white balance setting for this image, such as
"Manual".device_nameThe device name of the camera, such as
"iPhone 3GS".device_vendorThe camera manufacturer, such as
"Apple".device_softwareThe version of the device software for the camera, such as
"3.1.2".latitudeThe latitude at which this image was taken, such as
52.5374.longitudeThe longitude at which this image was taken, such as
13.4034.thumb_indexThe index of the current thumbnail starting at 0. This key is only present for results of 🤖/video/thumbs.
thumb_offsetThe offset for the current thumbnail, in seconds. This key is only present for results of 🤖/video/thumbs.
frame_countThe number of frames in an animated GIF file. This is
1by default for all other image types.colorspaceThe colorspace of the image. This could be
"sRGB"or"Gray"for instance. In Transloadit's first ImageMagick stack version, there's a bug which would make the colors used in an image determine itscolorspace, and a grayscale colored image would report"Gray", even if saved as"RGB".has_clipping_pathIs
1if the image contains a clipping path,0otherwise.average_colorNot to be confused with dominant color, that counts a single most occurring pixel color and has limited use cases. The average color is calculated by first scaling the input image to 1 pixel.
has_transparencyReturns
truefor images that have transparent areas. This key is only returned if you setoutput_meta.has_transparencytotrue.dominant_colorsReturns an array of the 20 most used colors for images. This key is only returned if you set
output_meta.dominant_colorstotrue.
Video Metadata
Although it depends on the file at hand, files whose mime type is video can typically contain data
such as the following inside the meta property:
widthThe width of the video, in pixels. If the video was meant to be displayed with a different display ratio than the pixel ratio, this indicates the width at which the video is to be displayed.
heightThe height of the video, in pixels.
framerateThe frame rate of the video, such as
29.5.video_bitrateThe video bit rate of the video, such as
500000.video_codecThe video codec of the video, such as
"ffh264".audio_bitrateThe audio bit rate of the video, such as
128000.audio_samplerateThe audio sample rate of the video, such as
44100.audio_channelsThe number of audio channels in the video, such as
2.audio_codecThe audio codec of the video, such as
"faad".seekableWhether the format of the video supports seeking, such as
true.colorspaceThe colorspace of the video. This could be
"sRGB"or"Gray"for instance. This key is only returned if you setoutput_meta.colorspacetotrue.date_recordedFor details, see the description for image metadata.
date_file_createdFor details, see the description for image metadata.
date_file_modifiedFor details, see the description for image metadata.
device_nameFor details, see the description for image metadata.
device_vendorFor details, see the description for image metadata.
device_softwareFor details, see the description for image metadata.
latitudeFor details, see the description for image metadata.
longitudeFor details, see the description for image metadata.
Audio Metadata
Although it depends on the file at hand, files whose mime type is audio can typically contain data
such as the following inside the meta property:
durationThe length of the audio file in seconds.
audio_bitrateBits per second (for all channels combined).
audio_samplerateThe audio sample rate in Hertz, such as
44100, for a CD.audio_channelsNumber of channels. Typically 2, for stereo.
audio_codecThe Audio codec used. Here's a list of all audio codecs that Transloadit supports.
artistMany applications that produce audio write additional information into the audio file such as
artist,year,album,genre.mean_volumeThe mean volume of the audio file. This key is only returned if you set
output_meta.mean_volumetotrue.