Push data into media server using Stream key and URL - c#

Looking forward to replicate OBS streaming function, push data into media server using stream key and URL to connect with server. Expecting a function or source code, at least an algorithm, and relevant reference to perform.

Related

Find the coordinates returned by the server after send commands GPS Tracker (TK303 etc)

I sent commands to the server according to the following links and data was returned that I do not know how to find the coordinates.
Link 1: GPS103 Tracker Listening Application in C#
Link 2: sending commands to tk103 gps tracker
Returned data: imei:XXXXXXXXXXXXXXX,tracker,220506170600,,F,230600.00,A,3541.45559,N,05122.93316,E,,;
I also did not find the exact source for sending the commands to the server.
Example I found: How to send commands via GPRS to GPS Tracker (TK103, GT02, GT06, TK102 etc)

ZKTeco Push SDK

i'm new to ZKteco devices! I am using a Zkteco device. I have a Zkteco Device and I have downloaded a standalone SDK, but this SDK doesn't trigger the events, (for example OnVerify, or OnAttTransaction).
So, I read in some articles, that I need to use Push SDk, but I can't find it.
I took one month to find that for that PUSH SDK and ADMS, clearly ZKTeco is not open to share that. so I had try to proceed otherwise. Here is the solution I had implement and it work properly.
The push SDK is just HTTP request made by ZKTeco device to the Bioserver.
You can use a tool like Wireshark to scan HTTP requests made by your device and implement same request/response on your own server.
For exemple, the ZKTeco device model MB560-VL send requests like this one
GET http://[SERVER-IP:PORT]/iclock/getrequest?SN=XXXXXXXXXX
and if like the BioTime software, your server just send
OK
as response in text/plain, your device will view your server as a "BioTime"
Note that your ZkTeco Device should have ADMS support, so that you will first configure SERVER-IP and PORT on the device (see your official device documentation on ZKTeco website)
User registration
When a user is registered on the device, the device send this request
POST /iclock/cdata?SN=XXXXXXXXXX&table=OPERLOG&Stamp=9999
with user information on the HTTP buffer. something like this one
PIN=2\tName=Johny Deep\tPri=0\tPasswd=\tCard=\tGrp=1\tTZ=0000000100000000\tVerify=0\tViceCard=\tStartDatetime=0\tEndDatetime=0\n
your server should just parse this data and respond OK to this request
User logs (clock_in / clock_out) Device request
POST /iclock/cdata?SN=XXXXXXXXXX&table=ATTLOG&Stamp=9999
the data sent by device on HTTP data buffer looks like
2\t2022-07-12 16:00:20\t1\t15\t\t0\t0\t\t\t43\n
As you can see you parse this string with '\t' as the separator of informations
the first integer is the User-PIN,
the second part is the date and time,
the third part is clock-in if value==0 and clock-out if value==1
Here is an exemple of implementation with Python
#http.route('/iclock/getrequest', type='http', auth="public", csrf=False)
def zk_bio_device_ping(request):
print("----------DEVICE PING-----------")
print(request.GET)
return HttpResponse("OK", content_type='text/plain')
#http.route('/iclock/getrequest', type='http', auth="public", csrf=False)
def zk_bio_device_push(request):
print("----------DEVICE SEND DATA----------")
print(request.GET)
print(request.body.decode('utf-8'))
return HttpResponse("OK", content_type='text/plain')
Device do not use any authentification to communicate with server ! I'm pretty sure that's a big security issue.

PushStreamContent sends results back in chunks?

I am using the new PushStreamContent entity in MVC4 to stream notifications from my web server back to multiple listening iOS clients (they are using NSURLConnection). The messages being sent are JSON. When I send messages that are less than 1024 bytes, the message sends as expected. Sending messages larger than this size however causes the client to receive the message in multiple chunks, each being 1024 bytes.
I am wondering what is the best way for my iOS clients to consume these multiple messages coming back? Is there a way to have NSURLConnection aggregate the results for me, or do I need to implement something that gets a result, checks if it's valid json, if not wait for the next result and append the previous, and continue until it is valid? What is a better way of doing this?
I found that you are able to adjust the size of the buffer that writes data to the stream that PushStreamContent uses. However, chunking the data is the correct thing for it to do and keeping this small has several advantages. I ended up writing my own method to aggregate the data flowing in on the client side. See the following question for more details:
How to handle chunking while streaming JSON data to NSURLConnection

How to send big image from wp7 to wcf?

I'm trying to send an image to wcf to use OCR.
For now, I succeeded in transforming my image into a byte[] and sending it to the server using wcf. Unfortunately, it works for an array whose size is <16Kb and doesn't work for an array >17Kb.
I've already set the readerQuotas and maxArrayLength to its maximum size in web.config on the server size.
Do you know how to send big data to a wcf server, or maybe any library to use OCR directly on wp7?
If all else fails, send it in fragments of 16Kb, followed by an "all done" message that commits it (reassembling if necessary)
Bit of a hack but howabout sending it with a HTTP post if it isn't too big? or alternatively changing the webservice so it accepts a blob? (the current array limitation is a limit on the array datatype in the W3C spec)
Finaly solved.
You have to update your web.config to allow the server to receive big data. And then you have to use the Stream type in your WCF and byte[] type in your WP7. Types will match and both WCF or WP7 will agree to receive and send it.
In WCF :
public string ConvertImgToStringPiece(Stream img)
{
//.....
}
In WP7 :
Service1Client proxy = new Service1Client();
proxy.ConvertImgToStringPieceCompleted += new EventHandler<ConvertImgToStringPieceCompletedEventArgs>(proxy_ConvertImgToStringPieceCompleted);
proxy.ConvertImgToStringPieceAsync(b); //b is my Byte[], more thant 17Kb.
I don't know if this works on WP7, but with WCF you can also use streams to upload bigger amounts of data.
You can try using a WCF session. The key thing to remember is that sessions in WCF are different than normal sessions we use for Internet programming. It's basically a call to a method that starts the session, any interim calls, and then a final one that ends the session. You could have a service call that starts the session, send chunks of the image, and then call the last one which closes the session and will return whatever you need.
http://msdn.microsoft.com/en-us/library/ms733040.aspx

How to make a live stream redirector?

So I have a local URL like http://localhost:port/ with live video stream in it. I need to send it over TCP to http://any_address:AnyPort/ how to do such thing in WPF, C#? CODE WANTED!)
HttpWebRequest.
Create one to get the stream then take the response and craft your response on the 222 server to mirror the response received from localhost changing necessary headers.

Categories

Resources