python-gstreamer

Error in pipeline porting pygst program from gstreamer 0.10 to 1.0

余生颓废 提交于 2019-12-11 13:18:47
问题 I'm porting a program from pygst 0.10 to 1.0 and I've problems with the pipeline. The pipeline I use in the 0.10 version, and works well, is: udpsrc name=src ! tsparse ! tsdemux ! queue ! ffdec_h264 max-threads=0 ! identity ! xvimagesink force-aspect-ratio=True name=video For the 1.0 version the pipeline should be something like: udpsrc name=src ! tsparse ! tsdemux ! queue ! avdec_h264 ! videoconvert ! xvimagesink force-aspect-ratio=True name=video The code is: self.pipeline = Gst.Pipeline()

Gstreamer with Python and PyQt does not work very well

六月ゝ 毕业季﹏ 提交于 2019-12-11 12:16:45
问题 I have two Raspberry Pi. and want stream video from one to another. for do this I used the following command on first Raspberry Pi to stream video : raspivid -t 999999 -w 1080 -h 720 -fps 25 -hf -b 2000000 -o - | \gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 \! gdppay ! tcpserversink host=serverIp port=5000 in the second Raspberry Pi I used the following pyqt code to capture streamed video : import sys import gi gi.require_version('Gst', '1.0') from gi.repository

draw graph of encoded bit rate of video vs play location

China☆狼群 提交于 2019-12-11 08:55:29
问题 I am trying to measure the variation in the bandwidth required when a video is played over the network. For this purpose, i need to make a graph of the bandwidth required to play the video continuously at any time during the video. I tried processing the video with gstreamer but it gives me the bit rate of the decoded[not encoded] video which is more or less constant. Is there a way to get the encoded bit rate of a video over time? 回答1: Since i got no answers here, i will post the solution

How to record audio in gstreamer for pre-defined time?

谁都会走 提交于 2019-12-11 08:25:40
问题 I have python gstreamer - 1.0 code that records audio using "autoaudiosrc" element. My question is to stop the pipeline after few 'predefined' seconds and preferably I want to add it in gstelement format . The current pipeline used to record : gst-launch-1.0 autoaudiosrc num-buffers=100 ! audioconvert ! vorbisenc ! oggmux ! filesink location="sit.ogg" corresponding python code import sys, os import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst, Gtk GObject.threads

Pocketsphinx + Gstreamer Race Condition? Pocketsphinx can't listen to audio + record from it at the same time in Python script?

一世执手 提交于 2019-12-11 04:57:38
问题 Overview: So this is a follow up to my last problem (here). I will be posting a full answer on that very soon. I'm able to get pocketsphinx to recognize audio input from my PS3 Eye in Python via Gstreamer. By specifying the correct alsa device ( hw:1 in my case ). ISSUE: My next issue seems to involve a tiny race condition involving my Microphone already being in use and needing to be able to record something. Imagine the following: I start up my python daemon, and it's currently listening. I

Get the window handle in PyGI on MacOS

馋奶兔 提交于 2019-12-10 15:28:48
问题 I use PyGObject/PyGI and GStreamer to show a video in my GUI. The video is shown in a Gtk.DrawingArea and therefore I need to get it's window-handle in the realize-signal-handler. On Linux I can simply use drawing_area.get_property('window').get_xid() and on Windows I have to access the C-API (like described here): drawingarea_window = drawingarea.get_property('window') ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py

cut parts of a video using gstreamer/Python (gnonlin?)

那年仲夏 提交于 2019-12-08 05:34:29
问题 I have a video file and I'd like to cut out some scenes (either identified by a time position or a frame). As far as I understand that should be possible with gnonlin but so far I wasn't able to find a sample how to that (ideally using Python). I don't want to modify the video/audio parts if possible (but conversion to mp4/webm would be acceptable). Am I correct that gnonlin is the right component in the gstreamer universe to do that? Also I'd be glad for some pointers/recipes how to approach

Get the window handle in PyGI

眉间皱痕 提交于 2019-12-01 13:05:12
In my program I use PyGObject/PyGI and GStreamer to show a video in my GUI. The video is shown in a Gtk.DrawingArea and therefore I need to get it's window-handle in the realize -signal-handler. On Linux I get that handle using: drawing_area.get_property('window').get_xid() But how do I get the handle on Windows? I searched on the internet but found only examples for PyGtk using window.handle which does not work using PyGI. The GStreamer documentation provides an example which uses the GDK_WINDOW_HWND macro to get the handle. This macro uses AFAIK gdk_win32_drawable_get_handle . But how to do

DrawingArea Cannot Get XID

社会主义新天地 提交于 2019-11-30 19:39:28
问题 I have the following Python 2.7/PyGObject 3.0/PyGST 0.10 module: from gi.repository import Gtk, Gdk, GdkPixbuf import pango import pygst pygst.require('0.10') import gst import Trailcrest import os, sys import cairo from math import pi class Video: def __init__(self): def on_message(bus, message): if message.type == gst.MESSAGE_EOS: # End of Stream player.seek(1.0, gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, gst.SEEK_TYPE_SET, 5000000000, gst.SEEK_TYPE_NONE, 6000000000) elif message.type == gst

gstreamer python bindings for windows

牧云@^-^@ 提交于 2019-11-28 20:54:26
I am looking into gstreamer as a means to choose a video device from a list to feed it to an opencv script. I absolutely do not understand how to use gstreamer with python in windows. I installed the Windows gstreamer 1.07 binaries from the gstreamer official website . However, I could not import the pygst and gst modules in python. >>> import pygst Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import pygst ImportError: No module named pygst >>> I checked the gstreamer installation, and there seems to be no pygst.py provided. There is however a file named gst-env