I am currently doing:
source_path = 'file:///home/raj/videos/sample.mpg'
descr = 'uridecodebin uri=%s ! videoconvert ! gdkpixbufsink name=sink' % (source_path)
pipeline = Gst.parse_launch(descr)
But instead of using uri
, how can I use a raw file source, such as from source_file = request.POST['file'].file
. (Perhaps that would be loading a video file from a string?)
My research thus far has led me to appsrc
( http://ingo.fargonauten.de/node/447 ), but I am not sure how to use it with GStreamer 1.0, as I cannot figure out how to load the file into the buffer:
raw_src = request.POST['files[]'].file
descr = 'appsrc name=vidsrc ! videoconvert ! gdkpixbufsink name=sink'
pipeline = Gst.parse_launch(descr)
appsrc = pipeline.get_by_name('vidsrc')
appsrc.emit('push-buffer', Gst.Buffer(raw_src.read()) ##I am not creating the buffer correctly for GStreamer 1.0