Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract metadata from video files on Android [closed]

I need to read metadata from video files on Android. I have taken a look at the tags available via MediaStore.Video.VideoColumns and android.media.MediaMetadataRetriever. However, both of these don't give me access to some additional tags which a tool like ExifTool by Phil Harvey gives access to.

I'm mostly interested in the Camera Make/Model, Compressor ID tags but really would like to know how to access the other tags also.

Do APIs exist in android for reading these additional tags or am I looking at implementing file format specific, native metadata parser myself?

Here the output generated by ExifTool for a video captured using the iPhone camera:

ExifTool Version Number         : 9.28
File Name                       : iPhone.MOV
Directory                       : .
File Size                       : 74 kB
File Modification Date/Time     : 2013:04:30 14:41:24+09:00
File Access Date/Time           : 2013:04:30 14:41:24+09:00
File Creation Date/Time         : 2013:04:30 14:41:24+09:00
File Permissions                : rw-rw-rw-
File Type                       : MOV
MIME Type                       : video/quicktime
Major Brand                     : Apple QuickTime (.MOV/QT)
Minor Version                   : 0.0.0
Compatible Brands               : qt
Movie Data Size                 : 71757
Movie Header Version            : 0
Modify Date                     : 2013:04:30 05:40:07
Time Scale                      : 600
Duration                        : 5.36 s
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 2013:04:30 05:40:06
Track Modify Date               : 2013:04:30 05:40:07
Track ID                        : 1
Track Duration                  : 5.34 s
Track Layer                     : 0
Track Volume                    : 100.00%
Balance                         : 0
Audio Channels                  : 1
Audio Bits Per Sample           : 16
Audio Sample Rate               : 44100
Audio Format                    : chan
Matrix Structure                : 0 1 0 -1 0 0 272 0 1
Image Width                     : 480
Image Height                    : 272
Clean Aperture Dimensions       : 480x272
Production Aperture Dimensions  : 480x272
Encoded Pixels Dimensions       : 480x272
Media Header Version            : 0
Media Create Date               : 2013:04:30 05:40:06
Media Modify Date               : 2013:04:30 05:40:07
Media Time Scale                : 600
Media Duration                  : 5.37 s
Media Language Code             : und
Graphics Mode                   : ditherCopy
Op Color                        : 32768 32768 32768
Handler Class                   : Data Handler
Handler Vendor ID               : Apple
Handler Description             : Core Media Data Handler
Compressor ID                   : avc1
Source Image Width              : 480
Source Image Height             : 272
X Resolution                    : 72
Y Resolution                    : 72
Compressor Name                 : H.264
Bit Depth                       : 24
Video Frame Rate                : 30
Camera Identifier               : Back
Frame Readout Time              : 28512 microseconds
Make                            : Apple
Software Version                : 6.1.3
Create Date                     : 2013:04:30 14:39:40+09:00
GPS Coordinates                 : 37 deg 15' 19.08" N, 127 deg 2' 59.28" E, 43 m Above Sea Level
Model                           : iPhone 4S
Handler Type                    : Metadata Tags
Make (und-IN)                   : Apple
Creation Date (und-IN)          : 2013:04:30 14:39:40+09:00
GPS Coordinates (und-IN)        : 37 deg 15' 19.08" N, 127 deg 2' 59.28" E, 43 m Above Sea Level
Software (und-IN)               : 6.1.3
Model (und-IN)                  : iPhone 4S
Avg Bitrate                     : 107 kbps
GPS Altitude                    : 43 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 37 deg 15' 19.08" N
GPS Longitude                   : 127 deg 2' 59.28" E
GPS Position                    : 37 deg 15' 19.08" N, 127 deg 2' 59.28" E
Image Size                      : 480x272
Rotation                        : 90
like image 633
Code Poet Avatar asked Apr 30 '13 07:04

Code Poet


People also ask

Is there EXIF data on videos?

Video files - or at least the very vast majority of them, do not have Exif metadata. There is no where to write this information to the file.

What metadata is stored in a video file?

Metadata of a video file allows users to identify the characteristics of the file, making it easier to search, use and manage the video. The video metadata can, for instance, include the date the video was created, the creator's name, location, date of upload, and camera ID.


1 Answers

This library will return all available metadata tags (disclaimer: I wrote it). You can also build it manually if you want to enable support for additional formats. http://github.com/wseemann/FFmpegMediaMetadataRetriever

like image 116
William Seemann Avatar answered Sep 18 '22 10:09

William Seemann