UDP PACKET TOO BIG

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

UDP PACKET TOO BIG

fgfernandez0321
Good afternoon

I have these pipelines where I capture video from camera and show it using: xvimagesink and transmit via udp, in this case I'm using jifmux for playing using playbin using the second pipeline. I have problems with udp packet size when the camera looks to specific area in my work where there are different colors. The question is: How do I limit the udp packet size?

gst-launch-1.0 --gst-debug=jifmux:5 v4l2src device=/dev/video1 do-timestamp=true ! video/x-raw,width=640,height=480,framerate=30/1 ! timeoverlay font-desc="Verdana bold 12px" ! tee name=t t. ! queue ! xvimagesink sync=false t. ! queue ! jpegenc ! jifmux ! udpsink host=127.0.0.1 port=5000 sync=false

gst-launch-1.0 -v playbin uri=udp://@0.0.0.0:5000



I tried to use: mpegtsmux but It has delay 0.8 miliseconds. I need real time

gst-launch-1.0 --gst-debug=mpegtsmux:5 v4l2src device=/dev/video1 do-timestamp=true ! video/x-raw,width=640,height=480,framerate=30/1 ! timeoverlay font-desc="Verdana bold 12px" ! tee name=t t. ! queue ! xvimagesink sync=false t. ! queue ! x264enc byte-stream=true bitrate=5000 key-int-max=1 tune=zerolatency ! video/x-h264 ! mpegtsmux name=mux m2ts-mode=false alignment=7 ! video/mpegts ! rtpmp2tpay pt=33 ! udpsink host=127.0.0.1 port=5000 sync=false
Reply | Threaded
Open this post in threaded view
|

Re: UDP PACKET TOO BIG

Michael Gruner
What about plain JPEG RTP using rtpjpegpay? Something like (using your pipe):

gst-launch-1.0 --gst-debug=jifmux:5 v4l2src device=/dev/video1
do-timestamp=true ! video/x-raw,width=640,height=480,framerate=30/1 !
timeoverlay font-desc="Verdana bold 12px" ! tee name=t t. ! queue !
xvimagesink sync=false t. ! queue ! jpegenc ! jifmux ! rtpjpegpay ! queue ! udpsink
host=127.0.0.1 port=5000 sync=false


Michael Gruner <[hidden email]>
Embedded Linux and GStreamer solutions
RidgeRun Engineering

On Jun 8, 2016, at 11:18, fgfernandez0321 <[hidden email]> wrote:

Good afternoon

I have these pipelines where I capture video from camera and show it using:
xvimagesink and transmit via udp, in this case I'm using jifmux for playing
using playbin using the second pipeline. I have problems with udp packet
size when the camera looks to specific area in my work where there are
different colors. The question is: How do I limit the udp packet size?

gst-launch-1.0 --gst-debug=jifmux:5 v4l2src device=/dev/video1
do-timestamp=true ! video/x-raw,width=640,height=480,framerate=30/1 !
timeoverlay font-desc="Verdana bold 12px" ! tee name=t t. ! queue !
xvimagesink sync=false t. ! queue ! jpegenc ! jifmux ! udpsink
host=127.0.0.1 port=5000 sync=false

gst-launch-1.0 -v playbin uri=<a href="udp://@0.0.0.0:5000" class="">udp://@0.0.0.0:5000

<http://gstreamer-devel.966125.n4.nabble.com/file/n4677940/Screenshot_from_2016-06-08_13-55-52.png>

I tried to use: mpegtsmux but It has delay 0.8 miliseconds. I need real time

gst-launch-1.0 --gst-debug=mpegtsmux:5 v4l2src device=/dev/video1
do-timestamp=true ! video/x-raw,width=640,height=480,framerate=30/1 !
timeoverlay font-desc="Verdana bold 12px" ! tee name=t t. ! queue !
xvimagesink sync=false t. ! queue ! x264enc byte-stream=true bitrate=5000
key-int-max=1 tune=zerolatency ! video/x-h264 ! mpegtsmux name=mux
m2ts-mode=false alignment=7 ! video/mpegts ! rtpmp2tpay pt=33 ! udpsink
host=127.0.0.1 port=5000 sync=false



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/UDP-PACKET-TOO-BIG-tp4677940.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
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: UDP PACKET TOO BIG

fgfernandez0321
This post was updated on .
Thank you for your suggestion but I used your solution and it doesn't work. If I use "rtpjpegpay" then the playbin does not recognize the stream. The point here is that I need a pipeline according to the playbin because I was reading and playbin needs to receive a signal from muxer example jifmux or mpegtsmux. In both cases I have delay and udp packet size problem. Could you please help me???
Reply | Threaded
Open this post in threaded view
|

Re: UDP PACKET TOO BIG

Michael Gruner
I quickly tested a similar pipeline as yours (the H264+MPEGTS) in my PC, and got the same ~1s latency, plus somewhat jerky display. I don’t know if its the exact same scenario, but here’s how I managed to reduce it:

gst-launch-1.0 playbin uri=<a href="udp://@0.0.0.0:5000" class="">udp://@0.0.0.0:5000 playsink::vbin::glimagesinkbin0::sink::sync=false

Note that this hierarchy is specific to my PC, you’ll have to find the hierarchy in your specific environment, and that’s the tricky part.

You may try figuring it out from the DOT diagram:
GST_DEBUG_DUMP_DOT_DIR=/tmp gst-launch-1.0 playbin uri=<a href="udp://@0.0.0.0:5000" class="">udp://@0.0.0.0:5000

In /tmp you’ll find the diagrams with names similar to <timestamp>-gst-launch.PAUSED_PLAYING.dot
You may view them using xdot, or by converting them to png using “dot -Tpng <your_dot>.dot -o <your_png>.png”

After that, follow the name hierarchy down to your sink element, and set sync to false. Note that this is only valid because you have a video only pipeline, coming from a live source as v4l2. I’ll attach my png so you can correlate my hierarchy with my diagram and extrapolate yours.

A big warning:
- if your hierarchy path is incorrect, you’ll not receive a message saying so. The property will simply not apply.

Good luck :)


Michael Gruner <[hidden email]>
Embedded Linux and GStreamer solutions
RidgeRun Engineering

On Jun 8, 2016, at 12:03, fgfernandez0321 <[hidden email]> wrote:

Thank you for your suggestion but I used your solution and it doesn't work.
The point here is that I need a pipeline according to the playbin because I
was reading and playbin needs to receive a signal from muxer example jifmux
or mpegtsmux. In both cases I have delay and udp packet size problem. Could
you please helpe me???



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/UDP-PACKET-TOO-BIG-tp4677940p4677944.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
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: UDP PACKET TOO BIG

Tim Müller
On Wed, 2016-06-08 at 13:39 -0600, Michael Gruner wrote:

Hi,

I quickly tested a similar pipeline as yours (the H264+MPEGTS) in my PC, and got the same ~1s latency, plus somewhat jerky display. I don’t know if its the exact same scenario, but here’s how I managed to reduce it:

gst-launch-1.0 playbin uri=<a href="udp://@0.0.0.0:5000">udp://@0.0.0.0:5000 playsink::vbin::glimagesinkbin0::sink::sync=false

Note that this hierarchy is specific to my PC, you’ll have to find the hierarchy in your specific environment, and that’s the tricky part.

sync=false on the sink will add jerkiness if there's network jitter.

What you probably want is to set the "latency" property on the source (rtspsrc), it's quite high by default (2 seconds).

e.g.

gst-launch-1.0 playbin uri=rtsp://127.0.0.1:8554/test uridecodebin0::source::latency=100

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com

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

Re: UDP PACKET TOO BIG

Tim Müller
On Wed, 2016-06-08 at 22:28 +0100, Tim Müller wrote:
On Wed, 2016-06-08 at 13:39 -0600, Michael Gruner wrote:



sync=false on the sink will add jerkiness if there's network jitter.

What you probably want is to set the "latency" property on the source (rtspsrc), it's quite high by default (2 seconds).



Sorry, I completely misread, there's no rtsp here (perhaps there should be :)), just plain udp.

setting sync to false on the sink is ok if you have a dedicated wired network where there's basically no jitter or packet loss, but for anything else you'll probably want a pipeline with an rtpjitterbuffer and a non-0 latency to smooth out the network jitter.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com

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

Re: UDP PACKET TOO BIG

fgfernandez0321
I don't have dedicated wired network. The use case is related with drone which has a camera. So I need to capture the source of this camera using "v4l2src" command for linux. After that, I have to re-stream the source for playing using "playbin".  I have two options: mpegtsmux or jifmux. mpegtsmux has delays and the second case not working when the camera looks different textures, i'm using a webcam for testing. Right now, I don't know what is the best: mpegtsmux or jifmux for my scenario. Suggestions?

gst-launch-1.0 --gst-debug=mpegtsmux:5 v4l2src device=/dev/video1 ! video/x-raw,width=640,height=480,framerate=30/1 ! timeoverlay font-desc="Verdana bold 12px" ! tee name=t t. ! queue ! xvimagesink sync=false t. ! queue ! x264enc bitrate=5000 key-int-max=1 tune=zerolatency ! video/x-h264 ! mpegtsmux name=mux m2ts-mode=false alignment=7 ! video/mpegts ! rtpmp2tpay pt=33 ! udpsink host=127.0.0.1 port=5000 sync=false

On Wed, Jun 8, 2016 at 5:33 PM, Tim Müller <[hidden email]> wrote:
On Wed, 2016-06-08 at 22:28 +0100, Tim Müller wrote:
On Wed, 2016-06-08 at 13:39 -0600, Michael Gruner wrote:



sync=false on the sink will add jerkiness if there's network jitter.

What you probably want is to set the "latency" property on the source (rtspsrc), it's quite high by default (2 seconds).



Sorry, I completely misread, there's no rtsp here (perhaps there should be :)), just plain udp.

setting sync to false on the sink is ok if you have a dedicated wired network where there's basically no jitter or packet loss, but for anything else you'll probably want a pipeline with an rtpjitterbuffer and a non-0 latency to smooth out the network jitter.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
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: UDP PACKET TOO BIG

Nicolas Dufresne-4
Le mercredi 08 juin 2016 à 17:41 -0400, Frank González Fernández a
écrit :
> I don't have dedicated wired network. The use case is related with
> drone which has a camera. So I need to capture the source of this
> camera using "v4l2src" command for linux. After that, I have to re-
> stream the source for playing using "playbin".  I have two
> options: mpegtsmux or jifmux. mpegtsmux has delays and the second
> case not working when the camera looks different textures, i'm using
> a webcam for testing. Right now, I don't know what is the
> best: mpegtsmux or jifmux for my scenario. Suggestions?

You could instead run an GstRtspServer in your drone. This way, you can
use rtsp:// URI, from which you can control the latency as Tim said.
Using RTSP has the advantage that you can enable RTP feature like
retransmission to increase the change of having a good quality video
over a network that I can only assume will vary.

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

signature.asc (188 bytes) Download Attachment