Opened 6 years ago

Closed 6 years ago

#5024 closed defect (fixed)

GSteamer 1.0 should be initialized only when required

Reported by: Boris Bobrov Owned by:
Priority: critical Milestone: 0.8.0
Component: programming Keywords: gstreamer
Cc: Parent Tickets:

Description

GStreamer 1.0 is sometimes initialized even when video or audio are not enabled. This leads to exceptions if it is not installed.

Subtickets

Change History (10)

comment:1 Changed 6 years ago by Boris Bobrov

Status: newin_progress

comment:3 Changed 6 years ago by Boris Bobrov

Owner: Boris Bobrov deleted
Status: in_progressreview

comment:4 Changed 6 years ago by berkerpeksag

It would be good to add a user friendly message if gstreamer is not installed:

Something like

try:
    import gi
    # another imports
except ImportError:
    _log.error("gstreamer is not installed. Please run 'some package manager info here' first.")
else:
    gi.require_version('Gst', '1.0')
    Gst.init(None)

comment:5 in reply to:  4 Changed 6 years ago by Boris Bobrov

Replying to berkerpeksag:

It would be good to add a user friendly message if gstreamer is not installed:

Something like

try:
    import gi
    # another imports
except ImportError:
    _log.error("gstreamer is not installed. Please run 'some package manager info here' first.")
else:
    gi.require_version('Gst', '1.0')
    Gst.init(None)

It's not easy. Not installed gi is just one of reasons it can fail. In fact, every line there can fail due to various reasons.

I agree that user-friendly message should be added, but it should be done in a separate patchset. There is also a doc telling how to enable audio and video that require GStreamer 1.0.

comment:6 Changed 6 years ago by Christopher Allan Webber

I added a new ticket, #5055... please put suggestions on how to improve such warnings there!

comment:7 Changed 6 years ago by Boris Bobrov

cwebber, there is a fix in comment 2. I suggest to close the bug, because it is now fixed for those people who don't use video or audio.

comment:8 Changed 6 years ago by Jessica Tallon

I am getting an awful lot of unit test errors when gstreamer is not installed due to the "mediagoblin/media_types/video/transcoders.py" file.

comment:9 Changed 6 years ago by berkerpeksag

Boris' patch LGTM. I will apply it shortly if no one beats me to it.

comment:10 Changed 6 years ago by berkerpeksag

Resolution: fixed
Status: reviewclosed

Looks like it's already committed, so closing this as "fixed".

Note: See TracTickets for help on using tickets.