Unanswered UI vs. SDK encoding

  • Wednesday, November 14, 2012 7:52 AM
     
      Has Code

    Hello,

    I'm trying to encode a large (~70GB) 'mov' file using the EE4 SP2 SDK (4.0.4276.0). My app is really simple - it only loades a job file, attaches a progess event handler and starts the encoding.

    using Microsoft.Expression.Encoder;
    using NLog;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace EncoderTest
    {
        class Program
        {
            private static readonly Logger logger = LogManager.GetCurrentClassLogger();
    
            static void Main(string[] args)
            {
                Console.WriteLine("START");
                logger.Info("START");
    
                var job = Job.LoadJob(args[0]);
                job.EncodeProgress += EncodeProgressHandler;
                job.Encode();
    
                Console.WriteLine("");
                Console.WriteLine("END");
                logger.Info("END");            
            }
    
            static void EncodeProgressHandler(object sender, EncodeProgressEventArgs e)
            {
                Console.Write("Pass: {0}, {1:0.00}%        \r", e.CurrentPass, e.Progress);
                logger.Trace("Pass: {0}, {1:0.00}%", e.CurrentPass, e.Progress);
            }
        }
    }
    

    The problem is that the execution hangs after 100% of the second pass. The 'ismv' file is created properly but the server and client manifests don't get created at all. I had the same result using some other large video file.

    The interesting part is that when I ran exactly the same job file through the EE UI everything went fine.

    Could you give me some hint on this? Is the SDK lacking some configuration which the UI doesn't?

    I use 'EDITBIN /LARGEADDRESSAWARE' as the post-build event.

    Here's the job file:

    <?xml version="1.0" encoding="utf-16"?>
    <!--Created with Expression Encoder version 4.0.4276.0-->
    <JobFile
      Version="4.0">
      <Job
        OutputDirectory="d:\vod_converted\movies\1024"
        CreateSubfolder="False"
        JobId="VODKA 2012-11-14 08.50.46">
        <MediaFiles>
          <MediaFile
            Source="d:\vod_ftp\1024\1352726744_cb572cd3a3f7ca58f00576eac616975f.mov"
            OutputFileName="v1106_a1106.{DefaultExtension}">
            <OutputFormat>
              <WindowsMediaOutputFormat>
                <VideoProfile>
                  <AdvancedVC1VideoProfile
                    SmoothStreaming="True"
                    ClosedGop="True"
                    OutputMode="ElementaryStreamSequenceHeader"
                    OptimizeForAnimation="False"
                    DifferentialQuantization="Off"
                    InLoopFilter="True"
                    MotionSearchRange="MacroblockAdaptive"
                    BFrameCount="1"
                    AdaptiveDeadZone="Conservative"
                    AdaptiveGop="True"
                    DenoiseFilter="False"
                    KeyFrameDistance="00:00:02"
                    MotionChromaSearch="LumaOnly"
                    MotionMatchMethod="SAD"
                    NoiseEdgeRemovalFilter="False"
                    OverlapSmoothingFilter="True"
                    MotionVectorCost="Static"
                    Complexity="Normal"
                    AutoFit="True"
                    Force16Pixels="False"
                    FrameRate="0"
                    SeparateFilesPerStream="False"
                    NumberOfEncoderThreads="0">
                    <Streams
                      AutoSize="True"
                      FreezeSort="False">
                      <StreamInfo
                        Size="1920, 1080">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="6000"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="6000"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1920, 1080">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="5220"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="4176"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1280, 720">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="4360"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="2907"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1280, 720">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="3034"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="2023"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="852, 480">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="2112"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="1408"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="852, 480">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="1470"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="980"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="640, 360">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="1023"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="682"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="640, 360">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="712"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="475"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="480, 272">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="412"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="330"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="320, 180">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="230"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="230"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                    </Streams>
                  </AdvancedVC1VideoProfile>
                </VideoProfile>
              </WindowsMediaOutputFormat>
            </OutputFormat>
            <Sources>
              <Source
                AudioStreamIndex="-1">
                <Clips>
                  <Clip
                    EndTime="01:17:16.3200000"
                    StartTime="00:00:00" />
                </Clips>
                <CaptionFiles>
                  <CaptionFile
                    CaptionType="Captions"
                    Language="pl"
                    Offset="00:00:00"
                    Label="polski"
                    FileName="d:\vod_ftp\1024\1352729164_91d7212d7dfb9e0499a71827bd3a2ca5.srt" />
                </CaptionFiles>
              </Source>
            </Sources>
          </MediaFile>
          <MediaFile
            Source="d:\vod_ftp\1024\1352729111_673707e4865a974baa3d79a7adfcb95b.ac3"
            OutputFileName="a1107.{DefaultExtension}">
            <OutputFormat>
              <WindowsMediaOutputFormat>
                <AudioProfile>
                  <WmaAudioProfile
                    Codec="WmaProfessional"
                    Channels="2"
                    BitsPerSample="16"
                    SamplesPerSecond="44100">
                    <Bitrate>
                      <ConstantBitrate
                        Bitrate="128"
                        IsTwoPass="False"
                        BufferWindow="00:00:00" />
                    </Bitrate>
                  </WmaAudioProfile>
                </AudioProfile>
                <VideoProfile>
                  <AdvancedVC1VideoProfile
                    SmoothStreaming="True"
                    ClosedGop="True"
                    OutputMode="ElementaryStreamSequenceHeader"
                    OptimizeForAnimation="False"
                    DifferentialQuantization="Off"
                    InLoopFilter="True"
                    MotionSearchRange="MacroblockAdaptive"
                    BFrameCount="1"
                    AdaptiveDeadZone="Conservative"
                    AdaptiveGop="True"
                    DenoiseFilter="False"
                    KeyFrameDistance="00:00:02"
                    MotionChromaSearch="LumaOnly"
                    MotionMatchMethod="SAD"
                    NoiseEdgeRemovalFilter="False"
                    OverlapSmoothingFilter="True"
                    MotionVectorCost="Static"
                    Complexity="Normal"
                    AutoFit="True"
                    Force16Pixels="False"
                    FrameRate="0"
                    SeparateFilesPerStream="False"
                    NumberOfEncoderThreads="0">
                    <Streams
                      AutoSize="True"
                      FreezeSort="False">
                      <StreamInfo
                        Size="1920, 1080">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="6000"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="6000"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1920, 1080">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="5220"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="4176"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1280, 720">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="4360"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="2907"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1280, 720">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="3034"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="2023"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="852, 480">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="2112"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="1408"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="852, 480">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="1470"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="980"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="640, 360">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="1023"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="682"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="640, 360">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="712"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="475"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="480, 272">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="412"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="330"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="320, 180">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="230"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="230"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                    </Streams>
                  </AdvancedVC1VideoProfile>
                </VideoProfile>
              </WindowsMediaOutputFormat>
            </OutputFormat>
          </MediaFile>
          <MediaFile
            Source="d:\vod_ftp\1024\1352729140_ce099131a6d247b363add92510d6d3cc.ac3"
            OutputFileName="a1108.{DefaultExtension}">
            <OutputFormat>
              <WindowsMediaOutputFormat>
                <AudioProfile>
                  <WmaAudioProfile
                    Codec="WmaProfessional"
                    Channels="2"
                    BitsPerSample="16"
                    SamplesPerSecond="44100">
                    <Bitrate>
                      <ConstantBitrate
                        Bitrate="128"
                        IsTwoPass="False"
                        BufferWindow="00:00:00" />
                    </Bitrate>
                  </WmaAudioProfile>
                </AudioProfile>
                <VideoProfile>
                  <AdvancedVC1VideoProfile
                    SmoothStreaming="True"
                    ClosedGop="True"
                    OutputMode="ElementaryStreamSequenceHeader"
                    OptimizeForAnimation="False"
                    DifferentialQuantization="Off"
                    InLoopFilter="True"
                    MotionSearchRange="MacroblockAdaptive"
                    BFrameCount="1"
                    AdaptiveDeadZone="Conservative"
                    AdaptiveGop="True"
                    DenoiseFilter="False"
                    KeyFrameDistance="00:00:02"
                    MotionChromaSearch="LumaOnly"
                    MotionMatchMethod="SAD"
                    NoiseEdgeRemovalFilter="False"
                    OverlapSmoothingFilter="True"
                    MotionVectorCost="Static"
                    Complexity="Normal"
                    AutoFit="True"
                    Force16Pixels="False"
                    FrameRate="0"
                    SeparateFilesPerStream="False"
                    NumberOfEncoderThreads="0">
                    <Streams
                      AutoSize="True"
                      FreezeSort="False">
                      <StreamInfo
                        Size="1920, 1080">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="6000"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="6000"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1920, 1080">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="5220"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="4176"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1280, 720">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="4360"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="2907"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="1280, 720">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="3034"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="2023"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="852, 480">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="2112"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="1408"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="852, 480">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="1470"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="980"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="640, 360">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="1023"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="682"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="640, 360">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="712"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="475"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="480, 272">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="412"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="330"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                      <StreamInfo
                        Size="320, 180">
                        <Bitrate>
                          <VariableConstrainedBitrate
                            PeakBitrate="230"
                            PeakBufferWindow="00:00:04"
                            AverageBitrate="230"
                            IsTwoPass="True" />
                        </Bitrate>
                      </StreamInfo>
                    </Streams>
                  </AdvancedVC1VideoProfile>
                </VideoProfile>
              </WindowsMediaOutputFormat>
            </OutputFormat>
          </MediaFile>
        </MediaFiles>
      </Job>
    </JobFile>

    --

    twoby4