<?xml version="1.0" encoding="utf-8"?>
<HmsTranscodingConfig version="2.28">
  <TranscoderList>
    <Transcoder>
      <Name>HMSMPEG</Name>
      <Path>hmsmpeg.exe</Path>
      <HomePage>http://www.ffmpeg.org/</HomePage>
      <Download></Download>
    </Transcoder>
    <Transcoder>
      <Name>HmsMPEG</Name>
      <Path>Hmsmpeg.exe</Path>
      <HomePage>http://www.ffmpeg.org/</HomePage>
      <Download></Download>
    </Transcoder>
    <Transcoder>
      <Name>hmsMPEG</Name>
      <Path>hmsmpeg.exe</Path>
      <HomePage>http://www.ffmpeg.org/</HomePage>
      <Download></Download>
    </Transcoder>
  </TranscoderList>
  <TranscodingProfileList>
    <Profile>
      <TranscoderName>HMSMPEG</TranscoderName>
      <TranscodingCondition></TranscodingCondition>
      <TranscodingConditionSyntaxType>PascalScript</TranscodingConditionSyntaxType>
      <TranscodingComment></TranscodingComment>
      <TranscodingFolder>Транскодирование без перекодирования видео</TranscodingFolder>
      <TranscodingMediaType>3</TranscodingMediaType>
      <TranscodingMimeType></TranscodingMimeType>
      <TranscodingMimeTypeScript>begin
  FileExt := HmsTranscodingFormatFileExt(cfgTranscodingFileFormat);
  if FileExt &lt;&gt; &apos;&apos; then begin
    MimeType := HmsGetMimeType(FileExt);    
    if MimeType = &apos;&apos; then                                              
      MimeType := HmsTranscodingFormatMimeType(cfgTranscodingFileFormat);
  end else
    MimeType := &apos;&apos;            
end.
</TranscodingMimeTypeScript>
      <TranscodingMimeTypeSyntaxType>PascalScript</TranscodingMimeTypeSyntaxType>
      <TranscodingMode>1</TranscodingMode>
      <TranscodingParams>const
  csFFMpegVideoParams = &apos; -vcodec %s %s%s -pix_fmt yuv420p&apos;;
  csFFMpegAudioParams = &apos; -acodec %s -ab %d -ar %d -ac %d&apos;;
  
  csTranscodingInputFile = &apos;-i "&lt;INPUT FILE&gt;" &apos;;  

procedure AddDecoderParams(var aParams: string; const aCodecName: string; const aParameterName: string);
var
  sDecoderParams: string;
begin
  if aCodecName &lt;&gt; &apos;&apos; then begin
    sDecoderParams := HmsTranscodingDecoderParams(aCodecName);
    if sDecoderParams &lt;&gt; &apos;&apos; then
      aParams := Format(&apos;%s %s %s &apos;, [aParams, aParameterName, sDecoderParams])
  end
end;
    
function GetInputParameters(var aTwoInputFile: Boolean): string;
var
  bPipe: Boolean;
  iAudioDelay, iStartTime: Integer;
  sAudioFileName, sVideoFileName, sVideoCodecName, sAudioCodecName, sResourcePipe,
  sAudioInputParams, sDelayOffset, sProbeParameters, sStartOffset: string;
begin
  sProbeParameters := HmsTranscodingProbeParams;
  sResourcePipe := &apos;&apos;;                                                      
  bPipe := Pos(&apos;\\.\pipe\&apos;, InputFileName) &gt; 0;
  if bPipe then                 
            
  else if (mpIsoItem or mpDvdItem or mpBdItem or mpDvbItem) and HmsCreateResourcePipe(sResourcePipe) then begin
    InputFileName := sResourcePipe;      
    bPipe := True;      
  end else if mpPodcastItem then begin
    InputFileName := HmsGetItemProperty(mpiMediaResourceSource);    
    bPipe := Pos(&apos;\\.\pipe\&apos;, InputFileName) &gt; 0;
  end;   
  
  if bPipe then begin
    sVideoFileName := InputFileName;
    sAudioFileName := InputFileName;  
    iStartTime  := 0;
    iAudioDelay := 0;
  end else begin     
    sVideoFileName := HmsGetStreamParam(stVideo, mpVideoStreamNo, siStreamFilePath);
    sAudioFileName := HmsGetStreamParam(stAudio, mpAudioStreamNo, siStreamFilePath);  
    iStartTime := HmsTimeConvert(mpTimeStart);
    iAudioDelay := StrToIntDef(HmsGetVideoSettings(vstAudioDelay), 0);    
  end;      
  
  sVideoCodecName := HmsGetStreamParam(stVideo, mpVideoStreamNo, siStreamCodecName); 
  sAudioCodecName := HmsGetStreamParam(stAudio, mpAudioStreamNo, siStreamCodecName);

  aTwoInputFile := (iAudioDelay &lt;&gt; 0) or (sAudioFileName &lt;&gt; sVideoFileName);
  
  if mpFileType &lt;&gt; &apos;&apos; then
    Result := &apos;-f "&apos; + mpFileType + &apos;" &apos;
  else
    Result := &apos;&apos;;
    
  AddDecoderParams(Result, sVideoCodecName, &apos;-vcodec&apos;);
  if not aTwoInputFile then 
    AddDecoderParams(Result, sAudioCodecName, &apos;-acodec&apos;);    

  if sVideoFileName &lt;&gt; &apos;&apos; then
    Result := Result + Format(&apos;-i "%s" &apos;, [sVideoFileName])
  else if (InputFileName &lt;&gt; &apos;&apos;) and (InputFileName[1] = &apos;-&apos;) then                         
    Result := Result + InputFileName + &apos; &apos;
  else
    Result := Result + csTranscodingInputFile;
    
  if (iStartTime &gt; 0) or (iAudioDelay &lt;&gt; 0) or aTwoInputFile then begin
    sAudioInputParams := &apos;&apos;;
    if aTwoInputFile then
      AddDecoderParams(sAudioInputParams, sAudioCodecName, &apos;-acodec&apos;);  
    if sAudioFileName &lt;&gt; &apos;&apos; then
      sAudioInputParams := sAudioInputParams + Format(&apos;-i "%s" &apos;, [sAudioFileName])
    else if (InputFileName &lt;&gt; &apos;&apos;) and (InputFileName[1] = &apos;-&apos;) then                         
      sAudioInputParams := sAudioInputParams + InputFileName + &apos; &apos;
    else  
      sAudioInputParams := sAudioInputParams + csTranscodingInputFile;
    
    if iStartTime &gt; 0 then
      sStartOffset := &apos;-ss &apos; + HmsTimeFormat(iStartTime) + &apos; &apos;
    else
      sStartOffset := &apos;&apos;;
    
    if iAudioDelay &lt;&gt; 0 then
      sDelayOffset := &apos;-ss &apos; + HmsTimeFormat(iStartTime + Trunc(Abs(iAudioDelay))) + &apos; &apos;
    else
      sDelayOffset := &apos;&apos;;
    
    if iAudioDelay &gt; 0 then
      Result := sStartOffset + Result + sProbeParameters + sDelayOffset + sAudioInputParams
    else if iAudioDelay &lt; 0 then
      Result := sDelayOffset + Result + sProbeParameters + sStartOffset + sAudioInputParams
    else if aTwoInputFile then
      Result := sStartOffset + Result + sProbeParameters + sStartOffset + sAudioInputParams
    else
      Result := sStartOffset + Result
  end;
  Result := sProbeParameters + Result
end;    

procedure GetAudioTranscodingParams(const aAudioCodec: string; 
    var aCodecName, aFileFormat: string; var aCodecID, aAudioBitrate, aAudioChannels: Integer);
begin
  aAudioBitrate := cfgTranscodingAudioBitrate;  
  if (cfgTranscodingAudioChannels &lt;&gt; 0) then  
    aAudioChannels := cfgTranscodingAudioChannels;
  if aAudioCodec = &apos;&apos; then
    aCodecName := HmsTranscodingEncoderParams(&apos;AC3&apos;)
  else  
    aCodecName := HmsTranscodingEncoderParams(aAudioCodec);  
  if SameText(aAudioCodec, &apos;AAC&apos;) then begin
    aFileFormat := &apos;adts&apos;;
    aCodecID    := CODEC_ID_AAC; 
  end else if SameText(aAudioCodec, &apos;MP3&apos;) then begin
    aFileFormat := &apos;mp3&apos;;
    aCodecID    := CODEC_ID_MP3;
    if aAudioBitrate &gt; 320000 then
      aAudioBitrate := 320000;
    if aAudioChannels &gt; 2 then
      aAudioChannels := 2;      
  end else if SameText(aAudioCodec, &apos;MP2&apos;) then begin  
    aFileFormat := &apos;mp2&apos;;
    aCodecID    := CODEC_ID_MP2;
    if aAudioBitrate &gt; 320000 then
      aAudioBitrate := 320000;      
    if aAudioChannels &gt; 2 then
      aAudioChannels := 2;      
  end else if SameText(aAudioCodec, &apos;LPCM&apos;) then begin  
    aFileFormat := &apos;s16be&apos;;
    aCodecID    := CODEC_ID_PCM_BLURAY;
  end else if SameText(aAudioCodec, &apos;DTS&apos;) then begin  
    aFileFormat := &apos;dts&apos;;
    aCodecID    := CODEC_ID_DTS;
    aAudioChannels := 0    
  end else if SameText(aAudioCodec, &apos;WMA&apos;) then begin  
    aFileFormat := &apos;asf&apos;;
    aCodecID    := CODEC_ID_WMAV2;    
    if aAudioChannels &gt; 2 then
      aAudioChannels := 2;      
  end else begin
    aFileFormat := &apos;ac3&apos;;    
    if SameText(aAudioCodec, &apos;AC3&apos;) then
      aCodecID := CODEC_ID_AC3
    else                          
      aCodecID := CODEC_ID_NONE;
  end  
end;

function GetFileFormat(const aFileFormat: string): string;
begin
  Result := HmsTranscodingFormatParams(aFileFormat)
end;

function GetVideoCodec(const aVideoCodec: string): string;
begin
  if aVideoCodec = &apos;&apos; then
    Result := &apos;mpeg2video&apos;    
  else  
    Result := HmsTranscodingEncoderParams(aVideoCodec)
end;

function GetMultiThreadSupported(const aVideoCodec: string): Boolean;
begin
  Result := not MatchText(aVideoCodec, [&apos;WMV&apos;, &apos;MPEG1&apos;, &apos;FLV&apos;])
end;

function GetAudioBitrate(const aAudioCodec: string; aAudioBitrate: Integer): Integer;
begin
  if MatchText(aAudioCodec, [&apos;MP2&apos;, &apos;MP3&apos;]) and (aAudioBitrate &gt; 320000) then
    Result := 320000
  else
    Result := aAudioBitrate
end;

function GetAudioSampleRate(const aFileFormat, aAudioCodec: string): Integer;
begin
  if MatchText(aFileFormat, [&apos;FLV&apos;]) and not SameText(aAudioCodec, &apos;AAC&apos;) then  
    Result := 44100
  else
    Result := 48000
end;

function GetAudioChannels(const aAudioCodec: string; aConfigAudioChannels, aStreamAudioChannels: Integer): Integer;
begin
  if aConfigAudioChannels &gt; 0 then
    Result := aConfigAudioChannels
  else
    Result := aStreamAudioChannels;
  if (Result &gt; 2) and MatchText(aAudioCodec, [&apos;MP2&apos;, &apos;MP3&apos;]) then
    Result := 2
  else if (Result = 1) and MatchText(aAudioCodec, [&apos;AAC&apos;, &apos;AC3&apos;]) then
    Result := 2
  else if Result &gt; 6 then
    Result := 6
end;

function VideoCodecCompatible: Boolean;
begin
  if (cfgTranscodingFileFormat = &apos;&apos;) or SameText(cfgTranscodingFileFormat, &apos;MPEG (DVD)&apos;) then
    Result := MatchText(mpVideoCodec, [&apos;MPEG2VIDEO&apos;, &apos;MPEG1VIDEO&apos;])
  else if (Pos(&apos;MPEGTS&apos;, cfgTranscodingFileFormat) &gt; 0) then
    Result := MatchText(mpVideoCodec, [&apos;H264&apos;, &apos;MPEG2VIDEO&apos;, &apos;MPEG1VIDEO&apos;, &apos;MPEG4&apos;])    
  else if MatchText(cfgTranscodingFileFormat, [&apos;HLS&apos;, &apos;DASH&apos;, &apos;HDS&apos;, &apos;ISMC&apos;]) then
    Result := MatchText(mpVideoCodec, [&apos;H264&apos;])
  else if Pos(&apos;ASF&apos;, cfgTranscodingFileFormat) &gt; 0 then
    Result := MatchText(mpVideoCodec, [&apos;H264&apos;, &apos;MPEG4&apos;, &apos;WMV2&apos;])
  else if SameText(cfgTranscodingFileFormat, &apos;MP4&apos;) then
    Result := MatchText(mpVideoCodec, [&apos;H264&apos;, &apos;MPEG4&apos;])    
  else if SameText(cfgTranscodingFileFormat, &apos;FLV&apos;) then
    Result := MatchText(mpVideoCodec, [&apos;H264&apos;, &apos;FLV&apos;])
  else if SameText(cfgTranscodingFileFormat, &apos;MPEG1&apos;) then
    Result := MatchText(mpVideoCodec, [&apos;MPEG2VIDEO&apos;, &apos;MPEG1VIDEO&apos;])
  else if SameText(cfgTranscodingFileFormat, &apos;WEBM&apos;) then  
    Result := MatchText(mpVideoCodec, [&apos;VP8&apos;, &apos;VP9&apos;])    
  else  if SameText(cfgTranscodingFileFormat, &apos;MKV&apos;) then  
    Result := True    
  else
    Result := False
end;

procedure AddFilterParams(var aFilterParams: string; const aAddParams: string);
begin
  if aFilterParams &lt;&gt; &apos;&apos; then
    aFilterParams := aFilterParams + &apos;,&apos;;
  aFilterParams := aFilterParams + aAddParams
end;
  
var
  bMapStreams, bDeinterlace, bh264_mp4toannexb, bSuccess, bAudioTranscoding, bVideoTranscoding, bTwoInputFile: Boolean;
  iAudioBitrate, iAudioChannels, iAudioCfgBitrate, iAudioCfgCodecID, iAudioFileNo, iAudioStreamNo, iAudioStreamID,
  iCodecID, iFrameWidth, iFrameHeight, iWidth, iHeight, iNewHeight, iCropTop, iCropBottom, 
  iPadLeft, iPadTop, iPadRight, iPadBottom, iVideoCodecID, iAudioCodecID, iVideoStreamNo, iVideoStreamID: Integer;  
  sVideoTranscodingParams, sAudioTranscodingParams, sTranscodingParams,
  sAudioCfgCodecName, sAudioCfgFileFormat, sFrameRate, sVideoBitrate, 
  sVideoMinMaxRate, sFilterParams, sPadParams, sAudioVolume, sDVDAspectRatio: string;
begin
  if HmsGetStreamCount = 0 then  
    HmsRetrieveProperties;
  bVideoTranscoding := False;      
  bAudioTranscoding := False;    
  iVideoStreamNo := mpVideoStreamNo;
  if iVideoStreamNo &lt; 0 then
    iVideoStreamNo := 0;      
  iAudioStreamNo := mpAudioStreamNo;
  if iAudioStreamNo &lt; 0 then
    iAudioStreamNo := 0;      
  iVideoCodecID  := HmsGetStreamCodecID(stVideo, iVideoStreamNo);  
  iAudioCodecID  := HmsGetStreamCodecID(stAudio, iAudioStreamNo);      
  iAudioChannels := HmsGetStreamChannels(iAudioStreamNo);    
  if iAudioChannels &lt; 2 then iAudioChannels := 2;  
  iAudioBitrate  := HmsGetStreamBitrate(stAudio, iAudioStreamNo);
  sTranscodingParams := &apos;&apos;; 
  bVideoTranscoding := False;    
  bAudioTranscoding := False;
  sAudioVolume := HmsGetVideoSettings(vstAudioVolume);
  if mp3DVideoType = 0 then begin
    sDVDAspectRatio := HmsGetVideoSettings(vstDVDAspectRatio);
    if sDVDAspectRatio = &apos;&apos; then
      sDVDAspectRatio := mpDVDAspectRatio;
    if (sDVDAspectRatio &lt;&gt; &apos;&apos;) and not MatchText(sDVDAspectRatio, [&apos;16:9&apos;, &apos;16/9&apos;]) then
      sDVDAspectRatio := &apos;&apos;;
  end else
    sDVDAspectRatio := &apos;&apos;;
  if SameText(HmsGetVideoSettings(vstVideoOriginal), &apos;On&apos;) then
    bVideoTranscoding := False    
  else if SameText(HmsGetVideoSettings(vstVideoOriginal), &apos;Off&apos;) then    
    bVideoTranscoding := True 
  else if (mpSubtitleLanguage &lt;&gt; &apos;&apos;) or (HmsGetVideoSettings(vstSubtitle) &lt;&gt; &apos;&apos;) or bDeinterlace then    
    bVideoTranscoding := True     
  else if (mpFrameRate &gt; 0) and (mpFrameRate &lt; 20) then
    bVideoTranscoding := True      
  else if not VideoCodecCompatible then
    bVideoTranscoding := True
  else if sDVDAspectRatio &lt;&gt; &apos;&apos; then
    bVideoTranscoding := True
  else begin        
    if (mpOriginalWidth &gt; 0) then begin    
      iWidth  := mpOriginalWidth;      
      iHeight := mpOriginalHeight;
    end else begin    
      iWidth  := mpWidth;      
      iHeight := mpHeight;
    end;               
    if (iWidth &gt; cfgMaximumVideoResolutionWidth) or (iHeight &gt; cfgMaximumVideoResolutionHeight) then
      bVideoTranscoding := True  
  end;        
  GetAudioTranscodingParams(cfgTranscodingAudioCodec, sAudioCfgCodecName,
          sAudioCfgFileFormat, iAudioCfgCodecID, iAudioCfgBitrate, iAudioChannels);      
  if SameText(HmsGetVideoSettings(vstAudioOriginal), &apos;On&apos;) then
    bAudioTranscoding := False    
  else if SameText(HmsGetVideoSettings(vstAudioOriginal), &apos;Off&apos;) then    
    bAudioTranscoding := True
  else if (iAudioCodecID &lt;&gt; iAudioCfgCodecID) or 
       ((cfgTranscodingAudioChannels &lt;&gt; 0) and (cfgTranscodingAudioChannels &lt;&gt; iAudioChannels)) or
       ((cfgTranscodingFileFormat = &apos;FLV&apos;) and 
         (GetAudioSampleRate(cfgTranscodingFileFormat, cfgTranscodingAudioCodec) &lt;&gt; mpAudioSampleRate)) then
    bAudioTranscoding := True
  else if sAudioVolume &lt;&gt; &apos;&apos; then
    bAudioTranscoding := True;
  if bVideoTranscoding then begin
    sVideoMinMaxRate := &apos;&apos;;         
    if cfgTranscodingVideoBitrate &gt; 0 then begin  
      sVideoBitrate := &apos;-b:v &apos; + IntToStr(cfgTranscodingVideoBitrate);
      if cfgTranscodingVideoMinMaxRate then
        sVideoMinMaxRate := Format(&apos; -minrate %d -maxrate %d -bufsize %d&apos;,
                    [cfgTranscodingVideoBitrate, cfgTranscodingVideoBitrate, 
                     HmsTranscodingBufferSize(cfgTranscodingVideoBitrate)])
    end else
      sVideoBitrate := &apos;-q:v 0&apos;;
    sVideoTranscodingParams := Format(csFFMPegVideoParams, 
            [GetVideoCodec(cfgTranscodingVideoCodec), sVideoBitrate,
                           sVideoMinMaxRate]);
    sFrameRate := HmsGetVideoSettings(vstFrameRate);
    if sFrameRate = &apos;&apos; then    
      sFrameRate := cfgTranscodingFrameRate;
    if sFrameRate = &apos;&apos; then begin
      if SameText(cfgTranscodingVideoCodec, &apos;FLV&apos;) then      
        sFrameRate := FormatFloat(&apos;0&apos;, mpFrameRate)
      else if (mpFrameRate &gt; 0) and (mpFrameRate &lt; 20) then 
        sFrameRate := &apos;25.000&apos;
    end;          
    if sFrameRate &lt;&gt; &apos;&apos; then
      sVideoTranscodingParams := sVideoTranscodingParams + &apos; -r &apos; + sFrameRate;
    iWidth := mpWidth; iHeight := mpHeight;  
    if (iWidth &gt; 0) and (iHeight &gt; 0) then begin
      sFilterParams := &apos;&apos;; sPadParams := &apos;&apos;; 
      if sDVDAspectRatio &lt;&gt; &apos;&apos; then begin
        iNewHeight := (Round((iWidth / 16) * 9) div 2) * 2;
        if iNewHeight &lt; iHeight then begin
          iCropTop := (iHeight - iNewHeight) div 2;
          iCropBottom := iHeight - iNewHeight - iCropTop;
          iHeight := iNewHeight;
          sFilterParams := Format(&apos;crop=in_w:in_h-%d:0:%d&apos;, [iCropTop + iCropBottom, iCropTop])
        end
      end;    
      if HmsTranscodingFrameParams(iWidth, iHeight, cfgTranscodingScreenFormat,
                         iPadLeft, iPadTop, iPadRight, iPadBottom) then begin                         
        if mp3DVideoType in [1, 2] then begin
          iWidth  := iWidth  + iPadLeft + iPadRight;
          iHeight := iHeight + iPadTop + iPadBottom;                 
          if mp3DVideoType = 1 then
            iWidth  := (iWidth div 4) * 4
          else
            iHeight := (iHeight div 4) * 4          
        end;
        iFrameWidth  := iWidth;
        iFrameHeight := iHeight;
        if (mp3DVideoType = 0) and ((iPadLeft &gt; 0) or (iPadRight &gt; 0) or (iPadTop &gt; 0) or (iPadBottom &gt; 0)) then begin        
          Inc(iFrameWidth,  iPadLeft + iPadRight);
          Inc(iFrameHeight, iPadTop + iPadBottom);
          sPadParams := Format(&apos;pad=%d:%d:%d:%d:0x%s&apos;,
                        [iFrameWidth, iFrameHeight, iPadLeft, iPadTop, HmsConvertColor(cfgTranscodingPadColor)]);
          if cfgTranscodingFrameExists then
            sVideoTranscodingParams := sVideoTranscodingParams + cfgTranscodingFrameParams;
        end
      end else begin
        iFrameWidth  := iWidth;
        iFrameHeight := iHeight;
      end;
      AddFilterParams(sFilterParams, Format(&apos;scale=%d:%d&apos;, [iWidth, iHeight]));
      if sPadParams &lt;&gt; &apos;&apos; then AddFilterParams(sFilterParams, sPadParams);
      AddFilterParams(sFilterParams, &apos;setdar=&apos; + cfgTranscodingAspectRatio);
      sVideoTranscodingParams := sVideoTranscodingParams + Format(&apos; -vf "%s"&apos;, [sFilterParams]);
      sVideoTranscodingParams := sVideoTranscodingParams + HmsTranscodingSubTitleParams(
         iFrameWidth, iFrameHeight, iWidth, iHeight, iPadLeft, iPadTop);
      if (cfgTranscodingThreadCount &gt; 1) and GetMultiThreadSupported(cfgTranscodingVideoCodec) then
        sVideoTranscodingParams := sVideoTranscodingParams + &apos; -threads &apos; + IntToStr(cfgTranscodingThreadCount);
    end    
  end else begin  
    sVideoTranscodingParams := &apos; -copyinkf -vcodec copy &apos;;
    if SameText(mpVideoCodec, &apos;H264&apos;) then begin    
      if VarToStr(mpCodecNalLengthSize) &lt;&gt; &apos;&apos; then      
        bh264_mp4toannexb := VarToStr(mpCodecNalLengthSize) &lt;&gt; &apos;0&apos;        
      else                         
        bh264_mp4toannexb := not MatchText(mpFileType, [&apos;mpegts&apos;, &apos;wtv&apos;, &apos;hls&apos;, &apos;applehttp&apos;], True);        
      if bh264_mp4toannexb then
        sVideoTranscodingParams := sVideoTranscodingParams + &apos; -vbsf h264_mp4toannexb&apos;
    end        
  end;                 
  if bAudioTranscoding then begin  
    sAudioTranscodingParams := Format(csFFMpegAudioParams, [sAudioCfgCodecName, iAudioCfgBitrate, 
        GetAudioSampleRate(cfgTranscodingFileFormat, cfgTranscodingAudioCodec), iAudioChannels]);
    if sAudioVolume &lt;&gt; &apos;&apos; then
      sAudioTranscodingParams := sAudioTranscodingParams + &apos; -af volume=&apos; + sAudioVolume + &apos;dB&apos;;  // :eval=frame
  end else                   
    sAudioTranscodingParams := &apos; -acodec copy&apos;;     
  bMapStreams := HmsGetStreamCount &gt; 0;
  sTranscodingParams := GetInputParameters(bTwoInputFile);
  sTranscodingParams := sTranscodingParams + &apos;-f &apos; + GetFileFormat(cfgTranscodingFileFormat);
  sTranscodingParams := sTranscodingParams + sVideoTranscodingParams + sAudioTranscodingParams;  
  
  if bMapStreams then begin
    iVideoStreamID := HmsGetStreamID(stVideo, iVideoStreamNo);
    iAudioStreamID := HmsGetStreamID(stAudio, iAudioStreamNo);    
    if not bTwoInputFile and (iVideoStreamID &gt; 0) and (iAudioStreamID &gt; 0) then
      sTranscodingParams := sTranscodingParams + Format(&apos; -vstreamid %d -astreamid %d&apos;, [iVideoStreamId, iAudioStreamId])
    else begin                                                      
      if bTwoInputFile then begin    
        iAudioFileNo := 1
      end else begin
        iAudioFileNo := 0;
      end;          
      sTranscodingParams := sTranscodingParams + Format(&apos; -map 0:%d -map %d:%d&apos;, 
                                  [HmsGetStreamIndex(stVideo, iVideoStreamNo),
                                   iAudioFileNo, 
                                   HmsGetStreamIndex(stAudio, iAudioStreamNo)]);
    end
  end;   
  if (cfgTranscodingLeadTime &gt; 0) and (TranscodingMode = tmNormal) then
    sTranscodingParams := sTranscodingParams + Format(&apos; -lt %d&apos;, [cfgTranscodingLeadTime]);
  sTranscodingParams := sTranscodingParams + &apos; "&lt;OUTPUT FILE&gt;"&apos;;  
//  TranscodingParams := sTranscodingParams;
  TranscodingResult := HmsTranscodingExecute(&apos;HMSMPEG&apos;, sTranscodingParams, True, InputFileName, OutputFileName)                       
end.</TranscodingParams>
      <TranscodingParamsSyntaxType>PascalScript</TranscodingParamsSyntaxType>
      <TranscodingProfile>Фильмы (Ремуксирование) (25fps+dl 6)</TranscodingProfile>
      <TranscodingProfileActive>-1</TranscodingProfileActive>
      <TranscodingProfilePriority>0</TranscodingProfilePriority>
      <TranscodingProfileUuid>6d153a01-6207-4503-8a0f-6b4cf722e95e</TranscodingProfileUuid>
    </Profile>
  </TranscodingProfileList>
</HmsTranscodingConfig>
