Opened 10 years ago

Closed 10 years ago

#932 closed defect (invalid)

Video thumbnail pipeline passes seek_amount argument as float when int is expected

Reported by: ayleph Owned by:
Priority: minor Milestone:
Component: programming Keywords:
Cc: Parent Tickets:

Description

While seeking through a video file to create a thumbnail, the pipeline (always?) passes the seek_amount argument as a float. This results in the DeprecationWarning: integer argument expected, got float warning shown below.

17:42:56,974 DEBUG   [mediagoblin.processing.task] Processing <MediaEntry 28: file>
17:42:56,974 INFO    [mediagoblin.media_types.video.transcoders] Initializing VideoTranscoder...
17:42:56,976 INFO    [mediagoblin.media_types.video.transcoders] Discovering /path/to/mediagoblin/user_dev/media/queue/media_entries/hash/file.webm
17:42:57,027 INFO    [mediagoblin.media_types.video.transcoders] Terminating MainLoop
17:42:57,028 DEBUG   [mediagoblin.media_types.video.processing] Skipping transcoding
17:42:57,089 INFO    [mediagoblin.media_types.video.transcoders] playbin ready
17:42:57,090 CRITICA [mediagoblin.media_types.video.transcoders] Could not get any video data from playbin
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,118 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,118 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,118 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,119 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,119 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,119 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,120 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,120 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,121 INFO    [mediagoblin.media_types.video.transcoders] Could not seek.
/path/to/mediagoblin/mediagoblin/media_types/video/transcoders.py:243: DeprecationWarning: integer argument expected, got float
  0)
17:42:57,129 INFO    [mediagoblin.media_types.video.transcoders] Seek successful, attaching buffer probe
17:42:57,130 INFO    [mediagoblin.media_types.video.transcoders] Attached buffer probes: {'fakesink0': 75L}
17:42:57,219 INFO    [mediagoblin.media_types.video.transcoders] Taking snapshot! ((<GstPad (fakesink0:sink) at 7f606c211df0>, <gst.Buffer 0x7f607c006740 of size 54540 and data 0x56422e57>, 'fakesink0'))
17:42:57,282 INFO    [mediagoblin.media_types.video.transcoders] Saved snapshot!
17:42:57,297 DEBUG   [mediagoblin.media_types.video.processing] Saving thumbnail...

Change History (3)

comment:1 by ayleph, 10 years ago

Owner: set to ayleph
Status: newin_progress

Quick solution: force seek_amount to an integer.

Here's the current state of code.

mediagoblin/media_types/video/transcoders.py:

                # Find the fakesink sink pad and attach the on_buffer_probe
                # handler to it.
                seek_amount = self.position_callback(self.duration, gst)

                seek_result = self.thumbnail_pipeline.seek(
                        1.0,
                        gst.FORMAT_TIME,
                        gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE,
                        gst.SEEK_TYPE_SET,
                        seek_amount,
                        gst.SEEK_TYPE_NONE,
                        0)

And here we force seek_amount to an integer.

mediagoblin/media_types/video/transcoders.py:

                # Find the fakesink sink pad and attach the on_buffer_probe
                # handler to it.
                seek_amount = int(self.position_callback(self.duration, gst))

                seek_result = self.thumbnail_pipeline.seek(
                        1.0,
                        gst.FORMAT_TIME,
                        gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE,
                        gst.SEEK_TYPE_SET,
                        seek_amount,
                        gst.SEEK_TYPE_NONE,
                        0)

The only difference is this line:

-                seek_amount = self.position_callback(self.duration, gst)
+                seek_amount = int(self.position_callback(self.duration, gst))

comment:2 by ayleph, 10 years ago

Owner: ayleph removed
Status: in_progressreview

comment:3 by ayleph, 10 years ago

Resolution: invalid
Status: reviewclosed

This is no longer an issue with the updated gstreamer1.0 code.

Note: See TracTickets for help on using tickets.