Log in

View Full Version : Capturing with Aforge's FFmpeg


yousufkhan
23rd January 2014, 07:59
Using Aforge's ffmpeg
Everything working Just fine Besides Changing the FrameRate of Video,
If changing Framerate from 25 to other than 25 lets say 24 or 26 or
whatever it may be,
it throws AccessViolationException : Attempted to read or write
protected memory. This is often an indication that other memory is
corrupt.
Any Help to change the framerate it ffmpeg

raffriff42
23rd January 2014, 20:56
Could you post a short clip from your source code please?

You realize VideoFileWriter.FrameRate is read only?
http://www.aforgenet.com/framework/features/ffmpeg.html

yousufkhan
24th January 2014, 14:16
CurVidLoc = DirVideo + VidFileNo + ".mpeg";
VideoWriter = new VideoFileWriter();
int Byte = 1024;
Int32 KB = 256;
int framerate = 25;
VideoCodec Codec = VideoCodec.Default;
try
{
VideoWriter.Open(CurVidLoc, DesiredVidSize.Width, DesiredVidSize.Height, framerate, Codec, Byte * KB * 8);
FlagRecording = true;
}
catch (Exception)
{
VideoWriter.Dispose();
FlagRecording = false;
}


Here it is ok to change Bitrate But not the FrameRate, Is there any solution for this problem

raffriff42
24th January 2014, 15:27
My only guess is that 24 and 26 are not standard video rates.
It is possible VideoFileWriter.FrameRate is restricted to 25 and 30...

Especially so since you have chosen the mpeg format.
Choosing AVI etc may give your more choices.

yousufkhan
25th January 2014, 07:03
I need a output file in Mpeg format so i chosen this
actually if i am capturing in 640 by 480 its doing well i am getting the correct output but when i am changing it to any high resolution the captured video is of less duration then original capturing duration like if i am capturing for 30 seconds the file i am getting is of 27 second and the video runs little fast so where is the problem is it due to frame rate or where is the problem

raffriff42
25th January 2014, 08:28
i don't know it sounds like a capture device problem ~

Asmodian
27th January 2014, 18:24
That sounds like dropped frames to me, something in your chain isn't fast enough to capture at the higher resolutions.