#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Capturador_Gstreamer.py (versión 1)
# por Flavio Danesse (fdanesse@hotmail.com)
# CeibalJAM! - Uruguay
import sys, os, time, string, gobject
import pygst
pygst.require("0.10")
import gst
import pygame
from pygame.locals import *
import gc
gc.enable()
UMBRAL = 160
class Capturador_Gstreamer():
def __init__(self, frecuencia=2):
self.frecuencia = frecuencia
self.hora = time.strftime("%H:%M:%S") # hora de inicio, luego, hora de cada fotografía
# Declaración elemendos para pipeline de fotografía
self.pipeline = None
self.source = None
self.codec = None
self.formato = None
self.filesink = None
self.start_streaming() # levanta el stream
self.anizador_de_imagenes = Analiza(umbral=UMBRAL)
self.estado = True # controla el estado general del programa
def main(self):
while self.estado:
time.sleep(self.frecuencia)
self.get_fotografia()
def get_fotografia(self):
# timer para ejecutar tareas programadas
self.pipeline.set_state(gst.STATE_NULL) # anula el pipeline
self.hora = time.strftime("%H:%M:%S") # obtiene la hora
self.filesink.set_property("location", "%s.png" % (self.hora)) # Cambia nombre de archivo
self.pipeline.set_state(gst.STATE_PLAYING) # Fotografía
nombre_de_archivo = "%s.png" % (self.hora)
self.anizador_de_imagenes.set_analisis(nombre_de_archivo)
def construir_pipeline(self):
# construye el stream de fotografia
self.pipeline = gst.Pipeline("player")
self.source = gst.element_factory_make("v4l2src", "camara") # origen
self.codec = gst.element_factory_make("ffmpegcolorspace", "codec") # formato de video
self.formato = gst.element_factory_make("pngenc", "png") # formato de imagen
self.filesink = gst.element_factory_make("filesink", "filesink") # salida
self.filesink.set_property("location", "%s.png" % (self.hora))
self.pipeline.add(self.source, self.codec, self.formato, self.filesink) # armar el pipeline
gst.element_link_many(self.source, self.codec, self.formato, self.filesink) # entubar los elementos
def start_streaming(self):
# Ejecuta el stream
self.construir_pipeline() # construye el pipeline
self.bus = self.pipeline.get_bus() # obtiene el bus de mensajes
self.bus.add_signal_watch() # escucha las señales en el bus
self.bus.connect("message", self.on_message) # conecta los mensajes al manejador de señales
def on_message(self, bus, message):
# mensajes en el bus
if message.type == gst.MESSAGE_ERROR:
err, debug = message.parse_error()
print "ERROR ON_MESSAGE: ", err, debug
def describe(self):
# Descripción general del funcionamiento de la clase Capturador_Gstreamer
descripcion = '''\t\t*** Clase Capturador_Gstreamer *** \n
Esta clase recibe un parámetro entero que indica cada cuantos segundos debe realizar una fotografía.\n
Luego, comenzara a fotografiar y guardar esas imágenes con el nombre de archivo igual a la hora de realizada la fotografía.\n
Mientras la variable estado sea True, continuará realizando esta tarea.'''
return descripcion
class Analiza():
def __init__(self, umbral=160):
pygame.init()
pygame.mixer.quit()
self.umbral = umbral
self.imagenes = []
def analiza_cambios(self, imagen1=None, imagen2=None, u=160):
# recibe una imagen cargada por pygame y analiza las variaciones de color en cada pixel, retornando True o False, según sean cambios grandes o pequeños.
(init_x, init_y, horizontal, vertival) = imagen1.get_bounding_rect()
gris = 0
blanco = 0
negro = 0
for x in range(horizontal):
for y in range(vertival):
(r, g, b, a) = imagen1.get_at((x,y))
(rn, gn, bn, an) = imagen2.get_at((x,y))
dif_rojo = r-rn
dif_verde = g-gn
dif_azul = b-bn
if dif_rojo < -u or dif_rojo > u or dif_verde < -u or dif_verde > u or dif_azul < -u or dif_azul > u:
return True
return False
def set_analisis(self, nombre_de_archivo):
# recibe una dirección de archivo para la imagen a analizar
self.imagenes.append(nombre_de_archivo)
# Esperar a tener 5 imagenes para asegurar que estén completamente guardadas las 2 primeras.
if len(self.imagenes) > 5:
direccion_imagen1 = self.imagenes[0]
direccion_imagen2 = self.imagenes[1]
imagen1 = pygame.image.load(direccion_imagen1)
imagen2 = pygame.image.load(direccion_imagen2)
# compare 1 con 2, si no hay cambios, borrar 1
if not self.analiza_cambios(imagen1=imagen1, imagen2=imagen2, u=self.umbral):
os.system ("rm %s" % (self.imagenes[0]))
self.imagenes.remove(self.imagenes[0])
if __name__ == "__main__":
# frecuencia es cada cuantos segundos debe fotografiar
capturador = Capturador_Gstreamer(frecuencia=2) # 2 para pc normal 4 o más para xo
#print capturador.describe()
capturador.main()
domingo, 19 de septiembre de 2010
Fotografiar con pygst
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
import pygtk, gtk, gobject
import pygst
pygst.require("0.10")
import gst
import time
class Capturador_Gstreamer():
def __init__(self, frecuencia=2):
self.frecuencia = frecuencia
self.hora = time.strftime("%H:%M:%S") # hora de inicio, luego, hora de cada fotografía
# Declaración elemendos para pipeline de fotografía
self.pipeline = None
self.source = None
self.codec = None
self.formato = None
self.filesink = None
self.start_streaming() # levanta el stream
self.estado = True # controla el estado general del programa
def main(self):
while self.estado:
time.sleep(self.frecuencia)
self.get_fotografia()
def get_fotografia(self):
# timer para ejecutar tareas programadas
self.pipeline.set_state(gst.STATE_NULL) # anula el pipeline
self.hora = time.strftime("%H:%M:%S") # obtiene la hora
self.filesink.set_property("location", "%s.png" % (self.hora)) # Cambia nombre de archivo
self.pipeline.set_state(gst.STATE_PLAYING) # Fotografía
return True
def construir_pipeline(self):
# construye el stream de fotografia
self.pipeline = gst.Pipeline("player")
self.source = gst.element_factory_make("v4l2src", "camara") # origen
self.codec = gst.element_factory_make("ffmpegcolorspace", "codec") # formato de video
self.formato = gst.element_factory_make("pngenc", "png") # formato de imagen
self.filesink = gst.element_factory_make("filesink", "filesink") # salida
self.filesink.set_property("location", "%s.png" % (self.hora))
self.pipeline.add(self.source, self.codec, self.formato, self.filesink) # armar el pipeline
gst.element_link_many(self.source, self.codec, self.formato, self.filesink) # entubar los elementos
def start_streaming(self):
# Ejecuta el stream
self.construir_pipeline() # construye el pipeline
self.bus = self.pipeline.get_bus() # obtiene el bus de mensajes
self.bus.add_signal_watch() # escucha las señales en el bus
self.bus.connect("message", self.on_message) # conecta los mensajes al manejador de señales
def on_message(self, bus, message):
# mensajes en el bus
if message.type == gst.MESSAGE_ERROR:
err, debug = message.parse_error()
print "ERROR ON_MESSAGE: ", err, debug
def describe(self):
# Descripción general del funcionamiento de la clase Capturador_Gstreamer
descripcion = '''\t\t*** Clase Capturador_Gstreamer *** \n
if __name__ == "__main__":
# frecuencia es cada cuantos segundos debe fotografiar
capturador = Capturador_Gstreamer(frecuencia=2)
print capturador.describe()
capturador.main()
# -*- coding: utf-8 -*-
# Capturador_Gstreamer.py (versión 1)
# por Flavio Danesse (fdanesse@hotmail.com)
# CeibalJAM! - Uruguayimport sys, os
import pygtk, gtk, gobject
import pygst
pygst.require("0.10")
import gst
import time
class Capturador_Gstreamer():
def __init__(self, frecuencia=2):
self.frecuencia = frecuencia
self.hora = time.strftime("%H:%M:%S") # hora de inicio, luego, hora de cada fotografía
# Declaración elemendos para pipeline de fotografía
self.pipeline = None
self.source = None
self.codec = None
self.formato = None
self.filesink = None
self.start_streaming() # levanta el stream
self.estado = True # controla el estado general del programa
def main(self):
while self.estado:
time.sleep(self.frecuencia)
self.get_fotografia()
def get_fotografia(self):
# timer para ejecutar tareas programadas
self.pipeline.set_state(gst.STATE_NULL) # anula el pipeline
self.hora = time.strftime("%H:%M:%S") # obtiene la hora
self.filesink.set_property("location", "%s.png" % (self.hora)) # Cambia nombre de archivo
self.pipeline.set_state(gst.STATE_PLAYING) # Fotografía
return True
def construir_pipeline(self):
# construye el stream de fotografia
self.pipeline = gst.Pipeline("player")
self.source = gst.element_factory_make("v4l2src", "camara") # origen
self.codec = gst.element_factory_make("ffmpegcolorspace", "codec") # formato de video
self.formato = gst.element_factory_make("pngenc", "png") # formato de imagen
self.filesink = gst.element_factory_make("filesink", "filesink") # salida
self.filesink.set_property("location", "%s.png" % (self.hora))
self.pipeline.add(self.source, self.codec, self.formato, self.filesink) # armar el pipeline
gst.element_link_many(self.source, self.codec, self.formato, self.filesink) # entubar los elementos
def start_streaming(self):
# Ejecuta el stream
self.construir_pipeline() # construye el pipeline
self.bus = self.pipeline.get_bus() # obtiene el bus de mensajes
self.bus.add_signal_watch() # escucha las señales en el bus
self.bus.connect("message", self.on_message) # conecta los mensajes al manejador de señales
def on_message(self, bus, message):
# mensajes en el bus
if message.type == gst.MESSAGE_ERROR:
err, debug = message.parse_error()
print "ERROR ON_MESSAGE: ", err, debug
def describe(self):
# Descripción general del funcionamiento de la clase Capturador_Gstreamer
descripcion = '''\t\t*** Clase Capturador_Gstreamer *** \n
Esta clase recibe un parámetro entero que indica cada cuantos segundos debe realizar una fotografía.\n
Luego, comenzara a fotografiar y guardar esas imágenes con el nombre de archivo igual a la hora de realizada la fotografía.\n
Mientras la variable estado sea True, continuará realizando esta tarea.'''
return descripcionif __name__ == "__main__":
# frecuencia es cada cuantos segundos debe fotografiar
capturador = Capturador_Gstreamer(frecuencia=2)
print capturador.describe()
capturador.main()
sábado, 18 de septiembre de 2010
Testeo de Audio con pygst
#!/usr/bin/python
import pygst
pygst.require("0.10")
import gst
import pygtk
import gtk
class Main:
def __init__(self):
self.pipeline = gst.Pipeline("mypipeline")
self.audiotestsrc = gst.element_factory_make("audiotestsrc", "audio")
self.sink = gst.element_factory_make("alsasink", "sink")
self.pipeline.add(self.sink)
self.audiotestsrc.link(self.sink)
self.pipeline.set_state(gst.STATE_PLAYING)
start=Main()
gtk.main()
import pygst
pygst.require("0.10")
import gst
import pygtk
import gtk
class Main:
def __init__(self):
self.pipeline = gst.Pipeline("mypipeline")
self.audiotestsrc = gst.element_factory_make("audiotestsrc", "audio")
self.audiotestsrc.set_property ("freq", 500)
self.pipeline.add(self.audiotestsrc)self.sink = gst.element_factory_make("alsasink", "sink")
self.pipeline.add(self.sink)
self.audiotestsrc.link(self.sink)
self.pipeline.set_state(gst.STATE_PLAYING)
start=Main()
gtk.main()
inspect de v4l2src en gstreamer
gst-inspect -0.10 v4l2src
Factory Details:
Long name: Video (video4linux2/raw) Source
Class: Source/Video
Description: Reads raw frames from a video4linux2 (BT8x8) device
Author(s): Ronald Bultje <rbultje@ronald.bitfreak.net>, Edgard Lima <edgard.lima@indt.org.br>
Rank: none (0)
Plugin Details:
Name: video4linux2
Description: elements for Video 4 Linux
Filename: /usr/lib/gstreamer-0.10/libgstvideo4linux2.so
Version: 0.10.5
License: LGPL
Source module: gst-plugins-good
Binary package: Fedora Core gstreamer-plugins-good package
Origin URL: http://download.fedora.redhat.com/fedora
GObject
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstPushSrc
+----GstV4l2Src
Implemented Interfaces:
GstVideoOrientation
GstPropertyProbe
GstImplementsInterface
GstTuner
GstColorBalance
Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
video/x-raw-rgb
bpp: 8
depth: 8
red_mask: 224
green_mask: 28
blue_mask: 3
endianness: 1234
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 16
depth: 15
red_mask: 31744
green_mask: 992
blue_mask: 31
endianness: 1234
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 16
depth: 16
red_mask: 63488
green_mask: 2016
blue_mask: 31
endianness: 1234
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 16
depth: 15
red_mask: 31744
green_mask: 992
blue_mask: 31
endianness: 4321
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 16
depth: 16
red_mask: 63488
green_mask: 2016
blue_mask: 31
endianness: 4321
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 24
depth: 24
red_mask: 255
green_mask: 65280
blue_mask: 16711680
endianness: 4321
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 24
depth: 24
red_mask: 16711680
green_mask: 65280
blue_mask: 255
endianness: 4321
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 32
depth: 32
red_mask: 255
green_mask: 65280
blue_mask: 16711680
endianness: 4321
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-rgb
bpp: 32
depth: 32
red_mask: -16777216
green_mask: 16711680
blue_mask: 65280
endianness: 4321
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: YVU9
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: YV12
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: YUY2
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: UYVY
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: Y42B
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: Y41B
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: Y41P
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: YUV9
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-raw-yuv
format: I420
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
image/jpeg
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
image/jpeg
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
video/x-dv
systemstream: true
width: [ 1, 32768 ]
height: [ 1, 32768 ]
framerate: [ 0/1, 100/1 ]
Element Flags:
no flags set
Element Implementation:
No loopfunc(), must be chain-based or not configured yet
Has change_state() function: gst_base_src_change_state
Has custom save_thyself() function: gst_element_save_thyself
Has custom restore_thyself() function: gst_element_restore_thyself
Element has no clocking capabilities.
Element has no indexing capabilities.
Pads:
SRC: 'src'
Implementation:
Has getrangefunc(): gst_base_src_pad_get_range
Has custom eventfunc(): gst_base_src_event_handler
Has custom queryfunc(): gst_base_src_query
Pad Template: 'src'
Element Properties:
name : The name of the object
flags: readable, writable
String. Default: null Current: "v4l2src0"
blocksize : Size in bytes to read per buffer (0 = default)
flags: readable, writable
Unsigned Long. Range: 0 - 4294967295 Default: 4096 Current: 4096
num-buffers : Number of buffers to output before sending EOS
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: -1 Current: -1
typefind : Run typefind before negotiating
flags: readable, writable
Boolean. Default: false Current: false
device : Device location
flags: readable, writable
String. Default: "/dev/video0" Current: "/dev/video0"
device-name : Name of the device
flags: readable
String. Default: null Current: "cafe_ccic"
flags : Device type flags
flags: readable
Flags "GstV4l2DeviceTypeFlags" Current: 0, "(none)"
(0x00000001): capture - Device supports video capture
(0x00000002): output - Device supports video playback
(0x00000004): overlay - Device supports video overlay
(0x00000010): vbi-capture - Device supports the VBI capture
(0x00000020): vbi-output - Device supports the VBI output
(0x00010000): tuner - Device has a tuner or modulator
(0x00020000): audio - Device has audio inputs or outputs
inspect de pngenc en gstreamer
gst-inspect-0.10 pngenc
Factory Details:
Long name: PNG image encoder
Class: Codec/Encoder/Image
Description: Encode a video frame to a .png image
Author(s): Jeremy SIMON <jsimon13@yahoo.fr>
Rank: none (0)
Plugin Details:
Name: png
Description: PNG plugin library
Filename: /usr/lib/gstreamer-0.10/libgstpng.so
Version: 0.10.5
License: LGPL
Source module: gst-plugins-good
Binary package: Fedora Core gstreamer-plugins-good package
Origin URL: http://download.fedora.redhat.com/fedora
GObject
+----GstObject
+----GstElement
+----GstPngEnc
Pad Templates:
SINK template: 'sink'
Availability: Always
Capabilities:
video/x-raw-rgb
bpp: 32
depth: 32
endianness: 4321
red_mask: -16777216
green_mask: 16711680
blue_mask: 65280
alpha_mask: 255
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
video/x-raw-rgb
bpp: 24
depth: 24
endianness: 4321
red_mask: 16711680
green_mask: 65280
blue_mask: 255
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
SRC template: 'src'
Availability: Always
Capabilities:
image/png
width: [ 16, 4096 ]
height: [ 16, 4096 ]
framerate: [ 0/1, 2147483647/1 ]
Element Flags:
no flags set
Element Implementation:
No loopfunc(), must be chain-based or not configured yet
Has change_state() function: gst_element_change_state_func
Has custom save_thyself() function: gst_element_save_thyself
Has custom restore_thyself() function: gst_element_restore_thyself
Element has no clocking capabilities.
Element has no indexing capabilities.
Pads:
SRC: 'src'
Implementation:
Pad Template: 'src'
SINK: 'sink'
Implementation:
Has chainfunc(): 0xb78b0440
Pad Template: 'sink'
Element Properties:
name : The name of the object
flags: readable, writable
String. Default: null Current: "pngenc0"
snapshot : Send EOS after encoding a frame, useful for snapshots
flags: readable, writable
Boolean. Default: true Current: true
compression-level : PNG compression level
flags: readable, writable
Unsigned Integer. Range: 0 - 9 Default: 6 Current: 6
Factory Details:
Long name: PNG image encoder
Class: Codec/Encoder/Image
Description: Encode a video frame to a .png image
Author(s): Jeremy SIMON <jsimon13@yahoo.fr>
Rank: none (0)
Plugin Details:
Name: png
Description: PNG plugin library
Filename: /usr/lib/gstreamer-0.10/libgstpng.so
Version: 0.10.5
License: LGPL
Source module: gst-plugins-good
Binary package: Fedora Core gstreamer-plugins-good package
Origin URL: http://download.fedora.redhat.com/fedora
GObject
+----GstObject
+----GstElement
+----GstPngEnc
Pad Templates:
SINK template: 'sink'
Availability: Always
Capabilities:
video/x-raw-rgb
bpp: 32
depth: 32
endianness: 4321
red_mask: -16777216
green_mask: 16711680
blue_mask: 65280
alpha_mask: 255
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
video/x-raw-rgb
bpp: 24
depth: 24
endianness: 4321
red_mask: 16711680
green_mask: 65280
blue_mask: 255
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
SRC template: 'src'
Availability: Always
Capabilities:
image/png
width: [ 16, 4096 ]
height: [ 16, 4096 ]
framerate: [ 0/1, 2147483647/1 ]
Element Flags:
no flags set
Element Implementation:
No loopfunc(), must be chain-based or not configured yet
Has change_state() function: gst_element_change_state_func
Has custom save_thyself() function: gst_element_save_thyself
Has custom restore_thyself() function: gst_element_restore_thyself
Element has no clocking capabilities.
Element has no indexing capabilities.
Pads:
SRC: 'src'
Implementation:
Pad Template: 'src'
SINK: 'sink'
Implementation:
Has chainfunc(): 0xb78b0440
Pad Template: 'sink'
Element Properties:
name : The name of the object
flags: readable, writable
String. Default: null Current: "pngenc0"
snapshot : Send EOS after encoding a frame, useful for snapshots
flags: readable, writable
Boolean. Default: true Current: true
compression-level : PNG compression level
flags: readable, writable
Unsigned Integer. Range: 0 - 9 Default: 6 Current: 6
inspect de filesrc gstreamer
gst-inspect-0.10 filesrc
Factory Details:
Long name: File Source
Class: Source/File
Description: Read from arbitrary point in a file
Author(s): Erik Walthinsen <omega@cse.ogi.edu>
Rank: primary (256)
Plugin Details:
Name: coreelements
Description: standard GStreamer elements
Filename: /usr/lib/gstreamer-0.10/libgstcoreelements.so
Version: 0.10.12
License: LGPL
Source module: gstreamer
Binary package: Fedora Core gstreamer package
Origin URL: http://download.fedora.redhat.com/fedora
GObject
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstFileSrc
Implemented Interfaces:
GstURIHandler
Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
ANY
Element Flags:
no flags set
Element Implementation:
No loopfunc(), must be chain-based or not configured yet
Has change_state() function: gst_base_src_change_state
Has custom save_thyself() function: gst_element_save_thyself
Has custom restore_thyself() function: gst_element_restore_thyself
Element has no clocking capabilities.
Element has no indexing capabilities.
Pads:
SRC: 'src'
Implementation:
Has getrangefunc(): gst_base_src_pad_get_range
Has custom eventfunc(): gst_base_src_event_handler
Has custom queryfunc(): gst_base_src_query
Pad Template: 'src'
Element Properties:
name : The name of the object
flags: readable, writable
String. Default: null Current: "filesrc0"
blocksize : Size in bytes to read per buffer (0 = default)
flags: readable, writable
Unsigned Long. Range: 0 - 4294967295 Default: 4096 Current: 4096
num-buffers : Number of buffers to output before sending EOS
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: -1 Current: -1
typefind : Run typefind before negotiating
flags: readable, writable
Boolean. Default: false Current: false
location : Location of the file to read
flags: readable, writable
String. Default: null Current: null
fd : File-descriptor for the file being mmap()d
flags: readable
Integer. Range: 0 - 2147483647 Default: 0 Current: 0
mmapsize : Size in bytes of mmap()d regions
flags: readable, writable
Unsigned Long. Range: 0 - 4294967295 Default: 4194304 Current: 4194304
sequential : Whether to use madvise to hint to the kernel that access to mmap pages will be sequential
flags: readable, writable
Boolean. Default: false Current: false
touch : Touch mmapped data regions to force them to be read from disk
flags: readable, writable
Boolean. Default: true Current: true
use-mmap : Whether to use mmap() instead of read()
flags: readable, writable
Boolean. Default: false Current: false
Factory Details:
Long name: File Source
Class: Source/File
Description: Read from arbitrary point in a file
Author(s): Erik Walthinsen <omega@cse.ogi.edu>
Rank: primary (256)
Plugin Details:
Name: coreelements
Description: standard GStreamer elements
Filename: /usr/lib/gstreamer-0.10/libgstcoreelements.so
Version: 0.10.12
License: LGPL
Source module: gstreamer
Binary package: Fedora Core gstreamer package
Origin URL: http://download.fedora.redhat.com/fedora
GObject
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstFileSrc
Implemented Interfaces:
GstURIHandler
Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
ANY
Element Flags:
no flags set
Element Implementation:
No loopfunc(), must be chain-based or not configured yet
Has change_state() function: gst_base_src_change_state
Has custom save_thyself() function: gst_element_save_thyself
Has custom restore_thyself() function: gst_element_restore_thyself
Element has no clocking capabilities.
Element has no indexing capabilities.
Pads:
SRC: 'src'
Implementation:
Has getrangefunc(): gst_base_src_pad_get_range
Has custom eventfunc(): gst_base_src_event_handler
Has custom queryfunc(): gst_base_src_query
Pad Template: 'src'
Element Properties:
name : The name of the object
flags: readable, writable
String. Default: null Current: "filesrc0"
blocksize : Size in bytes to read per buffer (0 = default)
flags: readable, writable
Unsigned Long. Range: 0 - 4294967295 Default: 4096 Current: 4096
num-buffers : Number of buffers to output before sending EOS
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: -1 Current: -1
typefind : Run typefind before negotiating
flags: readable, writable
Boolean. Default: false Current: false
location : Location of the file to read
flags: readable, writable
String. Default: null Current: null
fd : File-descriptor for the file being mmap()d
flags: readable
Integer. Range: 0 - 2147483647 Default: 0 Current: 0
mmapsize : Size in bytes of mmap()d regions
flags: readable, writable
Unsigned Long. Range: 0 - 4294967295 Default: 4194304 Current: 4194304
sequential : Whether to use madvise to hint to the kernel that access to mmap pages will be sequential
flags: readable, writable
Boolean. Default: false Current: false
touch : Touch mmapped data regions to force them to be read from disk
flags: readable, writable
Boolean. Default: true Current: true
use-mmap : Whether to use mmap() instead of read()
flags: readable, writable
Boolean. Default: false Current: false
Sistema gstreamer Instalado en xo 1 (Uruguay)
gst-inspect-0.10
icydemux: icydemux: ICY tag demuxer
smpte: smpte: SMPTE transitions
gnomevfs: gnomevfssink: GnomeVFS Sink
gnomevfs: gnomevfssrc: GnomeVFS Source
annodex: cmmldec: CMML stream decoder
annodex: cmmlenc: CMML streams encoder
halelements: halaudiosrc: HAL audio source
halelements: halaudiosink: HAL audio sink
videoscale: videoscale: Video scaler
videorate: videorate: Video rate adjuster
alphacolor: alphacolor: Alpha color filter
videobox: videobox: Video box filter
adder: adder: Adder
efence: efence: Electric Fence
level: level: Level
videobalance: videobalance: Video balance
apetag: apedemux: APE tag demuxer
vorbis: vorbistag: VorbisTag
vorbis: vorbisparse: VorbisParse
vorbis: vorbisdec: Vorbis audio decoder
vorbis: vorbisenc: Vorbis audio encoder
autodetect: autoaudiosink: Auto audio sink
autodetect: autovideosink: Auto video sink
theora: theoraparse: TheoraParse
theora: theoraenc: Theora video encoder
theora: theoradec: Theora video decoder
jpeg: smokedec: Smoke video decoder
jpeg: smokeenc: Smoke video encoder
jpeg: jpegdec: JPEG image decoder
jpeg: jpegenc: JPEG image encoder
gconfelements: gconfaudiosrc: GConf audio source
gconfelements: gconfaudiosink: GConf audio sink
gconfelements: gconfvideosrc: GConf video source
gconfelements: gconfvideosink: GConf video sink
auparse: auparse: AU audio demuxer
shout2send: shout2send: Icecast network sink
flxdec: flxdec: FLX audio decoder
gdkpixbuf: gdkpixbufscale: GdkPixbuf image scaler
gdkpixbuf: gdkpixbufdec: GdkPixbuf image decoder
pango: textrender: Text renderer
pango: clockoverlay: Clock overlay
pango: timeoverlay: Time overlay
pango: textoverlay: Text overlay
mulaw: mulawdec: Mu Law audio decoder
mulaw: mulawenc: Mu Law audio encoder
videomixer: videomixer: Video mixer
wavenc: wavenc: WAV audio muxer
audiofx: audiopanorama: AudioPanorama
navigationtest: navigationtest: Video navigation test
coreelements: multiqueue: MultiQueue
coreelements: typefind: TypeFind
coreelements: tee: Tee pipe fitting
coreelements: filesink: File Sink
coreelements: queue: Queue
coreelements: identity: Identity
coreelements: filesrc: File Source
coreelements: fdsink: Filedescriptor Sink
coreelements: fdsrc: Disk Source
coreelements: fakesink: Fake Sink
coreelements: fakesrc: Fake Source
coreelements: capsfilter: CapsFilter
id3demux: id3demux: ID3 tag demuxer
ffmpegcolorspace: ffmpegcolorspace: FFMPEG Colorspace converter
goom: goom: GOOM: what a GOOM!
audiorate: audiorate: Audio rate adjuster
alpha: alpha: Alpha filter
audioconvert: audioconvert: Audio converter
audioresample: audioresample: Audio scaler
coreindexers: fileindex: A index that stores entries in file
coreindexers: memindex: A index that stores entries in memory
volume: volume: Volume
xvimagesink: xvimagesink: Video sink
multipart: multipartmux: Multipart muxer
multipart: multipartdemux: Multipart demuxer
cutter: cutter: Audio cutter
flac: flacdec: FLAC audio decoder
flac: flacenc: FLAC audio encoder
video4linux: v4lsrc: Video (video4linux/raw) Source
wavparse: wavparse: WAV audio demuxer
rtsp: rtpdec: RTP Decoder
rtsp: rtspsrc: RTSP packet receiver
ximagesrc: ximagesrc: Ximage video source
matroska: matroskamux: Matroska muxer
matroska: matroskademux: Matroska demuxer
debug: testsink: Test plugin
debug: progressreport: Progress report
debug: navseek: Seek based on left-right arrows
debug: breakmydata: Break my data
taglib: apev2mux: TagLib-based APEv2 Muxer
taglib: id3v2mux: TagLib-based ID3v2 Muxer
audiotestsrc: audiotestsrc: Audio test source
videotestsrc: videotestsrc: Video test source
cairo: cairotimeoverlay: Time overlay
cairo: cairotextoverlay: Text overlay
ossaudio: osssink: Audio Sink (OSS)
ossaudio: osssrc: Audio Source (OSS)
ossaudio: ossmixer: OSS Mixer
typefindfunctions: video/vivo: viv
typefindfunctions: application/x-mmsh: no extensions
typefindfunctions: multipart/x-mixed-replace: no extensions
typefindfunctions: video/x-dirac: no extensions
typefindfunctions: application/x-ms-dos-executable: dll, exe, ocx, sys, scr, msstyles, cpl
typefindfunctions: application/x-ar: a
typefindfunctions: application/x-tar: tar
typefindfunctions: application/x-rar: rar
typefindfunctions: audio/x-wavpack-correction: wvc
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-spc: spc
typefindfunctions: adts_mpeg_stream: aac
typefindfunctions: application/x-executable: no extensions
typefindfunctions: text/x-cmml: no extensions
typefindfunctions: application/x-ogg-skeleton: no extensions
typefindfunctions: audio/x-speex: no extensions
typefindfunctions: application/x-ogm-text: no extensions
typefindfunctions: application/x-ogm-audio: no extensions
typefindfunctions: application/x-ogm-video: no extensions
typefindfunctions: video/x-theora: no extensions
typefindfunctions: audio/x-vorbis: no extensions
typefindfunctions: audio/x-flac: flac
typefindfunctions: application/x-compress: Z
typefindfunctions: application/zip: zip
typefindfunctions: application/x-gzip: gz
typefindfunctions: application/x-bzip: bz2
typefindfunctions: image/x-sun-raster: ras
typefindfunctions: image/x-xpixmap: xpm
typefindfunctions: image/x-jng: jng
typefindfunctions: video/x-mng: mng
typefindfunctions: image/x-xcf: xcf
typefindfunctions: audio/x-sid: sid
typefindfunctions: audio/iLBC-sh: ilbc
typefindfunctions: audio/x-amr-wb-sh: amr
typefindfunctions: audio/x-amr-nb-sh: amr
typefindfunctions: video/x-dv: dv, dif
typefindfunctions: video/x-mve: mve
typefindfunctions: video/x-matroska: mkv, mka
typefindfunctions: image/tiff: tif, tiff
typefindfunctions: image/bmp: bmp
typefindfunctions: image/png: png
typefindfunctions: image/gif: gif
typefindfunctions: image/jpeg: jpg, jpe, jpeg
typefindfunctions: application/x-ape: ape
typefindfunctions: audio/x-shorten: shn
typefindfunctions: audio/x-w64: w64
typefindfunctions: audio/x-ircam: sf
typefindfunctions: audio/x-sds: sds
typefindfunctions: audio/x-voc: voc
typefindfunctions: audio/x-nist: nist
typefindfunctions: audio/x-paris: paf
typefindfunctions: audio/x-svx: iff, svx
typefindfunctions: audio/x-aiff: aiff, aif, aifc
typefindfunctions: audio/x-wav: wav
typefindfunctions: application/xml: xml
typefindfunctions: application/smil: smil
typefindfunctions: text/uri-list: ram
typefindfunctions: text/plain: txt
typefindfunctions: video/x-flv: flv
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: application/x-pn-realaudio: ra, ram, rm, rmvb
typefindfunctions: application/vnd.rn-realmedia: ra, ram, rm, rmvb
typefindfunctions: text/html: htm, html
typefindfunctions: image/x-quicktime: qif, qtif, qti
typefindfunctions: video/quicktime: mov
typefindfunctions: application/x-3gp: 3gp
typefindfunctions: audio/x-m4a: m4a
typefindfunctions: video/x-nuv: nuv
typefindfunctions: video/mpeg4: m4v
typefindfunctions: video/mpeg-stream: mpv, mpeg, mpg
typefindfunctions: video/mpeg: mpv, mpeg, mpg
typefindfunctions: application/ogg: anx, ogg, ogm
typefindfunctions: video/mpegts: ts
typefindfunctions: video/mpeg2: mpe, mpeg, mpg
typefindfunctions: video/mpeg1: mpe, mpeg, mpg
typefindfunctions: audio/x-ac3: ac3
typefindfunctions: audio/mpeg: mp3, mp2, mp1, mpga
typefindfunctions: audio/x-mod: 669, amf, dsm, gdm, far, imf, it, med, mod, mtm, okt, sam, s3m, stm, stx, ult, xm
typefindfunctions: audio/x-ttafile: tta
typefindfunctions: application/x-apetag: ape, mpc, wv
typefindfunctions: application/x-id3v1: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: application/x-id3v2: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: video/x-fli: flc, fli
typefindfunctions: video/x-vcd: dat
typefindfunctions: video/x-cdxa: dat
typefindfunctions: video/x-msvideo: avi
typefindfunctions: audio/x-au: au, snd
typefindfunctions: audio/x-musepack: mpc
typefindfunctions: video/x-ms-asf: asf, wm, wma, wmv
udp: udpsrc: UDP packet receiver
udp: dynudpsink: UDP packet sender
udp: multiudpsink: UDP packet sender
udp: udpsink: UDP packet sender
tcp: multifdsink: Multi filedescriptor sink
tcp: tcpserversrc: TCP server source
tcp: tcpserversink: TCP server sink
tcp: tcpclientsrc: TCP client source
tcp: tcpclientsink: TCP client sink
ximagesink: ximagesink: Video sink
rtp: rtpvorbispay: RTP packet depayloader
rtp: rtpvorbisdepay: RTP packet depayloader
rtp: rtptheorapay: RTP packet depayloader
rtp: rtptheoradepay: RTP packet depayloader
rtp: rtpsv3vdepay: RTP packet depayloader
rtp: rtpspeexdepay: RTP packet depayloader
rtp: rtpspeexpay: RTP packet payloader
rtp: rtpmp4gpay: RTP packet payloader
rtp: rtpmp4gdepay: RTP packet depayloader
rtp: rtpmp4vdepay: RTP packet depayloader
rtp: rtpmp4vpay: RTP packet payloader
rtp: rtpmp2tdepay: RTP packet depayloader
rtp: asteriskh263: RTP packet parser
rtp: rtph264depay: RTP packet depayloader
rtp: rtph263pay: RTP packet payloader
rtp: rtph263pdepay: RTP packet depayloader
rtp: rtph263ppay: RTP packet payloader
rtp: rtpmpapay: RTP packet payloader
rtp: rtpmpadepay: RTP packet depayloader
rtp: rtppcmapay: RTP packet payloader
rtp: rtppcmupay: RTP packet payloader
rtp: rtppcmudepay: RTP packet depayloader
rtp: rtppcmadepay: RTP packet depayloader
rtp: rtpamrpay: RTP packet payloader
rtp: rtpamrdepay: RTP packet depayloader
rtp: rtpgsmpay: RTP GSM audio payloader
rtp: rtpgsmdepay: RTP packet depayloader
rtp: rtpilbcdepay: RTP iLBC packet depayloader
rtp: rtpilbcpay: RTP Payloader for iLBC Audio
rtp: rtpdepay: RTP payloader
png: pngenc: PNG image encoder
png: pngdec: PNG image decoder
ogg: oggaviparse: Ogg AVI parser
ogg: oggparse: Ogg parser
ogg: ogmtextparse: OGM text stream parser
ogg: ogmvideoparse: OGM video stream parser
ogg: ogmaudioparse: OGM audio stream parser
ogg: oggmux: Ogg muxer
ogg: oggdemux: Ogg demuxer
decodebin: decodebin: Decoder Bin
subparse: ssaparse: SSA Subtitle Parser
subparse: subparse: Subtitle parser
subparse: subparse_typefind: srt, sub, mpsub, mdvd, smi, txt
video4linux2: v4l2src: Video (video4linux2/raw) Source
cdio: cdiocddasrc: CD audio source (CDDA)
1394: dv1394src: Firewire (1394) DV video source
gdp: gdppay: GDP Payloader
gdp: gdpdepay: GDP Depayloader
playbin: playbin: Player Bin
speex: speexdec: Speex audio decoder
speex: speexenc: Speex audio encoder
videoflip: videoflip: Video flipper
dv: dvdec: DV video decoder
dv: dvdemux: DV system stream demuxer
avi: avimux: Avi muxer
avi: avidemux: Avi demuxer
effectv: quarktv: QuarkTV effect
effectv: revtv: RevTV effect
effectv: vertigotv: VertigoTV effect
effectv: shagadelictv: ShagadelicTV
effectv: warptv: WarpTV effect
effectv: dicetv: DiceTV effect
effectv: agingtv: AgingTV effect
effectv: edgetv: EdgeTV effect
alsa: alsasink: Audio sink (ALSA)
alsa: alsasrc: Audio source (ALSA)
alsa: alsamixer: Alsa mixer
alaw: alawdec: A Law audio decoder
alaw: alawenc: A Law audio encoder
decodebin2: decodebin2: Decoder Bin
staticelements: bin: Generic bin
staticelements: pipeline: Pipeline object
Total count: 77 plugins, 268 features
icydemux: icydemux: ICY tag demuxer
smpte: smpte: SMPTE transitions
gnomevfs: gnomevfssink: GnomeVFS Sink
gnomevfs: gnomevfssrc: GnomeVFS Source
annodex: cmmldec: CMML stream decoder
annodex: cmmlenc: CMML streams encoder
halelements: halaudiosrc: HAL audio source
halelements: halaudiosink: HAL audio sink
videoscale: videoscale: Video scaler
videorate: videorate: Video rate adjuster
alphacolor: alphacolor: Alpha color filter
videobox: videobox: Video box filter
adder: adder: Adder
efence: efence: Electric Fence
level: level: Level
videobalance: videobalance: Video balance
apetag: apedemux: APE tag demuxer
vorbis: vorbistag: VorbisTag
vorbis: vorbisparse: VorbisParse
vorbis: vorbisdec: Vorbis audio decoder
vorbis: vorbisenc: Vorbis audio encoder
autodetect: autoaudiosink: Auto audio sink
autodetect: autovideosink: Auto video sink
theora: theoraparse: TheoraParse
theora: theoraenc: Theora video encoder
theora: theoradec: Theora video decoder
jpeg: smokedec: Smoke video decoder
jpeg: smokeenc: Smoke video encoder
jpeg: jpegdec: JPEG image decoder
jpeg: jpegenc: JPEG image encoder
gconfelements: gconfaudiosrc: GConf audio source
gconfelements: gconfaudiosink: GConf audio sink
gconfelements: gconfvideosrc: GConf video source
gconfelements: gconfvideosink: GConf video sink
auparse: auparse: AU audio demuxer
shout2send: shout2send: Icecast network sink
flxdec: flxdec: FLX audio decoder
gdkpixbuf: gdkpixbufscale: GdkPixbuf image scaler
gdkpixbuf: gdkpixbufdec: GdkPixbuf image decoder
pango: textrender: Text renderer
pango: clockoverlay: Clock overlay
pango: timeoverlay: Time overlay
pango: textoverlay: Text overlay
mulaw: mulawdec: Mu Law audio decoder
mulaw: mulawenc: Mu Law audio encoder
videomixer: videomixer: Video mixer
wavenc: wavenc: WAV audio muxer
audiofx: audiopanorama: AudioPanorama
navigationtest: navigationtest: Video navigation test
coreelements: multiqueue: MultiQueue
coreelements: typefind: TypeFind
coreelements: tee: Tee pipe fitting
coreelements: filesink: File Sink
coreelements: queue: Queue
coreelements: identity: Identity
coreelements: filesrc: File Source
coreelements: fdsink: Filedescriptor Sink
coreelements: fdsrc: Disk Source
coreelements: fakesink: Fake Sink
coreelements: fakesrc: Fake Source
coreelements: capsfilter: CapsFilter
id3demux: id3demux: ID3 tag demuxer
ffmpegcolorspace: ffmpegcolorspace: FFMPEG Colorspace converter
goom: goom: GOOM: what a GOOM!
audiorate: audiorate: Audio rate adjuster
alpha: alpha: Alpha filter
audioconvert: audioconvert: Audio converter
audioresample: audioresample: Audio scaler
coreindexers: fileindex: A index that stores entries in file
coreindexers: memindex: A index that stores entries in memory
volume: volume: Volume
xvimagesink: xvimagesink: Video sink
multipart: multipartmux: Multipart muxer
multipart: multipartdemux: Multipart demuxer
cutter: cutter: Audio cutter
flac: flacdec: FLAC audio decoder
flac: flacenc: FLAC audio encoder
video4linux: v4lsrc: Video (video4linux/raw) Source
wavparse: wavparse: WAV audio demuxer
rtsp: rtpdec: RTP Decoder
rtsp: rtspsrc: RTSP packet receiver
ximagesrc: ximagesrc: Ximage video source
matroska: matroskamux: Matroska muxer
matroska: matroskademux: Matroska demuxer
debug: testsink: Test plugin
debug: progressreport: Progress report
debug: navseek: Seek based on left-right arrows
debug: breakmydata: Break my data
taglib: apev2mux: TagLib-based APEv2 Muxer
taglib: id3v2mux: TagLib-based ID3v2 Muxer
audiotestsrc: audiotestsrc: Audio test source
videotestsrc: videotestsrc: Video test source
cairo: cairotimeoverlay: Time overlay
cairo: cairotextoverlay: Text overlay
ossaudio: osssink: Audio Sink (OSS)
ossaudio: osssrc: Audio Source (OSS)
ossaudio: ossmixer: OSS Mixer
typefindfunctions: video/vivo: viv
typefindfunctions: application/x-mmsh: no extensions
typefindfunctions: multipart/x-mixed-replace: no extensions
typefindfunctions: video/x-dirac: no extensions
typefindfunctions: application/x-ms-dos-executable: dll, exe, ocx, sys, scr, msstyles, cpl
typefindfunctions: application/x-ar: a
typefindfunctions: application/x-tar: tar
typefindfunctions: application/x-rar: rar
typefindfunctions: audio/x-wavpack-correction: wvc
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-spc: spc
typefindfunctions: adts_mpeg_stream: aac
typefindfunctions: application/x-executable: no extensions
typefindfunctions: text/x-cmml: no extensions
typefindfunctions: application/x-ogg-skeleton: no extensions
typefindfunctions: audio/x-speex: no extensions
typefindfunctions: application/x-ogm-text: no extensions
typefindfunctions: application/x-ogm-audio: no extensions
typefindfunctions: application/x-ogm-video: no extensions
typefindfunctions: video/x-theora: no extensions
typefindfunctions: audio/x-vorbis: no extensions
typefindfunctions: audio/x-flac: flac
typefindfunctions: application/x-compress: Z
typefindfunctions: application/zip: zip
typefindfunctions: application/x-gzip: gz
typefindfunctions: application/x-bzip: bz2
typefindfunctions: image/x-sun-raster: ras
typefindfunctions: image/x-xpixmap: xpm
typefindfunctions: image/x-jng: jng
typefindfunctions: video/x-mng: mng
typefindfunctions: image/x-xcf: xcf
typefindfunctions: audio/x-sid: sid
typefindfunctions: audio/iLBC-sh: ilbc
typefindfunctions: audio/x-amr-wb-sh: amr
typefindfunctions: audio/x-amr-nb-sh: amr
typefindfunctions: video/x-dv: dv, dif
typefindfunctions: video/x-mve: mve
typefindfunctions: video/x-matroska: mkv, mka
typefindfunctions: image/tiff: tif, tiff
typefindfunctions: image/bmp: bmp
typefindfunctions: image/png: png
typefindfunctions: image/gif: gif
typefindfunctions: image/jpeg: jpg, jpe, jpeg
typefindfunctions: application/x-ape: ape
typefindfunctions: audio/x-shorten: shn
typefindfunctions: audio/x-w64: w64
typefindfunctions: audio/x-ircam: sf
typefindfunctions: audio/x-sds: sds
typefindfunctions: audio/x-voc: voc
typefindfunctions: audio/x-nist: nist
typefindfunctions: audio/x-paris: paf
typefindfunctions: audio/x-svx: iff, svx
typefindfunctions: audio/x-aiff: aiff, aif, aifc
typefindfunctions: audio/x-wav: wav
typefindfunctions: application/xml: xml
typefindfunctions: application/smil: smil
typefindfunctions: text/uri-list: ram
typefindfunctions: text/plain: txt
typefindfunctions: video/x-flv: flv
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: application/x-pn-realaudio: ra, ram, rm, rmvb
typefindfunctions: application/vnd.rn-realmedia: ra, ram, rm, rmvb
typefindfunctions: text/html: htm, html
typefindfunctions: image/x-quicktime: qif, qtif, qti
typefindfunctions: video/quicktime: mov
typefindfunctions: application/x-3gp: 3gp
typefindfunctions: audio/x-m4a: m4a
typefindfunctions: video/x-nuv: nuv
typefindfunctions: video/mpeg4: m4v
typefindfunctions: video/mpeg-stream: mpv, mpeg, mpg
typefindfunctions: video/mpeg: mpv, mpeg, mpg
typefindfunctions: application/ogg: anx, ogg, ogm
typefindfunctions: video/mpegts: ts
typefindfunctions: video/mpeg2: mpe, mpeg, mpg
typefindfunctions: video/mpeg1: mpe, mpeg, mpg
typefindfunctions: audio/x-ac3: ac3
typefindfunctions: audio/mpeg: mp3, mp2, mp1, mpga
typefindfunctions: audio/x-mod: 669, amf, dsm, gdm, far, imf, it, med, mod, mtm, okt, sam, s3m, stm, stx, ult, xm
typefindfunctions: audio/x-ttafile: tta
typefindfunctions: application/x-apetag: ape, mpc, wv
typefindfunctions: application/x-id3v1: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: application/x-id3v2: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: video/x-fli: flc, fli
typefindfunctions: video/x-vcd: dat
typefindfunctions: video/x-cdxa: dat
typefindfunctions: video/x-msvideo: avi
typefindfunctions: audio/x-au: au, snd
typefindfunctions: audio/x-musepack: mpc
typefindfunctions: video/x-ms-asf: asf, wm, wma, wmv
udp: udpsrc: UDP packet receiver
udp: dynudpsink: UDP packet sender
udp: multiudpsink: UDP packet sender
udp: udpsink: UDP packet sender
tcp: multifdsink: Multi filedescriptor sink
tcp: tcpserversrc: TCP server source
tcp: tcpserversink: TCP server sink
tcp: tcpclientsrc: TCP client source
tcp: tcpclientsink: TCP client sink
ximagesink: ximagesink: Video sink
rtp: rtpvorbispay: RTP packet depayloader
rtp: rtpvorbisdepay: RTP packet depayloader
rtp: rtptheorapay: RTP packet depayloader
rtp: rtptheoradepay: RTP packet depayloader
rtp: rtpsv3vdepay: RTP packet depayloader
rtp: rtpspeexdepay: RTP packet depayloader
rtp: rtpspeexpay: RTP packet payloader
rtp: rtpmp4gpay: RTP packet payloader
rtp: rtpmp4gdepay: RTP packet depayloader
rtp: rtpmp4vdepay: RTP packet depayloader
rtp: rtpmp4vpay: RTP packet payloader
rtp: rtpmp2tdepay: RTP packet depayloader
rtp: asteriskh263: RTP packet parser
rtp: rtph264depay: RTP packet depayloader
rtp: rtph263pay: RTP packet payloader
rtp: rtph263pdepay: RTP packet depayloader
rtp: rtph263ppay: RTP packet payloader
rtp: rtpmpapay: RTP packet payloader
rtp: rtpmpadepay: RTP packet depayloader
rtp: rtppcmapay: RTP packet payloader
rtp: rtppcmupay: RTP packet payloader
rtp: rtppcmudepay: RTP packet depayloader
rtp: rtppcmadepay: RTP packet depayloader
rtp: rtpamrpay: RTP packet payloader
rtp: rtpamrdepay: RTP packet depayloader
rtp: rtpgsmpay: RTP GSM audio payloader
rtp: rtpgsmdepay: RTP packet depayloader
rtp: rtpilbcdepay: RTP iLBC packet depayloader
rtp: rtpilbcpay: RTP Payloader for iLBC Audio
rtp: rtpdepay: RTP payloader
png: pngenc: PNG image encoder
png: pngdec: PNG image decoder
ogg: oggaviparse: Ogg AVI parser
ogg: oggparse: Ogg parser
ogg: ogmtextparse: OGM text stream parser
ogg: ogmvideoparse: OGM video stream parser
ogg: ogmaudioparse: OGM audio stream parser
ogg: oggmux: Ogg muxer
ogg: oggdemux: Ogg demuxer
decodebin: decodebin: Decoder Bin
subparse: ssaparse: SSA Subtitle Parser
subparse: subparse: Subtitle parser
subparse: subparse_typefind: srt, sub, mpsub, mdvd, smi, txt
video4linux2: v4l2src: Video (video4linux2/raw) Source
cdio: cdiocddasrc: CD audio source (CDDA)
1394: dv1394src: Firewire (1394) DV video source
gdp: gdppay: GDP Payloader
gdp: gdpdepay: GDP Depayloader
playbin: playbin: Player Bin
speex: speexdec: Speex audio decoder
speex: speexenc: Speex audio encoder
videoflip: videoflip: Video flipper
dv: dvdec: DV video decoder
dv: dvdemux: DV system stream demuxer
avi: avimux: Avi muxer
avi: avidemux: Avi demuxer
effectv: quarktv: QuarkTV effect
effectv: revtv: RevTV effect
effectv: vertigotv: VertigoTV effect
effectv: shagadelictv: ShagadelicTV
effectv: warptv: WarpTV effect
effectv: dicetv: DiceTV effect
effectv: agingtv: AgingTV effect
effectv: edgetv: EdgeTV effect
alsa: alsasink: Audio sink (ALSA)
alsa: alsasrc: Audio source (ALSA)
alsa: alsamixer: Alsa mixer
alaw: alawdec: A Law audio decoder
alaw: alawenc: A Law audio encoder
decodebin2: decodebin2: Decoder Bin
staticelements: bin: Generic bin
staticelements: pipeline: Pipeline object
Total count: 77 plugins, 268 features
Video por la red con gstreamer
Enviar:
gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)2/1 ! ffmpegcolorspace ! smokeenc keyframe=8 qmax=40 ! udpsink host=192.168.1.1 port=5000
Recibir:
gst-launch udpsrc port=5000 ! smokedec ! autovideosink
gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)2/1 ! ffmpegcolorspace ! smokeenc keyframe=8 qmax=40 ! udpsink host=192.168.1.1 port=5000
Recibir:
gst-launch udpsrc port=5000 ! smokedec ! autovideosink
Guia de uso de pygst
Guia de uso de pygst.
El siguiente documento explica la implementación de gstreamer en python sobre gtk, utilizando la interfaz pygst. (El código de ejemplo es CeibalMedia.activity(0.0).xo)
Recepción de video por la red y reproducción en widget gtk:
En terminal (recibir sólo video):
gst-launch udpsrc port=5000 ! smokedec ! autovideosink
En pygst (recibir sólo video):
def construir_pipeline(self, ip, puerto):
self.pipeline = gst.Pipeline("player")
# recepcion por UDP
udpsrc = gst.element_factory_make("udpsrc", "udpsrc0")
udpsrc.set_property('port', puerto)
# decodificar
smokedec = gst.element_factory_make("smokedec", "codec5")
sink = gst.element_factory_make("autovideosink", "SalidadeVideoaWidget")
# enlazar
self.pipeline.add(udpsrc, smokedec, sink)
gst.element_link_many(udpsrc, smokedec, sink)
Detalle:
El procedimiento de trabajo con gstreamer es muy sencillo.
Se crea una tubería de elementos donde la salida de cada uno de ellos, se convierte en la entrada para el siguiente.
De esta forma, establecemos un origen de datos, los procesamos y los mandamos a una salida.
En pygst, la tubería se construye a partir de elementos pygst, estos elemento poseen propiedades cuyos valores pueden
establecerse mediante set_property. En este ejemplo en particular, tenemos sólo 3 elementos:
- Origen de datos: udpsrc
- Decodificador: smokedec
- Salida de Video: autovideosink
Envío de Video por la Red:
En terminal (enviar sólo video):
gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)2/1 ! ffmpegcolorspace ! smokeenc keyframe=8 qmax=40 ! udpsink host=192.168.1.5 port=5000
En pygst (enviar sólo video):
def construir_pipeline(self):
self.pipeline = gst.Pipeline("player")
source = gst.element_factory_make("v4l2src", "camara")
codec2 = gst.element_factory_make("videorate", "codec2")
codec3 = gst.element_factory_make("videoscale", "codec3")
codec4 = gst.element_factory_make("ffmpegcolorspace", "codec4")
smokeenc = gst.element_factory_make("smokeenc", "codec5")
smokeenc.set_property('keyframe', 8)
smokeenc.set_property('qmax', 40)
udpsink = gst.element_factory_make("udpsink", "udpsalida")
udpsink.set_property('host', "192.168.1.5")
udpsink.set_property('port', 5000)
self.pipeline.add(source, codec2, codec3, codec4, smokeenc, udpsink)
gst.element_link_many(source, codec2, codec3, codec4, smokeenc, udpsink)
Detalle:
De acuerdo al código que recibe la señal, vemos que en el código de envío, si bien es más extenso, las diferencias son menores:
En el código que recibe la señal, inmediatamente despues del origen de datos (udpsrc), encontramos un decodificador (smokedec) y luego la salida al widget asignado para mostrar los datos.
En el código de envío, en lugar de un decodificador, necesitamos el codificador por eso antes de enviar los datos, tenemos smokeenc, y en lugar de enviar los datos a un widget gtk, los enviamos a la red (udpsink).
Los elementos videorate, videoscale y ffmpegcolorspace establecen el modo de video utilizado y por lo tanto los datos enviados.
En este ejemplo, hemos utilizado los siguientes elementos de gstreamer:
Origen de datos: v4l2src y udpsrc
Filtros: videorate, videoscale y ffmpegcolorspace
Codificadores: smokeenc
Decodificadores: smokedec
Salida de datos: autovideosink y udpsink
De modo que, siquiendo esta mecánica, es muy sencillo implementar pygst , todo depende de los elementos disponibles y del conocimiento que tengamos de éstos. Siempre puedes consultar sobre los elementos gstreamer para saber cuales son sus propiedades o cuales están disponibles en nuestro sistema.
Si por ejemplo deseas saber sobre el elemento videorate, en terminal escribes:
gst-inspect-0.10 videorate
Para saber sobre los elementos disponibles, simplemente escribes:
gst-inspect-0.10
Audio y Video por la red con gstreamer
Enviar:
gst-launch v4l2src ! queue ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)4/1 ! videorate ! videoscale ! ffmpegcolorspace ! queue ! smokeenc ! queue ! udpsink host=192.168.1.1 port=5000 alsasrc ! queue ! audio/x-raw-int,rate=8000,channels=1,depth=8 ! audioconvert ! speexenc ! queue ! tcpserversink host=192.168.1.1 port=5001
Recibir:
gst-launch-0.10 udpsrc port=5000 ! queue ! smokedec ! queue ! autovideosink tcpclientsrc host=192.168.1.5 port=5001 ! queue ! speexdec ! queue ! alsasink sync=false
gst-launch v4l2src ! queue ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)4/1 ! videorate ! videoscale ! ffmpegcolorspace ! queue ! smokeenc ! queue ! udpsink host=192.168.1.1 port=5000 alsasrc ! queue ! audio/x-raw-int,rate=8000,channels=1,depth=8 ! audioconvert ! speexenc ! queue ! tcpserversink host=192.168.1.1 port=5001
Recibir:
gst-launch-0.10 udpsrc port=5000 ! queue ! smokedec ! queue ! autovideosink tcpclientsrc host=192.168.1.5 port=5001 ! queue ! speexdec ! queue ! alsasink sync=false
Video por la red con gstreamer
Enviar:
gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)2/1 ! ffmpegcolorspace ! smokeenc keyframe=8 qmax=40 ! udpsink host=192.168.1.1 port=5000
Recibir:
gst-launch udpsrc port=5000 ! smokedec ! autovideosink
gst-launch v4l2src ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)2/1 ! ffmpegcolorspace ! smokeenc keyframe=8 qmax=40 ! udpsink host=192.168.1.1 port=5000
Recibir:
gst-launch udpsrc port=5000 ! smokedec ! autovideosink
Acceder a la web cam con gstreamer
gst-launch-0.10 v4l2src ! ximagesink
gst-launch-0.10 v4l2src ! video/x-raw-yuv,framerate=15/1,width=320,height=240 ! ffmpegcolorspace ! ximagesink
gst-launch-0.10 v4l2src device=/dev/video0 ! decodebin ! ffmpegcolorspace ! autovideosink
gst-launch-0.10 v4l2src ! video/x-raw-yuv,framerate=15/1,width=320,height=240 ! ffmpegcolorspace ! ximagesink
gst-launch-0.10 v4l2src device=/dev/video0 ! decodebin ! ffmpegcolorspace ! autovideosink
Fotografiar con gstreamer
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=mifoto.png
gst-launch-0.10 v4l2src ! jpegenc ! filesink location=foo.jpg
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=foo.jpg
gst-launch-0.10 v4l2src ! jpegenc ! filesink location=foo.jpg
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=foo.jpg
Video play con gstreamer
Nota:
Reproduce video de cualquier archivo soportado por gstreamer según los plugins instalados en tu sistema.
gst-launch-0.10 filesrc location=2xo2.ogg ! decodebin ! autovideosink
Reproduce video de cualquier archivo soportado por gstreamer según los plugins instalados en tu sistema.
gst-launch-0.10 filesrc location=2xo2.ogg ! decodebin ! autovideosink
Audio play con gstreamer
Nota:
Reproduce audio de cualquier archivo soportado por gstreamer según los plugins instalados en tu sistema:
Reproduce audio de cualquier archivo soportado por gstreamer según los plugins instalados en tu sistema:
gst-launch-0.10 filesrc location=01-MIPC.ogg ! decodebin ! audioconvert ! alsasink
mp3 player utilizando pygst
#!usr/bin/python
# -*- coding: UTF-8 -*-
import sys, os
import pygtk, gtk, gobject
import pygst
pygst.require("0.10")
import gst
class GTK_Main():
def __init__(self):
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("MP3-Player")
window.set_default_size(400, 200)
window.connect("destroy", gtk.main_quit, "WM destroy")
vbox = gtk.VBox()
window.add(vbox)
self.entry = gtk.Entry()
vbox.pack_start(self.entry, False, True)
self.button = gtk.Button("Start")
self.button.connect("clicked", self.start_stop)
vbox.add(self.button)
window.show_all()
self.player = gst.Pipeline("player") # pipeline
source = gst.element_factory_make("filesrc", "file-source") # origen
decoder = gst.element_factory_make("mad", "mp3-decoder") # decoder
conv = gst.element_factory_make("audioconvert", "converter") # conversor
sink = gst.element_factory_make("alsasink", "alsa-output") # salida
self.player.add(source, decoder, conv, sink) # armar el pipeline
gst.element_link_many(source, decoder, conv, sink) # entubar los elementos
bus = self.player.get_bus() # bus del pipeline para poder manejar los datos internos
bus.add_signal_watch() # escuchar las señales en el bus del pipeline
bus.connect("message", self.on_message) # los mensajes son enviados a nuestra funcion "on_message"
def start_stop(self, widget):
# Se ejecuta al hacer click sobre el boton "start"
if self.button.get_label() == "Start":
filepath = self.entry.get_text()
if os.path.isfile(filepath):
self.button.set_label("Stop")
self.player.get_by_name("file-source").set_property("location", filepath)
self.player.set_state(gst.STATE_PLAYING)
else:
self.player.set_state(gst.STATE_NULL)
self.button.set_label("Start")
def on_message(self, bus, message):
# es una retrollamada para los mensajes del bus del pipeline
t = message.type
if t == gst.MESSAGE_EOS:
self.player.set_state(gst.STATE_NULL)
self.button.set_label("Start")
elif t == gst.MESSAGE_ERROR:
self.player.set_state(gst.STATE_NULL)
self.button.set_label("Start")
err, debug = message.parse_error()
print "Error: %s" % err, debug
GTK_Main()
gtk.gdk.threads_init()
gtk.main()
# -*- coding: UTF-8 -*-
import sys, os
import pygtk, gtk, gobject
import pygst
pygst.require("0.10")
import gst
class GTK_Main():
def __init__(self):
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("MP3-Player")
window.set_default_size(400, 200)
window.connect("destroy", gtk.main_quit, "WM destroy")
vbox = gtk.VBox()
window.add(vbox)
self.entry = gtk.Entry()
vbox.pack_start(self.entry, False, True)
self.button = gtk.Button("Start")
self.button.connect("clicked", self.start_stop)
vbox.add(self.button)
window.show_all()
self.player = gst.Pipeline("player") # pipeline
source = gst.element_factory_make("filesrc", "file-source") # origen
decoder = gst.element_factory_make("mad", "mp3-decoder") # decoder
conv = gst.element_factory_make("audioconvert", "converter") # conversor
sink = gst.element_factory_make("alsasink", "alsa-output") # salida
self.player.add(source, decoder, conv, sink) # armar el pipeline
gst.element_link_many(source, decoder, conv, sink) # entubar los elementos
bus = self.player.get_bus() # bus del pipeline para poder manejar los datos internos
bus.add_signal_watch() # escuchar las señales en el bus del pipeline
bus.connect("message", self.on_message) # los mensajes son enviados a nuestra funcion "on_message"
def start_stop(self, widget):
# Se ejecuta al hacer click sobre el boton "start"
if self.button.get_label() == "Start":
filepath = self.entry.get_text()
if os.path.isfile(filepath):
self.button.set_label("Stop")
self.player.get_by_name("file-source").set_property("location", filepath)
self.player.set_state(gst.STATE_PLAYING)
else:
self.player.set_state(gst.STATE_NULL)
self.button.set_label("Start")
def on_message(self, bus, message):
# es una retrollamada para los mensajes del bus del pipeline
t = message.type
if t == gst.MESSAGE_EOS:
self.player.set_state(gst.STATE_NULL)
self.button.set_label("Start")
elif t == gst.MESSAGE_ERROR:
self.player.set_state(gst.STATE_NULL)
self.button.set_label("Start")
err, debug = message.parse_error()
print "Error: %s" % err, debug
GTK_Main()
gtk.gdk.threads_init()
gtk.main()
Suscribirse a:
Entradas (Atom)