<div dir="ltr"><div><div><br clear="all"><div><div><div>Hi,<br><br></div>Given a video file, I am trying to play the video from a given start time to a given end time.<br></div>I am trying to achieve this using <b>Segment Event</b> as follows:<br><br></div><div>1. Firstly, I am creating and initialising a segment.<br></div><div>2. Created a segment event using <b>gst_event_new_segment()</b><br></div><div>3. Send the segment event to the pipeline using <b>gst_element_send_event()</b><br><br></div><div>But, The video just plays from the beginning and not from the start time.<br></div><div>The
 segment event does not have an effect on the playback eventhough the 
event is reaching the sink element of the pipeline (verified by gst 
debug messages).<br><br></div>Following is the code-snippet:<br><br>    GstSegment *gstSegment;<br>    GstEvent *event_seg;<br><br>    gstSegment = gst_segment_new();<br>    gst_segment_init( gstSegment, GST_FORMAT_BYTES );<br>    gstSegment->rate  = 2.0;<br>    gstSegment->start = 10 * 1920 * 1080 * 2;     <br>    gstSegment->stop = 20 * 1920 * 1080 * 2;     <br>  <br>    event_seg =  gst_event_new_segment(gstSegment);<br><br>    ret = gst_element_set_state (data.videoPipeline, GST_STATE_PLAYING);<br>    if (ret == GST_STATE_CHANGE_FAILURE) {<br>        printf("Unable to set the pipeline to the playing state\n");<br>        gst_object_unref (data.videoPipeline);<br>        return 1;<br>    }<br><br>    if ( !gst_element_send_event( GST_ELEMENT (data.videoPipeline), event_seg))<br>      printf("Error"); <br><br></div>If I use, SEEK event it works fine, but Segment event does not.  How does SEGMENT event differ from SEEK event?<br><br></div>Thanks in advance. <br><div><br><div>-- <br><div class="gmail_signature"><div dir="ltr"><div><br>Regards,<br></div>Sujata<br></div></div>
</div></div></div>