failure of state changing
Vladimir90
samiknani at hotmail.fr
Wed Sep 30 08:54:11 PDT 2015
Hi every body
I'm trying to implement this pipeline on python:
gst-launch-1.0 videotestsrc ! theoraenc ! oggmux ! filesink
location=/home/../Desktop/newdeg.ogg
So this is the code i've been trying so far:
import sys, os
from os import path
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gtk, Gst
GObject.threads_init()
Gst.init(None)
filename = path.join(path.dirname(path.abspath(__file__)), 'celine.mp4')
uri = filename
pipeline = Gst.Pipeline()
video_source = Gst.ElementFactory.make('filesrc', None)
encoding = Gst.ElementFactory.make('theoraenc', None)
muxing = Gst.ElementFactory.make('oggmux', None)
saving = Gst.ElementFactory.make('filesink', None)
if (not pipeline or not video_source or not encoding or not muxing or not
saving):
print('Not all elements could be created.')
exit(-1)
pipeline.add(video_source)
pipeline.add(encoding)
pipeline.add(muxing)
pipeline.add(saving)
if not Gst.Element.link(video_source, encoding):
print("Elements 1,2 could not be linked.")
exit(-1)
if not Gst.Element.link(encoding, muxing):
print("Elements 2,3 could not be linked.")
exit(-1)
if not Gst.Element.link(muxing, saving):
print("Elements 3,4 could not be linked.")
exit(-1)
#back=pipeline.set_state(4)
back=pipeline.set_state(Gst.State.PLAYING)
print('pipeline',back)
bus = pipeline.get_bus()
msg = bus.timed_pop_filtered(Gst.CLOCK_TIME_NONE,Gst.MessageType.ERROR |
Gst.MessageType.EOS)
print msg
pipeline.set_state(Gst.State.NULL)
I don't understand why i'm getting the error "state change failure"
any help will be very appreciated
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/failure-of-state-changing-tp4673902.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list