

<div class="detailCon detailConMorePad">
	<ul class="line lineL">
		<li class="line lineD">
			<label class="des desA">{%label.codeStreamType%}</label>
			<span class="selCon">
				<span id="streamType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>

		<li class="line lineD mainStream">
			<label class="des desA">{%label.encodeType%}</label>
			<span class="selCon">
				<span id="mainEncodeType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD mainStream">
			<label class="des desA">{%label.resolution%}</label>
			<span class="selCon">
				<span id="mainResolution" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD mainStream">
			<label class="des desA">{%label.vedioFrameRate%}</label>
			<span class="selCon IEPZD">
				<span id="mainFrameRate" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD lineNoMarginBtm mainStream">
			<label class="des desA">{%label.bitRateType%}</label>
			<span class="selCon IEPZD">
				<span id="mainBitRateType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line mainVbrSet mainStream">
			<div class="lineSub lineSubL">
				<label class="title">{%label.imageQuality%}</label>
				<div id="mainQuaDL" class="ipcDragLineDiv DragLineSimple"></div>
			</div>
		</li>
		<li class="line lineD mainStream smartCodeSupport">
			<label class="des desA">{%label.smartCodec%}</label>
			<div id="mainSmartC" class="switchCon">
				<i class="switchBg"></i>
				<i class="switchBall"></i>
			</div>
			<label class="des desH"></label>
		</li>
		<li class="line lineD mainStream">
			<label class="des desA">{%label.bitRateUpBound%}</label>
			<span class="selCon IEPZD">
				<span id="mainBitrate" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>

		<li class="line lineD minorStream">
			<label class="des desA">{%label.encodeType%}</label>
			<span class="selCon">
				<span id="minorEncodeType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD minorStream">
			<label class="des desA">{%label.resolution%}</label>
			<span class="selCon">
				<span id="minorResolution" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD minorStream">
			<label class="des desA">{%label.vedioFrameRate%}</label>
			<span class="selCon IEPZD">
				<span id="minorFrameRate" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD lineNoMarginBtm minorStream">
			<label class="des desA">{%label.bitRateType%}</label>
			<span class="selCon IEPZD">
				<span id="minorBitRateType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line minorVbrSet minorStream">
			<div class="lineSub lineSubL">
				<label class="title">{%label.imageQuality%}</label>
				<div id="minorQuaDL" class="ipcDragLineDiv DragLineSimple"></div>
			</div>
		</li>

		<li class="line lineD minorStream">
			<label class="des desA">{%label.bitRateUpBound%}</label>
			<span class="selCon IEPZD">
				<span id="minorBitrate" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>

		<li class="line lineD thirdStream">
			<label class="des desA">{%label.encodeType%}</label>
			<span class="selCon">
				<span id="thirdEncodeType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD thirdStream">
			<label class="des desA">{%label.resolution%}</label>
			<span class="selCon">
				<span id="thirdResolution" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD thirdStream">
			<label class="des desA">{%label.vedioFrameRate%}</label>
			<span class="selCon IEPZD">
				<span id="thirdFrameRate" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineD lineNoMarginBtm thirdStream">
			<label class="des desA">{%label.bitRateType%}</label>
			<span class="selCon IEPZD">
				<span id="thirdBitRateType" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line thirdVbrSet thirdStream">
			<div class="lineSub lineSubL">
				<label class="title">{%label.imageQuality%}</label>
				<div id="thirdQuaDL" class="ipcDragLineDiv DragLineSimple"></div>
			</div>
		</li>

		<li class="line lineD thirdStream">
			<label class="des desA">{%label.bitRateUpBound%}</label>
			<span class="selCon IEPZD">
				<span id="thirdBitrate" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
	</ul>
	<!-- 功能按钮 -->
	<div class="funcBtnCon">
		<input id="reset" type="button" value="{%btn.resetDefault%}" class="subBtnB btnA" />
		<input id="save" type="button" value="{%btn.save%}" class="subBtn btnA" />
	</div>
</div>


<script type="text/javascript">function init(){function L(a,c){var d="";switch(parseInt(a)){case ENONE:return!0;case IPCVISTMTERR:d=errStr.ipcViStmtErr;break;case IPCVIRESERR:d=errStr.ipcViResErr;break;case IPCVIBRTERR:d=errStr.ipcViBrtErr;break;case IPCVIFRERR:d=errStr.ipcViFrErr;break;case IPCVIQUAERR:d=errStr.ipcViQuaErr;break;case IPCVIBRERR:d=errStr.ipcViBrErr;break;case IPCVIMAPERR:d=errStr.ipcViMapErr;break;case IPCVIENCTERR:d=errStr.ipcViEnctErr;break;case IPCVICSTGBITRATEERR:d=errStr.ipcViCSTGBitrateErr;break;case IPCVICSTGSMARTCODECERR:d=
errStr.ipcViCSTGSmartCodecErr;break;case IPCSYSRPARAERR:d=errStr.ipcSysRparaErr;break;case IPCSYSRCONFERR:d=errStr.ipcSysRconfErr;break;case IPCUBUSCONNFAIL:d=errStr.ipcUbusConnFail;break;case IPCUBUSCALLERR:d=errStr.ipcUbusCallErr;break;case IPCFILEOPENERR:d=errStr.ipcFileOpenErr;break;case IPCDIRMKERR:d=errStr.ipcDirMkErr;break;case IPCDATESETERR:d=errStr.ipcDateSetErr;break;case IPCFUNCPARAEXPT:d=errStr.ipcFuncParaExpt;break;case IPCUCCONVERR:d=errStr.ipcUcConvErr;break;case IPCUMGUESTNAUTH:showStr=
errStr.invPermissionDenied;break;case IPCENERR:d=errStr.IPCParamInvalid;break;default:d=errStr.unknown+errNo}closeToast();showAlert(d);return!1}function ia(){showConfirmC(btn.resetDefault,label.resetDefaultConfirm,function(a){!0==a&&(a={},a[q]={},a[q][M]={},a[q][M][ja]=[h],showToast("loading"),$.action(a,function(c){!0==L(c[ERR_CODE])&&(showToast("success"),id("info_conf_stream_video_rsMenu").onclick())}))})}function N(a,c,d,e){return 1>a.length?(showNote(e,errStr.bitRateUpBoundEmtpy),!1):!1==checkNum(a)?
(showNote(e,errStr.bitRateUpBoundInvChar),!1):!1==checkNumRange(parseInt(a,10),c,d)?(showNote(e,errStr.bitRateUpBoundErr),!1):!0}function ka(){var a={},c,d;!1!=N(l.value,O,P,"mainBitrate")&&!1!=N(m.value,O,P,"minorBitrate")&&(a[h]={},c=a[h][uciVideo.secName.main]={},d=a[h][uciVideo.secName.minor]={},c.encode_type=B.value,c.resolution=Q.value,c.bitrate_type=u.value,c.frame_rate=R.value,u.value==e.vbr&&(c.quality=S[w.getValue()]),T&&(c.smart_codec=1==C.state?"on":"off"),c.bitrate=l.value,d.encode_type=
D.value,d.resolution=U.value,d.bitrate_type=n.value,d.frame_rate=V.value,n.value==e.vbr&&(d.quality=S[x.getValue()]),d.bitrate=m.value,showToast("loading"),$.modify(a,function(a){!0==L(a[ERR_CODE])&&(showToast("success"),$.resolutionWidth=parseInt(c.resolution.split("*")[0]))}))}function la(a){var c;void 0!=a&&a.error_code==ERR_NONE&&(c=a[h][uciVideo.secName.main],a=a[h][uciVideo.secName.minor],B.resetSel(c.encode_type),p=c.encode_type,Q.resetSel(c.resolution),R.resetSel(c.frame_rate),u.resetSel(c.bitrate_type),
w.setValue(y[c.quality]),l.resetSel(c.bitrate),D.resetSel(a.encode_type),r=a.encode_type,U.resetSel(a.resolution),V.resetSel(a.frame_rate),n.resetSel(a.bitrate_type),x.setValue(y[a.quality]),m.resetSel(a.bitrate),z(c.bitrate_type),A(a.bitrate_type),C.setState("on"==c.smart_codec?1:0),E(ma.value),$.resolutionWidth=parseInt(c.resolution.split("*")[0]),showDetailCon())}function E(a){switch(a){case F:W.show();X.hide();Y.hide();z(u.value);break;case Z:W.hide(),X.show(),Y.hide(),A(n.value)}T||$(".smartCodeSupport").hide()}
function na(a){if(a!=p){var c;switch(B.value){case "H264":c=2*l.value;p=e.h264;break;case "H265":c=l.value/2,p=e.h265}c=c>G?G:c;c=c<H?H:c;l.resetSel(c)}}function oa(a){if(a!=r){var c;switch(D.value){case "H264":c=2*m.value;r=e.h264;break;case "H265":c=m.value/2,r=e.h265}c=c>I?I:c;c=c<J?J:c;m.resetSel(c)}}function aa(a){function c(a){baseVal=65536;return(parseInt(parseInt(a,10).toString(16),16)-baseVal).toString()}var d,h,l=[],m=[],b,f,u=[{str:label.mCodeStream,value:F},{str:label.cCodeStream,value:Z}];
b=[{str:label.h264,value:e.h264},{str:label.h265,value:e.h265}];var n=[{str:label.reso1280_720,value:e.reso1280_720},{str:label.reso1280_960,value:e.reso1280_960},{str:label.reso1920_1080,value:e.reso1920_1080}],p=[{str:label.reso320_240,value:e.reso320_240},{str:label.reso352_288,value:e.reso352_288},{str:label.reso640_480,value:e.reso640_480}],s=[256,512,1024,2048,3072,4096],t=[64,128,256,512,768,1024],r=[{str:label.cbr,value:e.cbr},{str:label.vbr,value:e.vbr}],g=a[uciVideoCapability.fileName][uciVideoCapability.secName.main];
f=a[uciVideoCapability.fileName][uciVideoCapability.secName.minor];var v=function(a){for(var c=[],b=0;b<a.length;b++)c.push(parseInt(a[b]));return c},q;K&&(q=a[uciImage.fileName][uciImage.secName.videoFormat][uciImage.optName.frequencyMode]);g&&g[uciVideoCapability.optName.bitrates]&&(s=v(g[uciVideoCapability.optName.bitrates]),G=s[s.length-1],H=s[0]);f&&f[uciVideoCapability.optName.bitrates]&&(t=v(f[uciVideoCapability.optName.bitrates]),I=t[t.length-1],J=t[0]);v=a=b;if(g&&g[uciVideoCapability.optName.encode_types]){var k=
g[uciVideoCapability.optName.encode_types];a=[];for(b=0;b<k.length;b++)a.push({str:k[b].toString().toUpperCase(),value:k[b].toUpperCase()})}if(f&&f[uciVideoCapability.optName.encode_types])for(k=f[uciVideoCapability.optName.encode_types],v=[],b=0;b<k.length;b++)v.push({str:k[b].toString().toUpperCase(),value:k[b].toUpperCase()});if(g&&g[uciVideoCapability.optName.resolutions])for(k=g[uciVideoCapability.optName.resolutions],n=[],b=0;b<k.length;b++)n.push({str:k[b].toString(),value:k[b]});if(f&&f[uciVideoCapability.optName.resolutions])for(k=
f[uciVideoCapability.optName.resolutions],p=[],b=0;b<k.length;b++)p.push({str:k[b].toString(),value:k[b]});if(g&&g[uciVideoCapability.optName.frame_rates]){g=g[uciVideoCapability.optName.frame_rates];d=[];for(b=0;b<g.length;b++)d.push({str:c(g[b]),value:g[b]});if(q==uciImage.optValue.pal)for(b=0;b<d.length;b++)"65566"==d[b].value&&d.splice(b,1)}if(f&&f[uciVideoCapability.optName.frame_rates]){g=f[uciVideoCapability.optName.frame_rates];h=[];for(b=0;b<g.length;b++)h.push({str:c(g[b]),value:g[b]});
if(q==uciImage.optValue.pal)for(b=0;b<h.length;b++)"65566"==h[b].value&&h.splice(b,1)}for(b=0;b<s.length;b++)f=[],f.str=s[b].toString(),f.value=s[b],l.push(f);for(b=0;b<t.length;b++)f=[],f.str=t[b].toString(),f.value=t[b],m.push(f);selectInit("streamType",u,ba,E);selectInit("mainEncodeType",a,ca,na);selectInit("mainResolution",n,pa);selectInit("mainFrameRate",d,d[0].value);selectInit("mainBitRateType",r,da,z);w=new DragLine({id:"mainQuaDL",lowerBound:0,upperBound:2,needLabel:"n",needInput:"n",needScale:"y"});
C=new Switch("mainSmartC",0);selectUpInit("mainBitrate",l,l[0].value);selectInit("minorEncodeType",v,ca,oa);selectInit("minorResolution",p,qa);selectInit("minorFrameRate",h,h[0].value);selectInit("minorBitRateType",r,ea,A);x=new DragLine({id:"minorQuaDL",lowerBound:0,upperBound:2,needLabel:"n",needInput:"n",needScale:"y"});selectUpInit("minorBitrate",m,m[0].value);w.setValue(y[ra]);x.setValue(y[sa]);z(da);A(ea);E(ba)}function z(a){a==e.cbr?fa.hide():fa.show()}function A(a){a==e.cbr?ga.hide():ga.show()}
var F="main",Z="minor",W=$(".mainStream"),X=$(".minorStream"),Y=$(".thirdStream"),ma=$("#streamType")[0],B=$("#mainEncodeType")[0],Q=$("#mainResolution")[0],R=$("#mainFrameRate")[0],u=$("#mainBitRateType")[0],l=$("#mainBitrate")[0],D=$("#minorEncodeType")[0],U=$("#minorResolution")[0],V=$("#minorFrameRate")[0],n=$("#minorBitRateType")[0],m=$("#minorBitrate")[0];$("#thirdEncodeType");$("#thirdResolution");$("#thirdFrameRate");$("#thirdBitRateType");$("#thirdBitrate");var fa=$(".mainVbrSet"),ga=$(".minorVbrSet");
$(".thirdVbrSet");var ha=id("reset"),ta=id("save"),w,x,h=uciVideo.fileName,e=uciVideo.optValue;id("mainSmartC");var S=[e.quaL,e.quaM,e.quaH],y=[0,0,1,1,2,2],ba=F,ca=e.h264,p=e.h264,r=e.h264,pa=e.reso1920_1080,da=e.cbr,ra=e.quaH,qa=e.reso640_480,ea=e.cbr,sa=e.quaH,q=uciSystem.fileName,M=uciSystem.actionName.configReset,ja=uciSystem.optName.configName,C,O=16384,P=64,G=4096,H=256,I=1024,J=64,ua=$.moduleSpec.config_recovery&&0<=$.inArray("video",$.moduleSpec.config_recovery)?!0:!1,T=1==parseInt($.moduleSpec[uciFunction.optName.smartCodec])?
!0:!1,K;$.moduleSpec[uciFunction.optName.new_version_capability_list]&&0<=$.inArray(uciImage.fileName,$.moduleSpec[uciFunction.optName.new_version_capability_list])&&(K=1==parseInt($.imageCapability[uciImageCapability.secType.capability][uciImageCapability.optName.videoFormat])?!0:!1);(function(){ua?ha.onclick=ia:$(ha).hide();ta.onclick=ka;var a={};a[uciVideoCapability.fileName]={};a[uciVideoCapability.fileName][NAME]=[uciVideoCapability.secName.main,uciVideoCapability.secName.minor];K&&(a[uciImage.fileName]=
{},a[uciImage.fileName][NAME]=[uciImage.secName.videoFormat]);$.query(a,function(a){ENONE==a[ERR_CODE]?aa(a):aa();a={};a[h]={};a[h][NAME]=[uciVideo.secName.main,uciVideo.secName.minor];$.query(a,la)})})()}init();
</script><style type="text/css">li.lineNoMarginBtm{width:328px!important}div.lineSub label.title{display:inline-block;height:26px!important;font-size:14px;color:#707070;width:70px;margin-right:4px}li.mainVbrSet,li.minorVbrSet,li.thirdVbrSet{height:40px;margin-bottom:8px}</style>