Kiran Kumar
unread,Oct 8, 2015, 7:03:12 PM10/8/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to avblocks-support
I am trying to resize a mp4 with resolution 1912 X 1072 to 640 X 480.
But I am getting errors while executing the transcoder.
Below is the code I am using
using (MediaInfo mediaInfo = new MediaInfo())
{
mediaInfo.InputFile = inputFileName;//Input mp4 video
if (!mediaInfo.Load())
{
MessageBox.Show(string.Format("{0} Error, Code: {1} ({2})", mediaInfo.Error.Facility, mediaInfo.Error.Code, mediaInfo.Error.Message ?? ""));
}
using (Transcoder t = new Transcoder())
{
t.AllowDemoMode = true;
MediaSocket insocket = MediaSocket.FromMediaInfo(mediaInfo);
t.Inputs.Add(insocket);
MediaSocket outsocket = MediaSocket.FromPreset("iphone.mp4.h264.480p");
if (outsocket == null)
{
MessageBox.Show("Error");
}
outsocket.File = "C:\\AvBlockOutput\\Test.mp4";
t.Outputs.Add(outsocket);
if (!t.Open())
MessageBox.Show(string.Format("{0} Error, Code: {1} ({2})", t.Error.Facility, t.Error.Code, t.Error.Message ?? ""));
if (!t.Run())
MessageBox.Show(string.Format("{0} Error, Code: {1} ({2})", t.Error.Facility, t.Error.Code, t.Error.Message ?? ""));
t.Close();
}
}
While t.Open is executing Transcoder Error, Code: 4 (No Codec) error is thrown and while t.Run is executing Codec Error, Code: 14 (Invalid Operation) error is thrown
Project settings used, TargetFramework – .NET Framwework 4.6, Platform Target – x86
Am I missing some initialization or doing something wrong?