Đã Hủy

Gstreamer Python - sync-message::element dont work

I want insert any video input and make segmentation to hls .ts with python and gstreamer.

I'm trying with python code below, but i can not receiving the sync-message::element, the video file is generated but dont call on_element function with structure name GstMultiFileSink to divide de video, it's generate only one video file. which leads me To believe that something is missing in my gstreamer command.

#! /usr/bin/python

import sys, time

import gi


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

from [url removed, login to view] import GObject, Gst, GstVideo

[url removed, login to view](None)

class HLS:

def __init__(self, output_folder, seg_duration=10):

[url removed, login to view] = 'test'

self.segment_count = 0

self.last_stream_time = 0

self.seg_duration = seg_duration

[url removed, login to view] = None

[url removed, login to view] = None

[url removed, login to view] = False

self.output_folder = output_folder

def on_eos(self, bus, msg):

print 'EOS reached'

self.pipeline.set_state([url removed, login to view])

[url removed, login to view] = True

def on_error(self, bus, msg):

error = msg.parse_error()

print '*** ERROR *** :', error[1]

self.pipeline.set_state([url removed, login to view])

def on_element(self, bus, msg):

structure = msg.get_structure()

print structure.get_name()

if structure.get_name() != "GstMultiFileSink":


#filename = structure['filename']

#duration = [url removed, login to view]['stream-time'] - self.last_stream_time

self.last_stream_time = structure['stream-time']


def create_pipeline(self):

print "Creating pipeline with:\nsrc: " + [url removed, login to view]

#it's only a test

[url removed, login to view] = Gst.parse_launch("urisourcebin uri=[url removed, login to view]@156521/[url removed, login to view] ! multifilesink location="+self.output_folder+"/%[url removed, login to view] sync=true next-file=key-unit-event post-messages=true")

[url removed, login to view] = self.pipeline.get_bus()



[url removed, login to view]('sync-message::eos', self.on_eos)

[url removed, login to view]('sync-message::error', self.on_error)

[url removed, login to view]('sync-message::element', self.on_element)

self.pipeline.set_state([url removed, login to view])


self.pipeline.set_state([url removed, login to view])

def request_new_segment(self):

self.segment_count += 1

target_time = self.last_stream_time + (self.seg_duration * [url removed, login to view])

print "Requesting new segment [" + str(self.segment_count) + "] at: " + str(target_time)

self.pipeline.send_event (GstVideo.video_event_new_upstream_force_key_unit(running_time=target_time, all_headers=True, count=self.segment_count))

test = HLS('/root/teste')


[url removed, login to view](50)

Kỹ năng: Python, Chiếu video

Xem thêm: python gstreamer install, gstreamer python windows, gstreamer 1.0 python, python gst, python gstreamer video example, python gstreamer 1.0 tutorial, gstreamer python opencv, python import gst, rollovers dont work right, joomla login dont work, mysite dont work flash10, ijoomla magazine dont work

Về Bên Thuê:
( 0 nhận xét ) Brazil

Mã Dự Án: #14873795

7 freelancer đang chào giá trung bình R$817 cho công việc này

R$75 BRL trong 1 ngày
(17 Đánh Giá)
R$4444 BRL trong 1 ngày
(2 Đánh Giá)
R$75 BRL trong 1 ngày
(2 Đánh Giá)
R$90 BRL trong 1 ngày
(1 Đánh Giá)
R$75 BRL trong 1 ngày
(3 Đánh Giá)

Our team of experts will get this work done as per requirement. Relevant Skills and Experience Python, C++, Java, Matlab Proposed Milestones R$888 BRL - The work can be done as per requirement after the final discuss Thêm

R$888 BRL trong 10 ngày
(1 Đánh Giá)
R$75 BRL trong 1 ngày
(0 Đánh Giá)