<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">Hi,<br><br>I am new with Gstreamer. <br>My requirement is fetch video frame in python code. <br>my code is as:<br><br>def get_frame(path, offset=5, caps=gst.Caps('image/png')):<br>
pipeline = gst.parse_launch('playbin2')<br>
pipeline.props.uri = path<br> pipeline.props.audio_sink = gst.element_factory_make('fakesink')<br> pipeline.props.video_sink = gst.element_factory_make('fakesink')<br> pipeline.set_state(gst.STATE_PAUSED)<br>
# Wait for state change to finish.<br> pipeline.get_state()<br> assert pipeline.seek_simple(<br> gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, offset * gst.SECOND)<br> # Wait for seek to finish.<br> print pipeline.get_state()<br>
b = pipeline.emit('convert-frame', caps)<br> pipeline.set_state(gst.STATE_NULL)<br> return b<br><br>def main():<br> url = "<a href="https://s3.amazonaws.com/veromuse/vermose_DFu9Ug_Akon-RightNow(NaNaNa).mp4" target="_blank">https://s3.amazonaws.com/veromuse/vermose_DFu9Ug_Akon-RightNow(NaNaNa).mp4</a>"<br>
buf = get_frame(url)<br> with file('frame_abhiss.png', 'w') as fh:<br> fh.write(bytes(buf))<br> <br>if __name__ == '__main__':<br> main()<br><br>Here i'm getting "None" at pipeline.emit('convert-frame', caps). it is work properly in my local machine. I'm raaly didt know what is going wrong on amazon EC2.<br>
<br>i used these command to install the plugins:<br>sudo apt-get install python-gst0.10 gstreamer0.10-plugins-good \<br> gstreamer0.10-plugins-ugly<br><br>Here i'm using the s3 url for fetching the video frame. and want to save frame it into Amazon s3.<br>
<br>Please suggest me. <br>Thanks in advance.<span class="HOEnZb"></span><br></div></div><br>-- <br>Regards<br>Abhishek Jain<br><br>
</div>