OSG_IMAGE

 

Description

Upload the image file (in YUV 422 format) to the camera.

The OSG, On-Screen Graphic, attached a image on the video like the watermark on video. The format of this image has to be YUV 422. There are many tools could transfer the image file from different format like bmp to YUV 422. Because there are several format in YUV422, you need to find correct tool then. Currently, we use the tool, VUVTools, to transfer the 24 bit bitmap image file to YUV 422 file for OSG. Refer to the http://www.sunrayimage.com.
The transform format in YUV is shown here.

We support the alpha blending function in OSG. That could give different transparent level in background color in OSG image on the video.
The max. OSG image is 640x480. The OSG image has to be NOT larger than video resolution.

Every video stream has its own OSG configurations. That means you need to upload two OSG images to the camera if you want OSG on video stream 1 and video stream 2 in dual streams camera. And, no scale function is available in OSG. These two OSG images have different size if the video resolution in video stream 1 and video stream 2 are different.

Use CHANNEL command to indicate the target video stream for upload OSG image.
If there is no CHANNEL command with OSG_IMAGE URL, the upload video image is for video stream 1.

Note:
The state of OSG will be disabled after the OSG image upload. The user has to enable the OSG image by enabling OSG function through OSG_CONFIG URL.

The format of this URL http://172.16.3.14/cgi-bin/update?USER=Admin&PWD=123456&CHANNEL=1&OSG_IMAGE is used an an example of this URL.

Stage 1: Send this URL to the device for OSG image file upload

GET /cgi-bin/update?USER=admin&PWD=123456&CHANNEL=1&OSG_IMAGE HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-tw
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: 172.16.3.14
Connection: Keep-Alive
Stage 2 : Device reply the URL
HTTP/1.0 200 OK
Content-type: text/html

<html><head><title>UPLOAD FILES</title></head>
<meta http-equiv="PRAGMA" content="NO-CACHE"><body>
<form name="UPLOAD_FORM" method="POST" enctype="multipart/form-data" action="update?CHANNEL=1&OSG_IMAGE_SAVE">
OSG Image : <input type="FILE" name="URL_OSG_IMAGE" value="" size="40">
<br>
<input type="submit" value="Apply" name="URL_FIRMWARE_SUBMIT">
<input type="reset" value="Reset" name="URL_FIRMWARE_RESET">
<br>
</form></body></html>
Stage 3: Upload the image file to device and get the return code
POST /cgi-bin/update?CHANNEL=1&OSG_IMAGE_SAVE HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://172.16.3.14/cgi-bin/update?USER=admin&PWD=123456&CHANNEL=1&OSG_IMAGE_SAVE
Accept-Language: zh-tw
Content-Type: multipart/form-data; boundary=---------------------------7d834b76e0708
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: 172.16.3.14
Content-Length: 25064
Connection: Keep-Alive
Cache-Control: no-cache

-----------------------------7d834b76e0708
Content-Disposition: form-data; name="URL_OSG_IMAGE"; filename="C:\osg1.yuv"
Content-Type: application/x-gzip-compressed

......................................

-----------------------------7d8261316e0708
Content-Disposition: form-data; name="URL_FIRMWARE_SUBMIT"

Apply
-----------------------------7d8261316e0708--
Stage 4: device reply this URL
HTTP/1.0 200 OK
Content-type: text/plain
Content-Length: 3

OK

Input Argument

None

Attribute

Return of Message

OK
or
ERROR: OSG image

Applicability

Status

Valid

See Also

OSG_CONFIG

Example

http://ip:port/cgi-bin/encoder?USER=Admin&PWD=123456&CHANNEL=1&OSG_IMAGE
or
http://ip:port/cgi-bin/cmd/encoder?CHANNEL=1&OSG_IMAGE

Back To

HOME, ENCODER CGI