473,512 Members | 15,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to read and manipulate an avi file in C?

2 New Member
I've gone through the threads. On other person had asked the same question but the answer to that was to use DirectShow. My project requires manipulation of an avi file using only C. I finished simulation of my project in Matlab quite easily but having trouble with C. Any guidance in this regard will be very helpful.
Jan 19 '11 #1
3 6618
weaknessforcats
9,208 Recognized Expert Moderator Expert
An AVI file is just a data file. You read it just like any other file in C. Probably, tis is a binary file and not a text file.

However, in order to make sense of the data in the file you need to know the file layout so you know what it is that you are reading.

I would research AVI file layouts and get familiar with what the data is for and how it is written in the file.
Jan 19 '11 #2
Savage
1,764 Recognized Expert Top Contributor
Manipulating AVI files on your own is completly unrecomendable considering how many codecs are there(you would need to write seperate code to handle most common types of codecs atleast..), so its much better if you can find some library that already does it for you. DirectShow is quite good, but its written as a set of C++ classes. You could write some wrapper code to alow you to use it with C code only, or you could try to find some crossplatform C library.. for example libavcodec seems good to me(here is how to use it..).

Good luck :)
Savage
Jan 20 '11 #3
Chaithan
2 New Member
Thank you for your replies. I tried lots of things, I started with fopen and fread but the avi format was just too complex to understand and manipulate via the bit streams.
I then included vfw.h and the avi library and tried using functions like AVIFileInit, AVIFileOpen etc but i'm not able to run them. I wrote a simple function jus to open and read a video file. It doesnt show any errors after compilation but fails to execute. It says " project1.exe has encountered a problem and needs to close. We are sorry for the inconvenience.".

I just gave a glance at the link provided by Savage and it looks helpful. So i'm gonna go through it and try it now. Hope i'm able to sort it out soon for my own sake. I shall update what happens. Thanks people..appreciated
Jan 27 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5884
by: rishka | last post by:
Rishka Mar 17, 5:40 am show options Newsgroups: comp.databases.oracle.tools From: "Rishka" <ris...@webmail.co.za> - Find messages by this author Date: 17 Mar 2005 05:40:45 -0800 Local:...
1
1913
by: Jason | last post by:
Hi, Does anyone know how I can connect to an MSDE db using VB with a read-only file? The file will be on a CD, and is actually just archived data off a SQL server. I would like to package my app...
3
12715
by: Shaun Merrill | last post by:
Hey, here is my code. I am trying to read a file into a byte array. Please show me how this can work. Obviously I need to read into a dynamic array because it could read any file. So why does...
66
5279
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
3
4196
by: Yaniv | last post by:
Hi I'm new in VB.NET. I wrote an application which opens a text file and read it all lines untill the EOF this file is open for read only and for sharing asllowed. every 5 seconds another...
1
2668
by: abtet | last post by:
Hello people, I am new to php and have question on how to read text file and convert it to XML with php. . Can it be done if the text file contains text, image and also tables? please help...
2
1466
by: nalinibh | last post by:
Hello everybody I am quite new to C.I want to read a file and store the data in an array.And i also want to calculate the data_length of the file. Please can anyone help i have tried somethg...
4
3459
by: Matrixinline | last post by:
Hi All Here is my problem I am using a Unicode project and I tried to read the File like sPath = LPCTSTR; FILE* oFp = _tfopen(sPath,L"r"); while(!feof(oFp))
3
2391
by: Laura | last post by:
Hi: ¿How can I read a file on the client side without loading it to the server?
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.