0

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() [http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+4%3A+Time+management]

I have seen this post: Gstreamer video output position tracking and seeking and validated I am sending an EOS on the pipeline with -e.

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.

# 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

Here is the output:

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 ...

And here is the output of gst-discover on my new file:

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

Thanks

Community
  • 1
  • 1
linsek
  • 3,334
  • 9
  • 42
  • 55

1 Answers1

1

You need to store the result in a seekable/indexed format. For that you can put the mpeg4 video inside a container such as mp4 or matroska. Use "! mp4mux ! filesink" or "! matroskamux ! filesink" to have it inside those formats that should make it seekable.

Side notes: gstreamer 0.10 is over 2 years obsolete and unmantained, please upgrade to 1.0. http://gstreamer.freedesktop.org/ is the official gstreamer website and you will find the releases for 1.x versions there. The gstreamer.com website is a project is not related to the official project and, if you read the text in gstreamer.com, you will see that you should be using the official repository and installers.

thiagoss
  • 2,034
  • 13
  • 8
  • This was precisely the problem. Adding the mp4mux plugin before the filesink generated an indexed video file. Unfortunately, the constraints of my project do not allow me to use the latest gstreamer-1.0, but all the capabilities I need exist in 0.10. Thanks for your help! – linsek Jan 13 '15 at 16:07