2012년 8월 28일 화요일

FluorineFX의 RTMP (Video Recording)이 정상적으로 작동하지 않는 경우

  • 환경 : FluorineFX, Flash Builder 4.5, IIS 7.5
  • 개요 : FluorineFX을 이용하여 Video Recording이 가능한 모듈을 개발하였으나 
     NetConnection.Connect.Failed 오류가 발생함.
  • 증상
    1. FluorineFX에서 제공되는 Sample(설치폴더\Samples\Flex\Rtm\VideoChat) 코드를 Visual Studio 2010에서 ASP.NET Development Server를 통해서 실행하면- 즉 Debug을 실행하면 - 정상적으로 FluorineFX의 RTMP에 접속됨.
    2. 위의 코드를 기반으로 해서 만들어진 Video Recoring 모듈을 IIS 7.5 포팅을
      하고 기동을 하면 NetConnection.Connect.Failed 오류가 발생함.

  • 원인 분석
    1. IIS 7.5의 응용프로그램 풀에서 유휴시간 때문인 것으로 분석이 됨.
      (정확한 분석은 아니다. 이렇게 처리를 하니까 문제가 발생하지 않아서 미루어 짐작하는 것이다. IIS7.0 에서는 문제가 없었다)
      유휴 시간으로 설정된 시간이 초과되면 관련 프로세스가 중지되는 것으로 보인다.
  • 처리 방안
    1. "응용프로그램 풀 >> 프로세스 모델 >> 유휴시간 제한"을 0으로 설정하여 제약을 두지 않는다.
  • RTMP 관련 참고 사항
    1. rtmp://localhost/VideoRecording => 웹 루트/apps/VideoRecording 폴더와 맵핑되고
      웹 루트/apps/VideoRecording/streams 폴더 밑에 동영상이 저장된다.
    2. VideoRecording이 사용되는 서버 모듈에 대한 정의는 웹 루트/apps/app.config에 정의되어 있다.

      아래는 video recording과 관련된 app.config이다.

      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
        <!-- Application object. Specify a fully qualified type name for your handler -->
        <application-handler type="RIALab.Framework.Streaming.VideoRecordingApplication"/>
        <!--streamFilenameGenerator type="RIALab.Framework.Streaming.FileNameGen"/-->
      </configuration>
    3. WEB-INF/flex/services-config.xml 을 flex에 지정할 필요가 없다.
      RTMP 통신은 rtmp://localhost/VideoRecording 와 통신을 직접하기 때문이다.
    4. Web.Config에 (.Net 4.0 기준) RTMP - fluorineFx 관련 설정
      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
        <configSections>
          <sectionGroup name="fluorinefx">
            <section name="settings" type="FluorineFx.Configuration.XmlConfigurator, FluorineFx" requirePermission="false" />
          </sectionGroup>
          <!--log4net setup : start-->
          <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
          <!--log4net setup : end-->
          <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          <section name="securityCryptographyConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.CryptographySettings, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </configSections>
        <!--log4net setup : start-->
        <log4net>
          <root>
            <level value="ALL" />
            <appender-ref ref="RollingFileAppender" />
          </root>
          <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
            <param name="file" value="./log/pasteleditor" />
            <appendToFile value="true" />
            <rollingStyle value="Date" />
            <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
            <datePattern value="_yyyyMMdd&quot;.log&quot;" />
            <layout type="log4net.Layout.PatternLayout">
              <conversionPattern value="%message%newline" />
            </layout>
          </appender>
        </log4net>
        <!--log4net setup : end-->
        <appSettings>
          <add key="BACKGROUND_IMG_VPATH" value="/uploadData/backgroundImage" />
          <!--배경이미지 가상경로-->
          <add key="BACKGROUND_MUSIC_VPATH" value="/uploadData/music" />
          <!--음악파일경로(mp3)-->
          <add key="UPLOAD_IMAGE_VPATH" value="/uploadData/image/" />
          <add key="UPLOAD_CLIPART_VPATH" value="/uploadData/clipart_thumb/" />
          <add key="UPLOAD_DOCUMENT_VPATH" value="/uploadData/document/" />
          <add key="UPLOAD_MOVIE_VPATH" value="/uploadData/movie/" />
          <add key="UPLOAD_FRAME_VPATH" value="/uploadData/frame/" />
          <add key="UPLOAD_DRAW_VPATH" value="/uploadData/draw/" />
          <add key="UPLOAD_SHAPE_VPATH" value="/uploadData/shape/" />
          <add key="UPLOAD_CHART_VPATH" value="/uploadData/chart/" />
          <add key="UPLOAD_TEXT_VPATH" value="/uploadData/text/" />
          <add key="UPLOAD_LINK_MOVIE_VPATH" value="/uploadData/linkmovie/" />
          <add key="UPLOAD_LINK_VIEWER_VPATH" value="/uploadData/viewer/" />
          <add key="UPLOAD_BACK_THUMB_VPATH" value="/uploadData/backgroundImage_thumb/" />
          <add key="UPLOAD_VOICE_VPATH" value="/uploadData/voice/" />
          <add key="UPLOAD_EQUATION_VPATH" value="/uploadData/equation/" />
          <add key="UPLOAD_DOCUIMG_VPATH" value="/uploadData/docuimage/" />
          <add key="UPLOAD_TEMPLATE_VPATH" value="/uploadData/template/" />
          <add key="CMD_ENCODER_VPATH" value="/encoderData/" />
          <add key="CMD_TEX_VPATH" value="/texData/" />
          <add key="CMD_FLEX_VPATH" value="/flexData/" />
          <add key="CMD_SWF_VPATH" value="/swfData/" />
          <add key="TEMPDATA_VPATH" value="/tempData/" />
          <add key="META_XML_VPATH" value="/mxmlData/metaXML/" />
          <add key="USER_MXML_VPATH" value="/mxmlData/userMXML/" />
          <add key="COMPILED_MXML_VPATH" value="/mxmlData/compiledMXML/" />
          <add key="SMALLSWF_VPATH" value="/mxmlData/smallSWF/" />
          <add key="MAKEIMAGE_VPATH" value="/mxmlData/makeimage/" />
          <add key="MXML_THUMBLAIL_VPATH" value="/mxmlData/thumbnail/" />
          <add key="MXML_BACKGROUNDIMAGE_VPATH" value="/mxmlData/backgroundimage/" />
          <add key="MXML_TEMPLATEDATA_VPATH" value="/mxmlData/templateData/" />
          <add key="VOICEDATA_STREAMS_VPATH" value="/voicedata/streams/" />
          <add key="STREAMDATA_VPATH" value="/streamData/vod/media/" />
          <add key="BACKUPDATA_VPATH" value="/backup/" />
          <add key="HOST_NAME" value="localhost" />
          <add key="UPLOAD_DATA_VPATH" value="/uploadData/" />
          <add key="ADMIN_DATA_VPATH" value="/pastelData/adminData/" />
          <!--단위 : MB-->
          <add key="IMAGE_MAX_SIZE" value="1"/>
          <add key="MOVIE_MAX_SIZE" value="300"/>
          <add key="DOCUMENT_MAX_SIZE" value="100"/>
          <add key="ETC_MAX_SIZE" value="1"/>
          <add key="MP3_MAX_SIZE" value="10"/>
          <!--add key="OPENOFFICE_PATH" value="D:\temp\OpenOfficePortable\OpenOfficePortable.exe"/-->
          <add key="EBS_THUMBLAIL_VPATH" value="/thumbnailData" />
          <add key="OPENOFFICE_PAGE_LIMIT" value="true" />
          <add key="OPENOFFICE_PAGE_LIMIT_COUNT" value="10" />
        </appSettings>
        <fluorinefx>
          <settings>
            <!-- <application-handler>FluorineFx.Messaging.Adapter.ApplicationAdapter</application-handler> -->
            <rtmpServer>
              <threadpool minWorkerThreads="0" maxWorkerThreads="25" idleTimeout="60000" />
              <!-- Ping clients every "pingInterval" ms. Set to 0 to disable ghost detection code. -->
              <!-- Disconnect client after "maxInactivity" ms of not responding. -->
              <!-- Max. time in milliseconds to wait for a valid handshake. -->
              <rtmpConnection pingInterval="0" maxInactivity="60000" maxHandshakeTimeout="0" />
              <rtmptConnection pingInterval="5000" maxInactivity="60000" maxHandshakeTimeout="5000" />
              <rtmpTransport receiveBufferSize="4096" sendBufferSize="4096" tcpNoDelay="true" />
            </rtmpServer>
          </settings>
        </fluorinefx>
        <connectionStrings>
          <!--add name="KMDB" connectionString="provider=MSDAORA;Data Source=xxxxxxx;User ID=xxxxx;Password=xxxxxx;" providerName="System.Data.OleDb"/-->
          <add name="PastelEditorConnectionString" connectionString="data source=C:\6000.IIS_Data\Kings_2012\dataRoot\xxxxxxxx.db3" providerName="System.Data.SQLite" />
          <!--add name="PastelEditorConnectionString" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1545))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DBPEDRB)));user id=xxxxxx;password=xxxxxxx;pooling=false" providerName="System.Data.OracleClient" /-->
          <!--add name="PastelEditorEntities"          connectionString="metadata=res://*/DataSet.Model1.csdl|res://*/DataSet.Model1.ssdl|res://*/DataSet.Model1.msl;provider=System.Data.SQLite;provider connection string='data source=&quot;F:\2000.Project Data\2300.Year_Section\FY2010\201008.xxxxx\02.개발\04.Database\xxxxx.db3&quot;'" providerName="System.Data.EntityClient"/-->
        </connectionStrings>
        <securityCryptographyConfiguration>
          <hashProviders>
            <add algorithmType="System.Security.Cryptography.MD5CryptoServiceProvider, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="false" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="CL_MD5" />
            <add algorithmType="System.Security.Cryptography.SHA1Managed, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="false" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="CL_SHA1" />
            <add algorithmType="System.Security.Cryptography.SHA256Managed, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="false" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="CL_SHA256" />
            <add algorithmType="System.Security.Cryptography.SHA384Managed, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="false" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="CL_SHA384" />
            <add algorithmType="System.Security.Cryptography.SHA512Managed, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" saltEnabled="false" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="CL_SHA512" />
          </hashProviders>
          <symmetricCryptoProviders>
            <add algorithmType="System.Security.Cryptography.RijndaelManaged, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" protectedKeyFilename="C:\ubion\EncKey.key" protectedKeyProtectionScope="LocalMachine" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="CL_Rijndael" />
          </symmetricCryptoProviders>
        </securityCryptographyConfiguration>
        <system.web>
          <!--
                  컴파일된 페이지에 디버깅 기호를 삽입하려면
                  compilation debug="true"로 설정하십시오. 이렇게 하면
                  성능에 영향을 주므로 개발하는 동안에만 이 값을
                  true로 설정하십시오.
              -->
          <compilation debug="true" targetFramework="4.0">
          </compilation>
          <!--
                  <authentication> 섹션에서는 ASP.NET에서 사용되는
                  보안 인증 모드의 구성을 설정하여 들어오는
                  사용자를 식별할 수 있습니다.
              -->
          <authentication mode="Windows" />
          <!--
                  <customErrors> 섹션에서는 요청을 실행하는 동안
                  처리되지 않은 오류가 발생하는 경우 수행할 작업을
                  구성할 수 있습니다. 특히 이 섹션에서는
                  개발자가 오류 스택 추적 대신 html 오류 페이지가 표시되도록
                  구성할 수 있습니다.
    5.         <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                  <error statusCode="403" redirect="NoAccess.htm"/>
                  <error statusCode="404" redirect="FileNotFound.htm"/>
              </customErrors>
              -->
          <httpRuntime executionTimeout="90" maxRequestLength="2097000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />
          <httpModules>
            <add name="FluorineGateway" type="FluorineFx.FluorineGateway, FluorineFx" />
          </httpModules>
          <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
        </system.web>
        <!--
              IIS(Internet Information Services) 7.0에서 ASP.NET AJAX를 실행하려면
              system.webServer 섹션이 필요합니다. 이전 버전의 IIS에서는 필요하지 않습니다.
          -->
        <system.webServer>
          <security>
            <requestFiltering>
              <requestLimits maxAllowedContentLength="2000000000" />
            </requestFiltering>
          </security>
          <modules>
            <add name="FluorineGateway" type="FluorineFx.FluorineGateway, FluorineFx" preCondition="managedHandler" />
          </modules>
          <handlers>
            <add name="*.vbhtml_*" path="*.vbhtml" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.vbhtm_*" path="*.vbhtm" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.cshtml_*" path="*.cshtml" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.cshtm_*" path="*.cshtm" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.aspq_*" path="*.aspq" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.xamlx_*" path="*.xamlx" verb="*" type="System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.xoml_*" path="*.xoml" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.svc_*" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.soap_*" path="*.soap" verb="*" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.rem_*" path="*.rem" verb="*" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="*_AppService.axd_*" path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="eurl.axd_*" path="eurl.axd" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode,runtimeVersionv2.0" />
          </handlers>
          <validation validateIntegratedModeConfiguration="false" />
        </system.webServer>
        <startup>
          <supportedRuntime version="v2.0.50727" />
        </startup>
      </configuration>

    댓글 없음:

    댓글 쓰기