Page 4 of 4

Re: LUMIX GX80 UDP Streaming

Posted: Wed Oct 28, 2020 11:10 pm
by plouf
the code there works as long as line

Code: Select all

For y=1 To 8192
the momnent you change it with

Code: Select all

For y=1 To 8193
it does not

i try with following

Code: Select all

af = CreateUDPObject(Nil, 12345)
DebugPrint(GetLocalPort(af, #NETWORKUDP))

InstallEventHandler({onreceiveudpdata = Function(msg)

	DebugPrint("received")
	data$,ip$,port = ReceiveUDPData(af,4096)
	data2$ ,ip$,port = ReceiveUDPData(af,4096)
	data$=data$..data2$
	data2$ ,ip$,port = ReceiveUDPData(af,4096)
	data$=data$..data2$
	DebugPrint("size is "..StrStr(StrLen(data$)))
	DebugPrint("data "..data$)
	
	EndFunction})

Repeat
	WaitEvent
Forever
but fails in first line as mentiom
using the follwing client test code (see i send 10000 bytes)

Code: Select all

CreateUDPObject(1)
For i=1 To 5
	For y=1 To 10000
		data$ = data$.. ByteChr(i)
	Next 
Next 



InstallEventHandler({onkeyup = Function(msg)

	;SendUDPData(1, msg.key, "127.0.0.1", 12345)
	SendUDPData(1,data$, "127.0.0.1", 12345)
	
EndFunction})

Repeat
	WaitEvent
Forever
anyway.. can provide the correct way ?
thanx

Re: LUMIX GX80 UDP Streaming

Posted: Thu Oct 29, 2020 5:22 pm
by airsoftsoftwair
Thanks, I see the problem now. The problem is that UDP packets must always be read in full by a single call to ReceiveUDPData(). It's not possible to read them sequentially. That's why you can't read a 50000 byte packet using several calls to ReceiveUDPData(). The consequence is that Hollywood can't handle UDP packets bigger than 8kb at all because that's the maximum ReceiveUDPData() can handle.

I don't really understand why you need to read larger packets. Usually, UDP uses very small packet sizes because of its nature as an unreliable protocol. Is there any reason why you want to use larger packets than 8kb?

Re: LUMIX GX80 UDP Streaming

Posted: Thu Oct 29, 2020 5:29 pm
by plouf
The topic here us about lumix
This vamera sends a whole frame per packet and if you see the thread we notice that this is the reason why he received part of image

Re: LUMIX GX80 UDP Streaming

Posted: Thu Oct 29, 2020 6:09 pm
by airsoftsoftwair
Really? UDP is limited to 64kb per packet. That's hardly enough for a whole camera image...

Re: LUMIX GX80 UDP Streaming

Posted: Fri Oct 30, 2020 8:07 am
by sinisrus
These are 640x480 images. That may be enough (may be) ?

Re: LUMIX GX80 UDP Streaming

Posted: Fri Oct 30, 2020 6:17 pm
by airsoftsoftwair
sinisrus wrote: Fri Oct 30, 2020 8:07 am These are 640x480 images. That may be enough (may be) ?
May be enough, may not be enough. Anyway, UDP requires data transfer using a fixed packet size. Have you tried to find out the packet size used by the camera?

Re: LUMIX GX80 UDP Streaming

Posted: Sat Oct 31, 2020 11:46 am
by sinisrus
On this link:
https://www.personal-view.com/talks/dis ... -video-/p1

a 144 bytes "header" (with a few changing bytes, and a lot of repeating patterns in the different occurences of these headers / separators)
ff d8 ...... ff d9 : a jpg file
a 144 bytes "header"
ff d8 ...... ff d9 : another jpg file
and so on

Re: LUMIX GX80 UDP Streaming

Posted: Tue Nov 03, 2020 4:54 pm
by airsoftsoftwair
Yes, looks like the camera sends an MJPEG stream. But this page doesn't mention the UDP packet size used by the camera...

Re: LUMIX GX80 UDP Streaming

Posted: Thu Nov 05, 2020 4:08 am
by SamuraiCrow
If you read farther into that link, you'd find the post was edited to indicate the size of the header varies. Maybe the packet length really is supposed to be 8k.

Maybe this article from WikiPedia will help you decode the header properly.