Click here to Skip to main content
15,904,339 members

Comments by Member 10189208 (Top 1 by date)

Member 10189208 30-Nov-15 17:10pm View    
Thanks RedDK,

I have proceeded little bit. But stuck here..can you help here plz. I am stuck in ConvertMedia method ..it is throwing Unknown input format: '.mp4' (exit code: 1).


private void buttonOne_Click(Office.CommandBarButton ctrl,
ref bool cancel)
{

int size = -1;
using (OpenFileDialog dlg = new OpenFileDialog())
{
try
{
dlg.Multiselect = false;
dlg.CheckFileExists = true;
string formats = "All Videos Files |*.dat; *.wmv; *.3g2; *.3gp; *.3gp2; *.3gpp; *.amv; *.asf; *.avi; *.bin; *.cue; *.divx; *.dv; *.flv; *.gxf; *.iso; *.m1v; *.m2v; *.m2t; *.m2ts; *.m4v; " +
" *.mkv; *.mov; *.mp2; *.mp2v; *.mp4; *.mp4v; *.mpa; *.mpe; *.mpeg; *.mpeg1; *.mpeg2; *.mpeg4; *.mpg; *.mpv2; *.mts; *.nsv; *.nuv; *.ogg; *.ogm; *.ogv; *.ogx; *.ps; *.rec; *.rm; *.rmvb; *.tod; *.ts; *.tts; *.vob; *.vro; *.webm";

dlg.Filter = formats;
dlg.ShowDialog();
if (dlg.ShowDialog() == DialogResult.OK) //<--- Fails here
{
var ffmpeg = new FFMpegConverter();
ffmpeg.ConvertMedia(File.ReadAllText(dlg.SafeFileName), Path.GetExtension(dlg.FileName), GenerateStreamFromString("asd.gif"), ".gif", new ConvertSettings());

string text = File.ReadAllText(dlg.FileName);
size = text.Length;
}
}
catch (IOException)
{

throw;
}

}


}