title: How to create an indexed video file with Gstreamer
body: <p>I'm trying to use Gstreamer to create a seekable (indexed) video file in Linux. My pipelines work for recording and saving the data, but I can't figure out how to index the data so I can seek using gst_element_seek_simple() [<a href="http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+4%3A+Time+management]" rel="nofollow noreferrer">http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+4%3A+Time+management]</a></p>
  
  <p>I have seen this post: <a href="https://stackoverflow.com/questions/16077047/gstreamer-video-output-position-tracking-and-seeking">Gstreamer video output position tracking and seeking</a> and validated I am sending an EOS on the pipeline with -e. </p>
  
  <p>Here is my pipeline and output. I'm teeing it to display both to my embedded system's screen and save to the M4V file.</p>
  
  <pre><code># gst-launch-0.10 -e v4l2src ! \
      tee name=t ! 
      queue ! 
      video/x-raw-yuv,width=320,height=240 ! 
      videoflip method=clockwise ! 
      ffmpegcolorspace ! 
      fbdevsink t. ! 
      queue ! 
      ffmpegcolorspace ! 
      ffenc_mpeg4 ! 
      filesink location=output.m4v
  </code></pre>
  
  <p>Here is the output: </p>
  
  <pre><code>Setting pipeline to PAUSED ...
  Pipeline is live and does not need PREROLL ...
  WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not get parameters on device '/dev/video0'
  Additional debug info:
  v4l2src_calls.c(235): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
  system error: Inappropriate ioctl for device
  Setting pipeline to PLAYING ...
  New clock: GstSystemClock
  ^CCaught interrupt -- handling interrupt.
  Interrupt: Stopping pipeline ...
  
  (gst-launch-0.10:534): GLib-CRITICAL **: Source ID 62 was not found when attempting to remove it
  EOS on shutdown enabled -- Forcing EOS on the pipeline
  Waiting for EOS...
  Got EOS from element "pipeline0".
  EOS received - stopping pipeline...
  Execution ended after 10057977251 ns.
  Setting pipeline to PAUSED ...
  Setting pipeline to READY ...
  Setting pipeline to NULL ...
  Freeing pipeline ...
  </code></pre>
  
  <p>And here is the output of gst-discover on my new file:</p>
  
  <pre><code>beaglebone:# gst-discoverer-0.10 output.m4v 
  Analyzing file:///output.m4v
  Done discovering file:///output.m4v
  
  Topology:
    video: MPEG-4 Video
  
  Properties:
    Duration: 0:00:00.000000000
    Seekable: no
  </code></pre>
  
  <p>Thanks</p>