Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.
9 posts • Page 1 of 1
I want to thanks you first for you good job.
I use the library video.ffmepg to save image, from a Sony camera in live stream, in to an avi file.
I write some texte on the image before encoded it and save it in this avi file.
The frame rate is egal at 25fps and the size is 720x576.
My trouble is that the resulting video miss a lot of frame and the quality is really bad.
how can i make a better quality and 25fps it is too fast ?
Sorry for my english.
Thanks for your answer.
Frame rate can be set using VideoFileWriter.Open() method.
With quality it is a bit more difficult. For quality control there is bit rate, which is hardcoded value in current version 2.2.2. However in the next version it will be possible to set bit rate in the Open() method. If you want it now, then you may get latest sources out of SVN and build them manually - there bit rate is already configurable.
Hello, thank you andrew for your answer.
Ok i see for the bite rate, i will build e new vdeo.ffmpeg with visual studio express c++.
I know for the frame rate, and it's what i use.
but the time of the avi created don't correspond of the time betwen the open file and close file (some frame is missing at 25fps)
That's why this make me think that the function "WriteVideoFrame( image )" with an avi file encode limit the frame rate.
Because i use it with a timer.interval = 40 (25fps), i draw text on a bmp and i use WriteVideoFrame( image ) for write it in the avi.
Perhaps it because image encoded need a lot of ressource and speed and my computer is not speed enough ?
I meet the same problem.
I draw a line on the video picturebox and record the video.when playing the avi I can't see the process of drawing line. It shows the whole line directly.
I reduced the famerate in Open method . The problem still exists.
Here is the code which works fine for me:
I guess I haven't descripted clearly .So I show the details and look forward to your solution .
develpment: VS2010+.NET Framework 3.5 +C#
Step 1: I used AForge.Video.DirectShow to connect a camera and show the video in picturebox(change the Picturebox.Image) . the code just like AForge sample .
Step 2: I made a draw tool by GDI+ to draw simple shapes on the picturebox . I think you can understand what I say .
Step 3: I used AForge.Video.FFMPEG to write avi file . the frame is the bitmap cloned from picturebox.Image .
OK, that's the details.now the question is what I said at above.
by the way . If I remove the Step1 ,yeah ,the effect is good ,the same as your code . But why after adding step 1 the problem occured ? perhaps this question is not about the AForge Framework ,but I hope you can help me find the reason.
Thank you .
i try to modify the Aforge.video.ffmpeg, to use other encoder like FFH264 ( more perfomrer) or MJPEG to see if that reduce the CPU time to keep up the 25 frames per second.
But When i use the new dll my program bug, and say that it don't now the codec. Does it because the external FFMPEG don't contain it or i have to add on my system this encoder ?
Thank you for you answer.
Not sure what goes wrong with your system. If you feel comfortable changing sources, then you should be prepared to debug and resolve issues.
Thank you andrew for your answer.
I upload in attachment my new video.FFMPEG DLL and the source. In this one there is the new function with the bit rate in input for C#. And some change in the codec avaible. But for me the new codec i have change, don't work.
I have an exception : "codec not find".
can someone test it and tell me if it work for him ?
Thank by advance.
9 posts • Page 1 of 1