|
After Mark Salsbery showed me the wonders of DirectShow Editing Services (Thanks Mark!) i was able to take a bunch of mpegs, put them on after the other and add background music and save the output to an avi file.
One problem. I am having problems Compressing it. The output file is huge since i am not compressing it.
The following example from the DirectShow documentation shows this:
long NumGroups;
pTimeline->GetGroupCount(&NumGroups);
// Loop through the groups and get the output pins.
for (i = 0; i < NumGroups; i++)
{
IPin *pPin;
if (pRender->GetGroupOutputPin(i, &pPin) == S_OK)
{
IBaseFilter *pCompressor;
// Create a compressor filter. (Not shown.)
// Set compression parameters. (Not shown.)
// Connect the pin.
pBuilder->RenderStream(NULL, NULL, pPin, pCompressor, pMux);
pCompressor->Release();
pPin->Release();
}
}
They do not show how to create a compression filter. So meanwhile my compressor is NULL, this is why my output is so huge.
Anyone have any idea how to create a compressor filter? Show me some code xample?
Thanks,
Michael
mjmimmm@hotmail.com
|
|
|
|
|
I had no idea that stuff actually worked!!
The only compressor that comes with directshow is for writing ASF (.wma,.wmv, etc) files.
I believe MPEG-4 is built-in to that but other flavors of MPEG are license-protected.
If you can live with an ASF file, a method is shown here (note you'll need the Windows Media
Format SDK to use the WM ASF Writer Filter, which is a mux.writer combo filter):
Writing a Windows Media File in DES[^]
If you need to output MPEG-1, and you have a MPEG-1 mux filter, you should be able to add it to the graph before the file writer. I'm pretty sure we discussed this before but I'm not sure
exactly how it works since I've never used any third-party filters. I would expect a mux filter
to have multiple input pins and one compressed format output pin.
Hope that helps a little!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I forgot to ask - What filter(s) are you using to write the AVI file??
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hey Mark, Nice to talk to you again....
I don't know how much experience you have with DirectShow Editing Services.
The truth is i don't really know what filters i am currently using.
I guess it automatically uses the default filters since i did not manually order it to use any specific filters.
I have an open source mpeg-2 decoder and an open source ac3 filter (for the sound).
I am guessing that underneath it uses the mpeg-2 splitter and both of these decoders for video and sound.
For the mux, i saw that i have an avi muxer through the graphedit tool - didn't this come with windows?
1. Is is the avi muxer i have a third party tool?
2. Is there a way for me to definitely know which filters DES is using?
3. Do asf decoders come by default on windows systems?
4. The reason you think we already had this conversation was because in the past i wanted to ouput to mpeg-2, but there were no built-in muxers and now i have this avi-muxer "qcap.dll" if i recall correctly.
5. There is something called smart-rendering in DirectShow Editing Services have you had any experience with it?(ISmartRenderEngine).
6. In my other post i explained that my output file is huge because i am not compressing. I do not know how to create a compressor filter, not with the basicengine and not with the smartengine.
Thanks,
Michael
mjmimmm@hotmail.com
p.s. really sorry for the long post.
|
|
|
|
|
I have no problem sending you or posting you my entire class. It's not that much, that way i can show you the place where i am supposed ot have a compressor filter and instead i place NULL because i do not know how ot create one...
Thnx
michael
mjmimmm@hotmail.com
|
|
|
|
|
The AVI muxer comes with DirectShow.
I have lots of experience with Windows Media Format (ASF) - that's what I use in my software.
The Windows Media Format compression works well for my needs, including realtime streaming.
I haven't used the AVI muxer but I know it is configurable for various compression settings.
I see it uses the Video Compression Manager but I'm not sure what types of compressors are
included with Windows - I'm looking into that.
The Windows Media stuff comes with windows starting in XP. The SDK comes with (or you can
download) a redistributable install package for previous Windows versions. Pretty much the same
deal as DirectX installation (but alot smaller).
I'll definitely take a look at your code - I'll send an email you can reply to.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hey Mark,
I sent you an email with my code... take a look whenever you can.
Thanks,
Michael
|
|
|
|
|
I have succesfully created compression filters also for my audio and also for my video.
The problem is that i do not know which codec to use now.
The Divx codec that i have does not allow me to control the frame rate or quality because it does not support this.
The codecs that do allow me to have control give me bad quality\file size ratio.
What codec can i use will allow me to control the frame rate and quality for Avi compression and have a reasonable size for the output file.
Reminder: i am compressing from mpeg-2 to avi.
Thanks,
Michael
mjmimmm@hotmail.com
|
|
|
|
|
More information on why i cannot use the Divx codec:
When using the IAMVideoCompression:GetInfo on the codec it returns 0 for capabilities. Meaning that it does support controlling the codec through this interface and I cannot control the frame rate, quality etc....
Is there a way around this? or another codec that does allow me to control this?
Thank you,
Michael
mjmimmm@hotmail.com
|
|
|
|
|
Hey Mark,
Haven't heard from you since i sent you the example code?
I still appreciate any help i can get.
Thnx,
Michael
mjmimmm@hotmail.com
|
|
|
|
|
Hi,
I have a number of still images containing concentric circles and I would like to be able to detect the centre point of the circles. Are there any algorithms out there that would allow me to do this?
Cheers,
Tony
|
|
|
|
|
For future readers who stumble upon this post and are curious about the solution, a few responses to this question were posted here[^].
|
|
|
|
|
hey...
currently working on a graphics application using C# and openGL....intially the whole from was used for drawing...but now I want to refine my application by adding controls and drawing in a picture box but having problems properly defining a drawing area in a picture-box....kindly help me in this regard
thanks
|
|
|
|
|
I am writing a program that does, among other things, authoring to mpeg-2.
I am currently using an sdk that throws an exception if i give it a corrupt mpeg-2 file.
Are there any directshow functions\open source code\applications that give me the option to verify an mpeg-2 to see if it is corrupt or not?
Thank you,
Michael
mjmimmm@hotmail.com
mjmimmm
|
|
|
|
|
There's nothing that will test it for you, no. You've pretty much found the only way to find out. Pass the MPEG inside a Try/Catch block. If it fails, then you know!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hello..
i'm beginner in c# and have problems with implementing some things in my project...
i need to draw circle (ellipse) as car and different roads (from couple segments) on some map
and to be able to choose a road and navigate such car on this road and also noise if the car gets out from the road... something like this..
I tried to read some good articles here.. but i missed the main idea of such design and also do i need directx?
Thanks for any help...
Shimon
|
|
|
|
|
i want to control serialport with wpf form.i mean i want to send datas and get some datas from outside.i cant add serialport component.but i create serialport component with code.System.io.ports.serialport myserial;
but when i write its datareceived event so i cant exit from datareceived event.i ll save some datas in received event and i ll call another function.how can i do it?
|
|
|
|
|
Dear All
How to use OpenGl with C#, please explain in detail
thanks
david
david
|
|
|
|
|
Look here - very good explanation on integrating OpenGL and C#.
-------------------------
Listen up! Teamwork means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi,
I want to rotate a mesh around a FIXED axis that does not rotate like the axis of the mesh itself.
thats my code so far:
<br />
device.Transform.World = Matrix.RotationYawPitchRoll(yaw, pitch, roll) * Matrix.Translation(x, y, z);
But whith that code the mesh rotates around the axis of itself.
|
|
|
|
|
Try swapping the rotation Matrix and the translation matrix like this.
device.Transform.World = Matrix.Translation(x, y, z) * Matrix.RotationYawPitchRoll(yaw, pitch, roll);
|
|
|
|
|
Doesn't have any effect
Has nobody else any idea?
|
|
|
|
|
This might be a little vague, but better than nothing I hope.
One way to rotate about an arbitrary axis (there are others):
- find the unique point on the axis such that a line from that point to the origin is perpendicular to the axis - let's suppose the point is 1,2,3
-translate that point to the origin - Translation(-1,-2,-3)
-do the rotation
-undo the translation - Translation(1,2,3)
Hope that helps a bit
|
|
|
|
|
Hello, I have to make a software to calculate and show the effects of Nuclear explotions on the ground. For that , I need to use a map design tool or a map-database. Does anybody know a practical way of using map in a software. Where should I start?? Do you know any tool or ready map for this ?? thank you.
|
|
|
|
|
erginduzu wrote: I have to make a software to calculate and show the effects of Nuclear explotions on the ground.
You join, say you're from a muslim country, and your first post asks how to do calculations about the effects of nuclear weapons? I hope no one here is silly enough to provide you with any help.
|
|
|
|