Hi
I am using DirectshowLib v1.5 and DESCombinelib in my application (in VB.Net) to render video files in AVI format. I have used output's width and height as 640 and 480 respectively. But it seems that if input video's resolution is different than this, the output video's quality is poor. So what i want to do is to determine the input video file's width and height so that i can supply it to the object of Descombine and render the output with the same resolution. But i dont know how to retrieve video file's information (i.e. its Height, Width, Frame rate, bit rate etc.). So how can i programatically determine these parameters (if they are available) of a video file irrespective of its format. Any help in this matter is highly appreciated....
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much Peter for your prompt reply.
I got some idea through this code snippet about my requirement. However after looking this code i have got some further query
>> To call this subroutine one requires the object of ISampleGrabber. So what methods of this interface needs to be called to create it? What other objects will be required to create this "sampGrabber "? And how should i give my input video files path whose height and width is desired? Please reply...
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Peter
Thanks again for your reply.
I tried the code from the link of the zip file that you gave me. Also i have successfully implemented the code in my application. But there's one catch in the code of DXTest:
>> Whenever i try to retrieve the details of a WMV file the line of code in the subroutine SetupGraph
hr = m_FilterGraph.Connect(iPinOutSource, iPinInFilter);
gives the error: "No combination of intermediate filters could be found to make the connection."
value of hr is -2147220969
and further code execution stops.
It's happening with WMV file specifically (as i used the code so far. i am not sure about all the formats). With AVI it's working fine and DIVX file also not offering any issue. Is it due to the filters and grabbers whose name are HARDCODED in the functions?
Could you please look into it for me?
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is due to the fact that the video stream in wmv files isn't 0 (zero).
I solved the probelem, and it works, but the solution could probably be more elegant.
You can find it here: https://sourceforge.net/forum/message.php?msg_id=5531759
Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you Peter
That is working nice for me. I have rendered AVI files using WMV as input but they get rendered with large file size (say 3 MB WMV is creating 27 MB AVI).I am using "Microsoft Media Video 9 " as default compressor. Do you know any other good and widely available codec which i can use in my application and get files of relatively smaller size. Also i want to compress files using divx codec. But vista is offering issues. Also some codec packs are overriding my filters in the application for example if i install ffdshow on my system it overrides my default compressor (dsd.getdeviceofcatgory) and render the video with its (unknown to me) own codec . Do you know any good codec which could do the job for me . XVID codec is also welcome.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I haven't used DESCombine, so I don't know anything about this.
I use the lib for a subtitle editor where I get the frames (sample time) from the Sample Grabber.
But I get mpeg-1 files from the TV-station and I convert them to Xvid avi-files with VirtualDub
before I use them for creating subtitles. Nice quality and good compression.
90 minutes of video results in a file size of around 900 MB with my settings for Xvid.
Happy coding and have a nice weekend
Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Peter
I need a codec which could compress the large AVI and WMV files without
degrading their quality much. I wonder if you could suggest me the appropriate
person/forum who has worked with DESCombinelib and DirectShowlib.
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm afraid I don't know anything about DESCombinelib and compression but I
would use Xvid.
I used to use Microsoft MP4.2 with VirtualDub to make avi files but for some
reason
the sample grabber doesn't work with black frames. The sample time doesn't
change from one frame to the next
but this is not the case with Xvid.
I use a target bitrate of 900 kbps, and I set 'max consecutive BVOPs' to 1
because it makes it easy to seek through the file using
MediaPosition.put_CurrentPosition.
Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I am using DirectshowLib v1.5 and DESCombinelib in my application (in VB.Net) to render video files in AVI format. I have used output's width and height as 640 and 480 respectively. But it seems that if input video's resolution is different than this, the output video's quality is poor. So what i want to do is to determine the input video file's width and height so that i can supply it to the object of Descombine and render the output with the same resolution. But i dont know how to retrieve video file's information (i.e. its Height, Width, Frame rate, bit rate etc.). So how can i programatically determine these parameters (if they are available) of a video file irrespective of its format. Any help in this matter is highly appreciated....
Thank you
I do it this way in my app - using the Sample Grabber.
''' <summary> Read and store the properties </summary>
Private Sub SaveSizeInfo(ByVal sampGrabber As ISampleGrabber)
Dim hr As Integer
Peter
Thank you very much Peter for your prompt reply.
I got some idea through this code snippet about my requirement. However after looking this code i have got some further query
>> To call this subroutine one requires the object of ISampleGrabber. So what methods of this interface needs to be called to create it? What other objects will be required to create this "sampGrabber "? And how should i give my input video files path whose height and width is desired? Please reply...
Thank you
The code I posted is frem the DxText sample.
You can download the samples here:
https://sourceforge.net/projects/directshownet/files/DirectShowSamples/July-2007/DirectShowSamples-2007-July.zip/download
Peter
Hi Peter
Thanks again for your reply.
I tried the code from the link of the zip file that you gave me. Also i have successfully implemented the code in my application. But there's one catch in the code of DXTest:
>> Whenever i try to retrieve the details of a WMV file the line of code in the subroutine SetupGraph
hr = m_FilterGraph.Connect(iPinOutSource, iPinInFilter);
gives the error: "No combination of intermediate filters could be found to make the connection."
value of hr is -2147220969
and further code execution stops.
It's happening with WMV file specifically (as i used the code so far. i am not sure about all the formats). With AVI it's working fine and DIVX file also not offering any issue. Is it due to the filters and grabbers whose name are HARDCODED in the functions?
Could you please look into it for me?
Thank you
This is due to the fact that the video stream in wmv files isn't 0 (zero).
I solved the probelem, and it works, but the solution could probably be more elegant.
You can find it here:
https://sourceforge.net/forum/message.php?msg_id=5531759
Peter
Thank you Peter
That is working nice for me. I have rendered AVI files using WMV as input but they get rendered with large file size (say 3 MB WMV is creating 27 MB AVI).I am using "Microsoft Media Video 9 " as default compressor. Do you know any other good and widely available codec which i can use in my application and get files of relatively smaller size. Also i want to compress files using divx codec. But vista is offering issues. Also some codec packs are overriding my filters in the application for example if i install ffdshow on my system it overrides my default compressor (dsd.getdeviceofcatgory) and render the video with its (unknown to me) own codec . Do you know any good codec which could do the job for me . XVID codec is also welcome.
I haven't used DESCombine, so I don't know anything about this.
I use the lib for a subtitle editor where I get the frames (sample time) from the Sample Grabber.
But I get mpeg-1 files from the TV-station and I convert them to Xvid avi-files with VirtualDub
before I use them for creating subtitles. Nice quality and good compression.
90 minutes of video results in a file size of around 900 MB with my settings for Xvid.
Happy coding and have a nice weekend
Peter
Hi Peter
I need a codec which could compress the large AVI and WMV files without
degrading their quality much. I wonder if you could suggest me the appropriate
person/forum who has worked with DESCombinelib and DirectShowlib.
Thank you
I'm afraid I don't know anything about DESCombinelib and compression but I
would use Xvid.
I used to use Microsoft MP4.2 with VirtualDub to make avi files but for some
reason
the sample grabber doesn't work with black frames. The sample time doesn't
change from one frame to the next
but this is not the case with Xvid.
I use a target bitrate of 900 kbps, and I set 'max consecutive BVOPs' to 1
because it makes it easy to seek through the file using
MediaPosition.put_CurrentPosition.
Peter