MJPG camera to hlssink

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

MJPG camera to hlssink

Jerry Geis-2
I am trying to get the MJPG stream from a camera and convert to hlssink.
I have tried multiple command lines - not getting it to work.

gst-launch-1.0 souphttpsrc location=http://192.168.1.104/mjpg/video.mjpg is-live=true '!' decodebin '!' rtpjpegdepay '!' videoconvert '!' h264parse '!' queue '!' mpegtsmux '!' hlssink playlist-root=https://192.168.1.18/~silentm/hlssink location=/home/silentm/public_html/hlssink/hlssink.camera.0.%05d.ts target-duration=1 max-files=3 playlist-length=2 playlist-location=/home/silentm/public_html/hlssink/playlist.camera.0.m3u8

What am I missing to get this to work?
Thanks,

Jerry

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Nicolas Dufresne-5


Le 18 nov. 2017 9:18 PM, "Jerry Geis" <[hidden email]> a écrit :
I am trying to get the MJPG stream from a camera and convert to hlssink.
I have tried multiple command lines - not getting it to work.

gst-launch-1.0 souphttpsrc location=http://192.168.1.104/mjpg/video.mjpg is-live=true '!' decodebin '!' rtpjpegdepay '!' videoconvert '!' h264parse '!' queue '!' mpegtsmux '!' hlssink playlist-root=https://192.168.1.18/~silentm/hlssink location=/home/silentm/public_html/hlssink/hlssink.camera.0.%05d.ts target-duration=1 max-files=3 playlist-length=2 playlist-location=/home/silentm/public_html/hlssink/playlist.camera.0.m3u8

What am I missing to get this to work?
Thanks,

Sending RTP over HTTP is unusual for a camera. The problem is the placement of rtpjpegdepay after decodebin. I live in doubt, I would say remove that depayloader to test. If it's really RTP,  you'll need rtpstreamdepay ! rtpjpegdepay! decodebin. You'll also need a caps filter with the clock rate set.

It could also be multipart, see multipart remix.


Jerry

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Jerry Geis-2
In reply to this post by Jerry Geis-2


gst-launch-1.0 souphttpsrc location=http://192.168.1.104/mjpg/video.mjpg is-live=true '!' decodebin '!' rtpjpegdepay '!' videoconvert '!' h264parse '!' queue '!' mpegtsmux '!' hlssink playlist-root=https://192.168.1.18/~silentm/hlssink location=/home/silentm/public_html/hlssink/hlssink.camera.0.%05d.ts target-duration=1 max-files=3 playlist-length=2 playlist-location=/home/silentm/public_html/hlssink/playlist.camera.0.m3u8


Hi  Nicolas,
Your are right. I verified with -vvv that its multipart image JPEG from the stream.
I am still not certain how to change the pipe to take that and convert to h264 for hlssink? Can you provide a example?
Thanks!

Jerry

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Nicolas Dufresne-5
Le dimanche 19 novembre 2017 à 10:16 -0500, Jerry Geis a écrit :

> >
> > gst-launch-1.0 souphttpsrc location=http://192.168.1.104/mjpg/video
> > .mjpg is-live=true '!' decodebin '!' rtpjpegdepay '!' videoconvert
> > '!' h264parse '!' queue '!' mpegtsmux '!' hlssink playlist-root=htt
> > ps://192.168.1.18/~silentm/hlssink
> > location=/home/silentm/public_html/hlssink/hlssink.camera.0.%05d.ts target-duration=1 max-files=3 playlist-length=2 playlist-location=/home/silentm/public_html/hlssink/playlist.camera.0.m3u8
> >
> >
> >
>
> Hi  Nicolas,
> Your are right. I verified with -vvv that its multipart image JPEG
> from the stream.
> I am still not certain how to change the pipe to take that and
> convert to h264 for hlssink? Can you provide a example?
> Thanks!

So, what you want to do is receive, demux, decode from jpeg, encode to
H264, mux into transport stream (TS) and then pass on the hlssink. So
something similar to:

  souphttsrc ! multipartdemux ! jpegdec ! h264enc ! mpegtsmux ! hlssink

That's nearly a pipeline, but then you need to pick your H264 encoder
(h264enc is not a plugin), and the element is something that will vary
per installation. If you have a fully GPL installation (or personal
installation), you could use the very good encoder called x264enc (from
gst-plugins-bad). Touch aspect is to pick the params you want, here's
something that should generally work, but quality may be poor, play
with the bitrate to improve.

  ... ! x264enc tune=zerolatency bitrate=... ! ...

If you have Intel hardware, and the VAAPI plugins installed, you could
use your hardware:

  ... ! vaapih264enc bitrate=.. ! ...


If you have NVidia hardware, and NVENC plugins (from gst-plugins-bad)
installed (not completely sure of the name for this one):

  .. ! nvh264enc ?? ! ...

If you have a PC and your distro has adhere to ship the completely free
OpenH264 Cisco encoder:

  .. ! openh264enc ! ...

On RPi platforms, or many other OMX base boards:

  .. ! omxh264enc ! ...

On mainline supported ARM platforms (e.g. Qualcomm, Exynos, IMX.6), you
could try your luck with (requires git master, upcoming 1.14):

  .. ! v4l2h264enc ! ...

And there is countless other options, parameters, also CODEC you could
consider.

regards,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Jerry Geis-2
In reply to this post by Jerry Geis-2
Hi Nicolas.

Thanks!  So I changed everything to this:
gst-launch-1.0 souphttpsrc location=http://192.168.1.104/mjpg/video.mjpg is-live=true '!' multipartdemux '!' jpegdec '!' openh264enc '!' mpegtsmux '!' hlssink playlist-root=https://192.168.1.8/~silentm/hlssink location=/home/silentm/public_html/hlssink/hlssink.camera.0.%05d.ts target-duration=1 max-files=3 playlist-length=2 playlist-location=/home/silentm/public_html/hlssink/playlist.camera.0.m3u8

I see the ts file but only 1. It just keeps growing. It never changes to a next file.
Do I have something wrong? it should quickly rotate between three files.

Thanks,

Jerry



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Nicolas Dufresne-5
Le dimanche 19 novembre 2017 à 13:38 -0500, Jerry Geis a écrit :
> Hi Nicolas.
>
> Thanks!  So I changed everything to this:
> gst-launch-1.0 souphttpsrc location=http://192.168.1.104/mjpg/video.mjpg is-live=true '!' multipartdemux '!' jpegdec '!' openh264enc '!' mpegtsmux '!' hlssink playlist-root=https://192.168.1.8/~silentm/hlssink location=/home/silentm/public_html/hlssink/hlssink.camera.0.%05d.ts target-duration=1 max-files=3 playlist-length=2 playlist-location=/home/silentm/public_html/hlssink/playlist.camera.0.m3u8
>
> I see the ts file but only 1. It just keeps growing. It never changes to a next file.
> Do I have something wrong? it should quickly rotate between three files.

I'm not sure these settings will work very well considering how HLS
works, a bit agressive, and limit out of spec.

But other then tat, I just tested with v4l2src (my webcam) since I
didn't have a network cam to test with, and it just worked really
(1.12.3). Have you made sure that your souphttpsrc ! multipartdemux
worked fine ?

Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: MJPG camera to hlssink

North48
In reply to this post by Jerry Geis-2

Hi Jerry,

 

Just some thoughts that might help.  Go with these numbers to get it up and running:

 

max-files=10                      Default is 10 and Wowza recommends you have a total of 50 seconds of video or # of files x duration. 

target-duration=3            Default is 15. I use 3 seconds and Wowza claims you can go as low as 0.5

playlist-length=3              Default is 5 and must be >=3 and I suspect this is your problem

 

check out https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-6.3.3

 

 

Cheers,

Dayle

 

 

From: gstreamer-devel [mailto:[hidden email]] On Behalf Of Jerry Geis
Sent: Sunday, November 19, 2017 1:39 PM
To: [hidden email]
Subject: Re: MJPG camera to hlssink

 

Hi Nicolas.

 

Thanks!  So I changed everything to this:

gst-launch-1.0 souphttpsrc location=http://192.168.1.104/mjpg/video.mjpg is-live=true '!' multipartdemux '!' jpegdec '!' openh264enc '!' mpegtsmux '!' hlssink playlist-root=https://192.168.1.8/~silentm/hlssink location=/home/silentm/public_html/hlssink/hlssink.camera.0.%05d.ts target-duration=1 max-files=3 playlist-length=2 playlist-location=/home/silentm/public_html/hlssink/playlist.camera.0.m3u8

 

I see the ts file but only 1. It just keeps growing. It never changes to a next file.

Do I have something wrong? it should quickly rotate between three files.

 

Thanks,

 

Jerry

 

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Jerry Geis-2
In reply to this post by Jerry Geis-2
Hi Dayle,

I tried with the other values (below) and same result. Just one file and just keeps growing.
I let it run for about 2 minutes and still just one file.

My HLSSINK works fine with rtsp source. But I want to have http work also.

Thanks

Jerry

Hi Jerry,

 

Just some thoughts that might help.  Go with these numbers to get it up and running:

 

max-files=10                      Default is 10 and Wowza recommends you have a total of 50 seconds of video or # of files x duration.  

target-duration=3            Default is 15. I use 3 seconds and Wowza claims you can go as low as 0.5

playlist-length=3              Default is 5 and must be >=3 and I suspect this is your problem

 

check out https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-6.3.3 

 

 

Cheers,

Dayle 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: MJPG camera to hlssink

North48

I’m probably the least knowledgeable on this mail list.  I just keep hitting things until they work. 

 

I’m using an rtsp source, so this might not help.  But try putting the element h264parse in front of mpegtsmux, which is required for what I’m doing.

 

Good luck.

 

From: gstreamer-devel [mailto:[hidden email]] On Behalf Of Jerry Geis
Sent: Sunday, November 19, 2017 8:13 PM
To: [hidden email]
Subject: Re: MJPG camera to hlssink

 

Hi Dayle,

 

I tried with the other values (below) and same result. Just one file and just keeps growing.

I let it run for about 2 minutes and still just one file.

 

My HLSSINK works fine with rtsp source. But I want to have http work also.

 

Thanks

 

Jerry

 

Hi Jerry,
 
 
 
Just some thoughts that might help.  Go with these numbers to get it up and running:
 
 
 
max-files=10                      Default is 10 and Wowza recommends you have a total of 50 seconds of video or # of files x duration.  
 
target-duration=3            Default is 15. I use 3 seconds and Wowza claims you can go as low as 0.5
 
playlist-length=3              Default is 5 and must be >=3 and I suspect this is your problem
 
 
 
check out https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-6.3.3 
 
 
 
 
 
Cheers,
 
Dayle 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Jerry Geis-2
In reply to this post by Jerry Geis-2
>I’m using an rtsp source, so this might not help.  But try putting the element h264parse in front of >mpegtsmux, which is required for what I’m doing.

I just tried that and made no difference.
I to use that in my rtsp version and that works just fine. 

Jerry
 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Nicolas Dufresne-5
General note,

I just notice that multipart demux does not set any timestamps. hlssink
is completly timestamp based, and the time accumulator was stuck at
zero. The solution I found it:

  souphttpsrc is-live=1 do-timestamp location=... ! multipartdemux ! ..

After that it works.


regards,
Nicolas

Le lundi 20 novembre 2017 à 07:33 -0500, Jerry Geis a écrit :

> >I’m using an rtsp source, so this might not help.  But try putting
> the element h264parse in front of >mpegtsmux, which is required for
> what I’m doing.
>
> I just tried that and made no difference.
> I to use that in my rtsp version and that works just fine.
>
> Jerry
>  
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MJPG camera to hlssink

Nicolas Dufresne-5
Small Errata:

Le lundi 20 novembre 2017 à 13:54 -0500, Nicolas Dufresne a écrit :
> General note,
>
> I just notice that multipart demux does not set any timestamps.
> hlssink
> is completly timestamp based, and the time accumulator was stuck at
> zero. The solution I found it:
>
>   souphttpsrc is-live=1 do-timestamp location=... ! multipartdemux !

                          do-timestamp=1

> ..
>
> After that it works.
>
>
> regards,
> Nicolas
>
> Le lundi 20 novembre 2017 à 07:33 -0500, Jerry Geis a écrit :
> > > I’m using an rtsp source, so this might not help.  But try
> > > putting
> >
> > the element h264parse in front of >mpegtsmux, which is required for
> > what I’m doing.
> >
> > I just tried that and made no difference.
> > I to use that in my rtsp version and that works just fine.
> >
> > Jerry
> >  
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment