All, I've been trying to step through frame by frame with one pipeline and pass through to another. Basically I want to look at every h264 frame and then pipe it off into a filesink. I have made an example of what I thought would work below.<code> from gi.repository import Gst, GObject import sys import os import glob def test_file(inc): filename = "jellyfish-25-mbps-hd-h264. elements = {} def demuxer_callback(demuxer, pad): if pad.get_property("template"). pad.link(elements['h264parse'] #GObject.threads_init() Gst.init() Gst.debug_set_active(True) Gst.debug_set_default_ pipeline_front = Gst.Pipeline() pipeline_end = Gst.Pipeline() elements['filesrc'] = Gst.ElementFactory.make(' elements['filesrc'].set_ elements['matroskademux'] = Gst.ElementFactory.make(' elements['matroskademux']. elements['h264parse'] = Gst.ElementFactory.make(' elements['raw1queue'] = Gst.ElementFactory.make(' elements['innersink'] = Gst.ElementFactory.make(' elements['mp4appsrc'] = Gst.ElementFactory.make(' elements['mp4h264parse'] = Gst.ElementFactory.make(' elements['mp4queue'] = Gst.ElementFactory.make(' elements['mp4mux'] = Gst.ElementFactory.make(' elements['mp4mqueue'] = Gst.ElementFactory.make(' elements['mp4filesink'] = Gst.ElementFactory.make(' elements['mp4filesink'].set_ pipeline_front.add(elements[' pipeline_front.add(elements[' pipeline_front.add(elements[' pipeline_front.add(elements[' pipeline_front.add(elements[' pipeline_end.add(elements[' pipeline_end.add(elements[' pipeline_end.add(elements[' pipeline_end.add(elements[' pipeline_end.add(elements[' pipeline_end.add(elements[' elements['filesrc'].link( elements['matroskademux']. elements['h264parse'].link( elements['raw1queue'].link( elements['mp4appsrc'].link( elements['mp4queue'].link( elements['mp4h264parse'].link( elements['mp4mux'].link( elements['mp4mqueue'].link( pipeline_front.set_state(Gst. pipeline_front.set_state(Gst. pipeline_end.set_state(Gst. pipeline_end.set_state(Gst. pipeline_end.set_state(Gst. print 'Front Setup Status:', pipeline_front.get_state(Gst. print 'Start', inc completed = False last = None while True: if not completed: pipeline_front.get_state(Gst. elements['innersink'].send_ inner_sample = elements['innersink'].emit(' inner_buffer = inner_sample.get_buffer() elements['mp4appsrc'].set_ elements['mp4appsrc'].emit(' # Check position for completion # Can't figure out how to tell there are no more frames pos = elements['innersink'].query_ dur = elements['innersink'].query_ print 'Loc:', pos, dur if pos > dur: completed = True if pos == last: completed = True bus = pipeline_front.get_bus() while True: message = bus.pop_filtered(Gst. if not message: break elif message.type in [Gst.MessageType.EOS]: completed = True break # Close stream if completed if completed: elements['mp4appsrc'].emit(' break last = pos pipeline_front.set_state(Gst. pipeline_end.set_state(Gst. print 'End', inc, pos, dur test_file(0) </code> _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
I realized that I'm ending early with pos == last because multiple frames seem to have the same date. Is this supposed to happen? I'm really hoping there is an easy way to determine the end of the stream while in PAUSED mode. Thanks,On Thu, Aug 11, 2016 at 5:10 PM, Brian Panneton <[hidden email]> wrote:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |