Where'd the timestamps go?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Where'd the timestamps go?

Wes Miller
Administrator
I have been using soaphttpsrc to gather a live mjpeg stream from an Axis camera server.  I use gst-launch to execute the capture and pipe it to  filesink with and without various muxings and demuxings etc.

 

When I examine the file, even the rawest capture. there’s no timestamp information.  Where’d it go?

 

Wesley
Reply | Threaded
Open this post in threaded view
|

Re: Where'd the timestamps go?

Wes Miller
Administrator
I found the answer!  Wish I could say the search was painless.

I saved an MJPEG stream file using  gst-launch souphttpsrc ! multipartdemux ! matroskamux ! filesink

I then parsed the file using a Rexx program breaking out JPEGs by locating the 0xFFD8 delimiters, then parsed each JPEG looking for FFFE comment delimiters.  The second comment at offset 21 contains the date.  The date is at offset 27 and is coded in hex as Unix Time, seconds since 1970:01:01:00:00:00.

Wes
Reply | Threaded
Open this post in threaded view
|

Re: Where'd the timestamps go?

Tim-Philipp Müller-2
In reply to this post by Wes Miller
On Thu, 2010-04-08 at 06:53 -0800, Wes Miller wrote:

> I have been using soaphttpsrc to gather a live mjpeg stream from an Axis
> camera server.  I use gst-launch to execute the capture and pipe it to
> filesink with and without various muxings and demuxings etc.
>
> When I examine the file, even the rawest capture. there’s no timestamp
> information.  Where’d it go?

Were there any timestamps to start with (at the GStreamer level)? In
general, you can look at timestamps of buffers passing through a
pipeline either by inserting an identity element into the pipeline, or
piping buffers into fakesink, and then passing the -v option to
gst-launch, e.g.:

 gst-launch-0.10 -v filesrc location=foo.mkv ! matroskademux ! fakesink

There should be timestamps at the container level. I don't think
GStreamer will use the date/time information you found for
synchronisation purposes. If you pipe jpegs into a 'raw' .mjpeg file
without any container, your timestamps are basically lost.

Cheers
 -Tim


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Where'd the timestamps go?

Wes Miller
Administrator
Tim,

Yes, the example pipeline you supplied

      gst-launch-0.10 -v filesrc location=foo.mkv ! matroskademux ! fakesink


shows that there are timestamps in the stream.  Any idea where they are and how I can get at them in the byte offset into the frame or at the FFxx taged field in the frame sense?

Wes
Reply | Threaded
Open this post in threaded view
|

Re: Where'd the timestamps go?

Stefan Sauer
In reply to this post by Wes Miller
hi,

Wes Miller wrote:

> I found the answer!  Wish I could say the search was painless.
>
> I saved an MJPEG stream file using  gst-launch souphttpsrc ! multipartdemux
> ! matroskamux ! filesink
>
> I then parsed the file using a Rexx program breaking out JPEGs by locating
> the 0xFFD8 delimiters, then parsed each JPEG looking for FFFE comment
> delimiters.  The second comment at offset 21 contains the date.  The date is
> at offset 27 and is coded in hex as Unix Time, seconds since
> 1970:01:01:00:00:00.
>
> Wes
>  
what you are talking about are not timestamps as in buffer-timestamps.
You are talking about stream metadata which gstreamer emits as
tag-messages and distributes in the pipline as tag-events. You can use
gst-launch -t ... to see the tags printed (as the application would see
them). The metadata that you look into seem to be ordinary jpeg
comments. If you have recent enough gst-plugin-bad jpegparse should
handle them:
gst-launch -t souphttpsrc ! multipartdemux ! jpegparse ! fakesink
Does it work? No its unlikely that all of them would be mapped to a
matroska. I guess only the first or last comment will end up there.

That leaves the big question, what is it that you actually would like to
do :) ?

Stefan

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Where'd the timestamps go?

Wes Miller
Administrator
What i want is to copy a single jpeg image t some to be given timestamp from a saved MJPEG-in-a-matroska-file a into a jpg file.  Actually, to pick out a list of individual frames from the saved stream and put them individually into separate jpg files and then later to reassemble them.  A crude foorm of stream editing to be fancied up later.

My problem is that i just seem to be missing the ah-ha moment on writing gstreams in programs.  The book gets me mouth wateringly close but I can't quite yet form the questions into word that it isn't answering.  As I learn/figure out more....  Unless someone wants to volunteer a pretty complete example of connecting up sometimes and request pads in C.  :-)

In the mean time, I'd like to analyze the stream-in-a-file outside gstreamer to pick out the frame I want.  So knowing where it stuck the timestamp would help.  Only problem is, where ever it is stuck it is not ASCII.  A hex dump of the file is massively unhelpful until you learn the flags and find where the content "elements" are in the file.  e.g. FFD8 starts a new jpeg.

Reply | Threaded
Open this post in threaded view
|

Re: Where'd the timestamps go?

Stefan Sauer
hi,
Wes Miller wrote:
> What i want is to copy a single jpeg image t some to be given timestamp from
> a saved MJPEG-in-a-matroska-file a into a jpg file.  Actually, to pick out a
> list of individual frames from the saved stream and put them individually
> into separate jpg files and then later to reassemble them.  A crude foorm of
> stream editing to be fancied up later.
>  
So you have a mkv file of lets say 100 frames and you like to have
frames 5, 36 and 82 saved to individual jpegs?
Some ideas:
- you can write an application that does:
 - filesrc location="file.mkv" ! mkvdemux ! appsink
 - save the wanted buffers to separate files from the appsink callback
- or
  - filesrc location="file.mkv" ! mkvdemux ! multifilesink
  - have a buffer probe on the video src-pad of mkv and drop all not
wanted frames
- or
 ...

Stefan

> My problem is that i just seem to be missing the ah-ha moment on writing
> gstreams in programs.  The book gets me mouth wateringly close but I can't
> quite yet form the questions into word that it isn't answering.  As I
> learn/figure out more....  Unless someone wants to volunteer a pretty
> complete example of connecting up sometimes and request pads in C.  :-)
>
> In the mean time, I'd like to analyze the stream-in-a-file outside gstreamer
> to pick out the frame I want.  So knowing where it stuck the timestamp would
> help.  Only problem is, where ever it is stuck it is not ASCII.  A hex dump
> of the file is massively unhelpful until you learn the flags and find where
> the content "elements" are in the file.  e.g. FFD8 starts a new jpeg.
>
>
>  


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel