|
Hello. I have been, somehow , able to capture video from my USB camera using media foundation api. But the problem is that for a duration of about 10 seconds, the video size is 70-72 mb. I don't have to tell you that, that is a lot of video size for this duration.
I have tried lowering Frame Rate and AVG BitRate of the video stream but in vain. What should I change to get this size to minimum? Thanks for any pointers.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
It is little hard to tell you exactly what your best course of action is, because you have left out some key information, such as image resolution, video format and frame rate.
However, your numbers are typical if you are storing uncompressed video with the following settings:
Resolution: 352x288
Video format: AVI, Raw video (RGB or YUV) at 24 bits per pixel
Frame rate: 25 FPS.
[Resolution and Frame rate based on PAL being the TV standard used in Pakistan]
If the above values seem correct to you, you need to compress the video in order to make the video size smaller. There are obviously many video formats, such as MJPEG, MPEG2, MPEG4, H.264 and so on. You would need to determine the best fit for your project.
Your USB camera might be able to deliver compressed video in different formats, but if it does not, you will have to do the compression on your computer as the raw video frames are being received from the camera.
If I am dead wrong and you are actually storing high resolution images, then we need to come at this from another angle.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Camera is giving me the video with following attributes.
Resolution = 640 x 480;
Frame Rate = 30 fps;
Color Scheme = RGB32
Encoding Format = WMV;
Since I am storing video data as .wmv , does't it mean that video being stored is compressed (or encoded) ?
This world is going to explode due to international politics, SOON.
|
|
|
|
|
AmbiguousName wrote: Since I am storing video data as .wmv , does't it mean that video being stored is compressed (or encoded) ? Yes, your video is compressed, but not by much. If you do the calculation to see how large a 10 second uncompressed video file would be using your values, you get something like this:
640 * 480 * (32/8) * 30 * 10 = 368,640,000 = 352 MB
This shows that the raw video is about 5 times larger than your compressed video. That is not an impressive compression ratio at all, so you should consider switching to H.264 as suggested by SuperCoder2014.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
|
Hey,
I need a C code which builds the printer job queue. However, the printer job queue is built as a two level priority queue.
modified 22-May-14 3:55am.
|
|
|
|
|
Looks like a single linked list.
Here is a program for a single link list - Singly linked list[^]
You will need to modify the program slightly to cater to your requirement.
The given program only uses an integer variable.
Instead, you will need to make 2 checks on the userType and the pages .
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
|
Its probably because of an incorrect condition check.
Please post the code with the page check that you put in.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
|
Logic looks OK.
I guess you need to single step through the code using the debugger and find out the issue.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
I tried but didn't find the problem. Do you have an idea?
|
|
|
|
|
Finded it, thanks for your help!
|
|
|
|
|
I want to use C++ to call javascript and get the return value , but i don't how to use C++ to call js,and i don't how to give those parameters to the javascript function.
What should i do?
thanks for everybody's help!!
modified 22-May-14 8:54am.
|
|
|
|
|
jingjing yuan wrote: how to use c + + for the Jason data You need to explain where this data comes from and exactly what you expect your C++ program to do with it.
|
|
|
|
|
writing a program for send a command to INMARSAT via USB-RS232 and wait for the response coming within 20 seconds if the response not come means again send the commands to USB-RS232?
Uma Maheswari N
|
|
|
|
|
You should check out the documentation (datasheets, application notes, etc...) of your microcontroller and study it (probably you are going to find available code
Also you may post on more specialized forums inr order to get better help.
Veni, vidi, vici.
|
|
|
|
|
I hope you are not really asking what I think you are asking on a public forum and that this is something on the public access portal.
If not I warn you the INMARSAT protocol is proprietary and has a non disclosure agreement signed by yourself or someone who you work for. Refer the questions back thru the proper channels please and all the details are quite clear in the technical specification if you can not understand the document go back thru proper channels.
In vino veritas
|
|
|
|
|
Hmmmm,
As someone who has worked with inmarsat hardware I would guess that this guy is simply asking about MODBUS response timeouts which isn't really proprietary information.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi everyone.
I wrote a function that should copy in a strings' array all the name of several files contained in a folder.
void get_filenames(char dir[]){
int i=0;
DIR *sd;
sd = opendir(dir);
struct dirent *dird;
printf("\nLa cartella %s contiene %d files.", dir, n_files);
seekdir(sd, 2);
for(i=0;i<n_files;i++){
dird=readdir(sd);
filenames[i]=dird->d_name;
printf("\n%s", filenames[i]);
}
closedir(sd);
}
When I call this function it seems to be alright, and the printf contained in the for cicle prints the names of files correctly... But if I try to print these names somewhere out of this function, I see that each string of filenames[] contains the last string printed in the get_filenames function, that is the last file in the folder.
I allocated filenames[] in another void function, this way:
...
filenames = malloc(n_files * sizeof(char));
for(i=0;i<n_files;i++){
filenames[i] = malloc(20 * sizeof(char));
}
...
|
|
|
|
|
The line
filenames = malloc(n_files * sizeof(char));
should be
filenames = malloc(n_files * sizeof(char *));
because you use it to allocate pointers.
You don't show the declaration of filenames in the sample, but I assume it's char **.
By the way, what happens if a file in the directory has a name longer than 19 characters?
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
I think you'll find that the line:
filenames[i]=dird->d_name; should actually be something like:
filenames[i]=strdup(dird->d_name);
You see, dird->d_name is a location in memory that the current file's name is copied to - _but_ this location doesn't change, only the contents of the text does. What your code does is set each of the filename[] elements to hold this location. In the next iteration of the loop, the text contained there changes, but the location doesn't. So you've got all elements of filename[] holding the same address of a string.
If, on the other-hand, you make a duplicate of the string in dird->d_name and then store _that_ location into filenames[], each element of filenames[] will point to a different location in memory - locations that contain the string you're after.
Note - you should also change your last code-block.
filenames = malloc(n_files * sizeof(char*) );
So,
1) filenames should be a char** (I expect you've got it setup to be a char* currently)
2) each element (a char*) should contain the address of the duplicated string
3) No need for the filenames[i] = malloc(20 * sizeof(char) ); code.
|
|
|
|
|
Thank you for the answer.
Of course I declared filenames as char**... But I didn't know really good how the d_name variable works, then I made some mistakes... Now it's all clearer!
|
|
|
|
|
You're welcome.
I'd hoped you had, though the way you used it gave me the impression it was only a char*
Glad to be of help.
|
|
|
|
|
I cannot find its implementation anywhere. MSDN is not much of a help.
|
|
|
|