get_request_pad from encodebin return None

RiccardoCagnasso riccardo at phascode.org
Tue Oct 9 17:44:55 UTC 2018


Thibault Saunier-4 wrote
> This is how it should look like:
> 
> ```
> import gi
> from time import sleep
> from threading import Event
> 
> gi.require_version('Gst', '1.0')
> 
> from gi.repository import Gst, GstPbutils  # noqa
> 
> Gst.init(None)
> 
> preset = None
> 
> encodebin = Gst.ElementFactory.make('encodebin')
> 
> ogg = Gst.Caps.from_string("application/ogg")
> cprof = GstPbutils.EncodingContainerProfile("myprofile", None, ogg, None)
> 
> vorbis = Gst.Caps.from_string("audio/x-vorbis")
> cprof.add_profile(GstPbutils.EncodingAudioProfile(vorbis, preset, vorbis,
> 0))
> 
> encodebin.set_property("profile", cprof)
> 
> print(encodebin.emit('request-pad', Gst.Caps('audio/x-vorbis')))
> ```
> 
> Thibault
> On Tue, Oct 9, 2018 at 12:21 PM RiccardoCagnasso <

> riccardo@

> > wrote:
>>
>> The example is somewhat wrong because it sets up a audio encoder and then
>> request a video pad. Buy it yields the same result with
>>
>> encodebin.get_request_pad('audio_%u') is None
>>
>>
>>
>> --
>> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>> _______________________________________________
>> gstreamer-devel mailing list
>> 

> gstreamer-devel at .freedesktop

>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel at .freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

I'm sorry, I can't wrap my head around your example. It seems to me that you
are requesting a sink to input audio/x-vorbis in an encodebin that should
encode audio/x-vorbis.

What I'm expect is to be ably to put audio/x-raw in it or eventually any
type of audio. something like this?


import gi
from time import sleep
from threading import Event

gi.require_version('Gst', '1.0')

from gi.repository import Gst, GstPbutils  # noqa

Gst.init(None)

encodebin = Gst.ElementFactory.make('encodebin')

ogg = Gst.Caps.from_string("video/x-matroska")
cprof = GstPbutils.EncodingContainerProfile("myprofile", None, ogg, None)

h264 = Gst.Caps.from_string("video/x-h264")
vaapih264enc = Gst.ElementFactory.make('vaapih264enc')
Gst.Preset.save_preset(vaapih264enc, 'vaapih264enc_preset')
video_profile = GstPbutils.EncodingVideoProfile(
    h264, 'vaapih264enc_preset', Gst.Caps.from_string('video/x-raw'), 0)
cprof.add_profile(video_profile)

encodebin.set_property("profile", cprof)

pad = encodebin.emit('request-pad', Gst.Caps('video/x-raw'))
print(pad)




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list