Changes between Initial Version and Version 1 of Ticket #5409, comment 6


Ignore:
Timestamp:
Apr 8, 2018, 6:28:34 AM (7 years ago)
Author:
ayleph

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5409, comment 6

    initial v1  
    11I tested the example video provided by Sturm, and it processed fine on my relatively up-to-date instance. iank, are you still affected by this issue? Are you running recent-ish code?
     2
     3Edit: no, sorry, I was wrong. It looks like I had already hacked in a workaround for this issue on my instance. When I tried again from master, the file failed to process. Here's the change I'm running in my modified instance.
     4
     5{{{
     6--- mediagoblin/media_types/video/processing.py
     7+++ mediagoblin/media_types/video/processing-modified.py
     8@@ -116,10 +116,13 @@
     9         # TODO: handle timezone info; gst.get_time_zone_offset +
     10         # python's tzinfo should help
     11         dt = tags['datetime']
     12-        tags['datetime'] = datetime.datetime(
     13-            dt.get_year(), dt.get_month(), dt.get_day(), dt.get_hour(),
     14-            dt.get_minute(), dt.get_second(),
     15-            dt.get_microsecond()).isoformat()
     16+        try:
     17+            tags['datetime'] = datetime.datetime(
     18+                dt.get_year(), dt.get_month(), dt.get_day(), dt.get_hour(),
     19+                dt.get_minute(), dt.get_second(),
     20+                dt.get_microsecond()).isoformat()
     21+        except:
     22+            tags['datetime'] = None
     23     for k, v in tags.copy().items():
     24         # types below are accepted by json; others must not present
     25         if not isinstance(v, (dict, list, six.string_types, int, float, bool,
     26}}}