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 |
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 |
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 |
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 |
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 > 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 |
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. |
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 |
Free forum by Nabble | Edit this page |