Monday, August 15, 2011
Replace img_convert by swscale for ffmpeg
// img_convert(&pFrameRGB, PIX_FMT_RGB24,
// (AVPicture *)pFrame, pCodecCtx->pix_fmt,
// pCodecCtx->width, pCodecCtx->height);
static struct SwsContext *img_convert_ctx;
int w = pCodecCtx->width;
int h = pCodecCtx->height;
img_convert_ctx = sws_getContext(w, h,
pCodecCtx->pix_fmt,
w, h, PIX_FMT_RGB24, SWS_BICUBIC,
NULL, NULL, NULL);
sws_scale(
img_convert_ctx,pFrame->data, pFrame->linesize,0,
pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
Sunday, August 14, 2011
how to deal with the error: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Solution:
- The solution targets the x86 platform;
- I managed to launch without errors the application on **Windows Server 2008 (x64) and on Windows 7 (x64);
Friday, August 12, 2011
How to close the cmd.exe progress in C#
currentCommand = programPath + "\\ShotSegmentation.exe " + videoPath + "\\" + currentVideoFile + " " + outputPath + "\\" + currentOutputFile;
//MessageBox.Show(currentCommand);
proc = new Process();
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.FileName = "cmd.exe";
proc.StartInfo.Arguments = "/C " + currentCommand;
proc.Start();
string output = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
Subscribe to:
Comments (Atom)