I have created a mjpeg stream. I have embedded content length in between the two jpeg frames [between footer of first frame and header of the next frame].
[MJPEG STREAM]
|
V
...
----------
JPEG FRAME
(Image)
----------
Content-length
(Text)
----------
JPEG FRAME
(Image)
----------
Content-length
(Text)
----------
JPEG FRAME
(Image)
----------
...
|
V
I am able to play the video using gstreamer-java, gstreamer C API and gst-launch. However I am trying to parse the content-length text in gstreamer-java. I tried "meta tags" but that doesn't yield any result I need
I play mjpeg stream that I created as follows
gst-launch -v souphttpsrc location="<ip>:<port>/<cgi_bin folder>/<name>.cgi" do-timestamp=true is_live=true ! multipartdemux ! jpegdec ! ffmpegcolorspace ! autovideosink
I tried meta tags using
gst-launch -v souphttpsrc location="<ip>:<port>/<cgi_bin folder>/<name>.cgi" do-timestamp=true is_live=true ! multipartdemux ! jpegdec ! fakesink -t
and this
gst-launch -v souphttpsrc location="<ip>:<port>/<cgi_bin folder>/<name>.cgi" do-timestamp=true is_live=true ! fakesink -t
However the output of this media pipeline is something like the following
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain ******* < (557568
bytes, timestamp: 0:00:06.895505695, duration: none, offset: -1, offset_end: -1, flags:
0) 0x9a82818"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain ******* < (557568
bytes, timestamp: 0:00:06.941328354, duration: none, offset: -1, offset_end: -1, flags:
0) 0x9a6f6e0"
As it can be seen no content-length. :( . I use WireShark and see data packets containing content-length. Subsequently I wrote a separate Java Code (with no gstreamer plugins) and I can parse the stream to get the content length. However this is not the ideal method as I want the content-length corresponding to the exact frame keeping in view the synchronization.
I have written tees before for C API code. I am wondering if tee would work in this instance!