Expression encoder: change file name after encoding

532 views Asked by At

I'm using Microsoft Expression Encoder and this is my code

using (LiveJob job = new LiveJob())
        {
            // Creates file source for encoding
            LiveFileSource fileSource = job.AddFileSource(DataDirectory);

            // Sets playback to loop on reaching the end of the file
            fileSource.PlaybackMode = FileSourcePlaybackMode.Jump;


            // Sets this source as the current active one
            job.ActivateSource(fileSource);

            job.ApplyPreset(LivePresets.VC1IISSmoothStreamingLowBandwidthStandard);


            PushBroadcastPublishFormat format = new PushBroadcastPublishFormat();
            format.PublishingPoint = new Uri(PublishPoint);
            job.PublishFormats.Add(format);

            // Starts encoding
            job.StartEncoding();
   }

this code encode a list of files in a directory when he finish one he jump to the next what I want to do is change the file name when it's encoded before passing to th other one

1

There are 1 answers

0
7addan On

I have added this Methode I don't know if it work or no

public void liveJob_Status(object sender, EncodeStatusEventArgs e)
    {
        if (e.Status == EncodeStatus.Jumped)
        { LiveFileSource file = (LiveFileSource)e.LiveSource; 
          string name = file.Name;
          string modified_name = "Encode" + name;

          File.Move(DataDirectory + @"\" + name, DataDirectory + @"\" + name.Replace(name, modified_name)); 
        }
    }