<?xml version="1.0" encoding="utf-8"?>
<HmsTranscodingConfig version="2.01">
  <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>Нет скрипта</TranscodingConditionSyntaxType>
      <TranscodingComment></TranscodingComment>
      <TranscodingFolder></TranscodingFolder>
      <TranscodingMediaType>1</TranscodingMediaType>
      <TranscodingMimeType></TranscodingMimeType>
      <TranscodingMimeTypeScript>var
  bWav: Boolean;
  iSampleRate, iChannels, iBitsPerSample: Integer; 
begin
  bWav := Pos(&apos;wav&apos;, cfgTranscodingAudioMimeType) &gt; 0;  
  if bWav or SameText(Copy(cfgTranscodingAudioMimeType, 1, 7), &apos;audio/L&apos;) then begin
    iChannels := mpChannels;                                     
    if iChannels &gt; cfgTranscodingLpcmMaxChannels then  
      iChannels := cfgTranscodingLpcmMaxChannels
    else if iChannels &lt; 2 then  
      iChannels := 2;
    iSampleRate   := mpAudioSampleRate;
    if iSampleRate &gt; cfgTranscodingLpcmMaxSampleRate then
      iSampleRate := cfgTranscodingLpcmMaxSampleRate      
    else if iSampleRate &lt; 44100 then    
      iSampleRate := 44100;
    iBitsPerSample := mpBitsPerSample;    
    if iBitsPerSample &gt; cfgTranscodingLpcmMaxBitsPerSample then    
      iBitsPerSample := cfgTranscodingLpcmMaxBitsPerSample
    else if iBitsPerSample &lt; 16 then
      iBitsPerSample := 16;        
    if bWav then
      MimeType := cfgTranscodingAudioMimeType    
    else
      MimeType := &apos;audio/L&apos; + IntToStr(iBitsPerSample);        
    MimeType := MimeType + Format(&apos;;rate=%d;channels=%d;bits=%d&apos;, [iSampleRate, iChannels, iBitsPerSample]) 
  end else
    MimeType := cfgTranscodingAudioMimeType      
end.</TranscodingMimeTypeScript>
      <TranscodingMimeTypeSyntaxType>PascalScript</TranscodingMimeTypeSyntaxType>
      <TranscodingMode>0</TranscodingMode>
      <TranscodingParams>function GetMetadataEx(const aParams: array of Variant): string;
var
  i, iTagsSize: Integer;  
  sPropertyValue: string;
begin
  Result := &apos;&apos;;  
  if cfgTranscodingAudioTagsSize &lt;&gt; 0 then begin
    if cfgTranscodingAudioTagsSize &gt; 0 then    
      iTagsSize := cfgTranscodingAudioTagsSize * 1024      
    else               
      iTagsSize := -1;
    Result := Format(&apos;-tags_size %d &apos;, [iTagsSize]);
    i := 0;  
    while i &lt; Length(aParams) do begin
      sPropertyValue := VarToStr(CurrentMediaItem[aParams[i]]);    
      if sPropertyValue &lt;&gt; &apos;&apos; then    
        Result := Result + Format(&apos;-metadata "%s=%s" &apos;, [aParams[i + 1], ReplaceStr(sPropertyValue, &apos;"&apos;, &apos;&apos;)]);
      Inc(i, 2)   
    end    
  end else  
    Result := &apos;-vn &apos; 
end;

function GetMetadata: string;
begin
  Result := GetMetadataEx([
     mpiTitle, &apos;title&apos;, mpiAuthor, &apos;author&apos;,  mpiAlbum, &apos;album&apos;,
     mpiYear, &apos;year&apos;,  mpiGenre, &apos;genre&apos;,  mpiTrack, &apos;track&apos;,
     mpiAuthor, &apos;artist&apos;, mpiAuthor, &apos;performer&apos;, mpiComposer, &apos;composer&apos;,
     mpiConductor, &apos;conductor&apos;, mpiAlbumArtist, &apos;album_artist&apos;, mpiPartNo, &apos;disc&apos;])     
end;

var
  bWav, bFlac: Boolean;
  iBitsPerSample, iChannels, iSampleRate: Integer;
  sInputCodec, sInputFileName, sMimeType, sOutputFormat, 
  sStreamType, sStreamHeader, sStartTime: string;  
begin
  if mpDvdItem then
    HmsCreateResourcePipe(sInputFileName)
  else begin  
    sInputFileName := &apos;&lt;INPUT FILE&gt;&apos;;
    if mpInternetItem and (Pos(&apos;\\.\pipe\&apos;, InputFileName) = 0) then 
      if HmsCreateInternetRadioStream(InputFileName, sInputFileName, sStreamType, sStreamHeader) then    
        mpFileType := &apos;mp3&apos;          
  end;        

  TranscodingParams := Format(&apos;-f mp3 -i "%s" %s -f mp3 -acodec copy "&lt;OUTPUT FILE&gt;"&apos;, [sInputFileName, GetMetadata]);
            
  if not mpInternetItem and (mpTimeStart &lt;&gt; &apos;&apos;) then begin
    sStartTime := &apos;-ss &apos; + mpTimeStart;
    if mpTimeLength &lt;&gt; &apos;&apos; then
      sStartTime := sStartTime + &apos; -t &apos; + Copy(mpTimeLength, 1, 8);
    TranscodingParams := sStartTime + &apos; &apos; + TranscodingParams
  end;
  //HmsLogMessage(1, &apos;Музыка MP3&apos;);
end.</TranscodingParams>
      <TranscodingParamsSyntaxType>PascalScript</TranscodingParamsSyntaxType>
      <TranscodingProfile>Музыка MP3</TranscodingProfile>
      <TranscodingProfileActive>-1</TranscodingProfileActive>
      <TranscodingProfilePriority>0</TranscodingProfilePriority>
      <TranscodingProfileUuid>b677af96-ac4e-4d16-b1b6-137b5a3f5624</TranscodingProfileUuid>
    </Profile>
  </TranscodingProfileList>
</HmsTranscodingConfig>
