2015-10-05 08:36:06 +02:00
|
|
|
"""
|
2016-01-08 23:49:06 +01:00
|
|
|
The video module contains the :class:`Video` class, which represents video
|
|
|
|
objects (AVI, MOV, etc.).
|
|
|
|
|
|
|
|
.. moduleauthor:: Jaisen Mathai <jaisen@jmathai.com>
|
2015-10-05 08:36:06 +02:00
|
|
|
"""
|
2015-10-02 09:20:27 +02:00
|
|
|
|
2015-10-05 08:36:06 +02:00
|
|
|
# load modules
|
2015-10-12 09:37:57 +02:00
|
|
|
from datetime import datetime
|
|
|
|
|
2015-10-02 09:20:27 +02:00
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import time
|
|
|
|
|
2016-03-12 20:09:28 +01:00
|
|
|
from .media import Media
|
2015-10-02 09:20:27 +02:00
|
|
|
|
2016-01-02 08:23:06 +01:00
|
|
|
|
2015-10-07 08:47:51 +02:00
|
|
|
class Video(Media):
|
2016-01-08 23:49:06 +01:00
|
|
|
|
|
|
|
"""A video object.
|
|
|
|
|
|
|
|
:param str source: The fully qualified path to the video file.
|
|
|
|
"""
|
|
|
|
|
2015-11-19 11:31:32 +01:00
|
|
|
__name__ = 'Video'
|
2016-01-08 23:49:06 +01:00
|
|
|
|
|
|
|
#: Valid extensions for video files.
|
2019-01-24 03:04:02 +01:00
|
|
|
extensions = ('avi', 'm4v', 'mov', 'mp4', 'mpg', 'mpeg', '3gp', 'mts')
|
2015-10-05 08:10:46 +02:00
|
|
|
|
2015-10-02 09:20:27 +02:00
|
|
|
def __init__(self, source=None):
|
2015-10-07 08:47:51 +02:00
|
|
|
super(Video, self).__init__(source)
|
2021-04-17 05:08:58 +02:00
|
|
|
self.date_original = [
|
|
|
|
'EXIF:DateTimeOriginal',
|
2021-06-20 08:35:28 +02:00
|
|
|
'H264:DateTimeOriginal',
|
|
|
|
'QuickTime:ContentCreateDate'
|
2021-04-17 05:08:58 +02:00
|
|
|
]
|
|
|
|
self.date_created = [
|
|
|
|
'EXIF:CreateDate',
|
2016-06-21 20:19:40 +02:00
|
|
|
'QuickTime:CreationDate',
|
2020-04-27 01:18:23 +02:00
|
|
|
'QuickTime:CreateDate',
|
2016-06-21 20:19:40 +02:00
|
|
|
'QuickTime:CreationDate-und-US',
|
2021-04-17 05:08:58 +02:00
|
|
|
'QuickTime:MediaCreateDate'
|
2016-06-21 20:19:40 +02:00
|
|
|
]
|
2021-04-17 05:08:58 +02:00
|
|
|
self.date_modified = ['File:FileModifyDate']
|
2016-06-21 20:19:40 +02:00
|
|
|
self.title_key = 'XMP:DisplayName'
|
|
|
|
self.latitude_keys = [
|
|
|
|
'XMP:GPSLatitude',
|
2016-06-24 06:31:58 +02:00
|
|
|
# 'QuickTime:GPSLatitude',
|
2016-06-21 20:19:40 +02:00
|
|
|
'Composite:GPSLatitude'
|
|
|
|
]
|
|
|
|
self.longitude_keys = [
|
|
|
|
'XMP:GPSLongitude',
|
2016-06-24 06:31:58 +02:00
|
|
|
# 'QuickTime:GPSLongitude',
|
2016-06-21 20:19:40 +02:00
|
|
|
'Composite:GPSLongitude'
|
|
|
|
]
|
|
|
|
self.latitude_ref_key = 'EXIF:GPSLatitudeRef'
|
|
|
|
self.longitude_ref_key = 'EXIF:GPSLongitudeRef'
|
|
|
|
self.set_gps_ref = False
|