[M4IF Technotes] ´ð¸´: [M4IF Technotes] solution yuv2avi ?
lmwang
lmwang brovic.com
Thu Apr 10 10:03:10 EDT 2003
You should learn from the avilib API first, input_yuv is buffer which
store YUV data and the three parameter is the buffer
length.(WIDTH*HEIGHT*3/2)
So you had to do like below, only pieces:(YUV,4CIF format,4:2:0)
FILE* fpYUV;
Char input_yuv[704*576*3/2]; // width*height*3/2
FpYUV = fopen("test.yuv","rb");
Do {
fread(input_yuv,1,704*576*3/2,fpYUV);
AVI_write_frame(pAviHandle,input_yuv,704*576*3/2);
}
fclose(fpYUV);
Best Regards,
Limin
-----????-----
???: technotes-admin lists.m4if.org
[mailto:technotes-admin lists.m4if.org] ?? anna
????: 2003?4?10? 2:19
???: technotes lists.m4if.org
??: [M4IF Technotes] solution yuv2avi ?
hi
i make this programme that is best than the other
#include <string.h>
#include "avilib.h"
>
> void main(int argc,char argv[])
> {
char input_yuv[100];
avi_t* pAviHandle;
>
> char VideoFmtYV12[4] =
> {
> 'Y','V','1','2'
> };
>
> pAviHandle = AVI_open_output_file("anna.avi");
>
> if(! pAviHandle)
> {
> printf("avi file open failed \n");
> return -1;
> }
> AVI_set_video(pAviHandle,352,288,25,VideoFmtYV12);
> strcpy(input_yuv,argv[1]);
>
do {
> AVI_write_frame(pAviHandle,input_yuv,8);
> } while(1)
>
> // close open file
> AVI_close(pAviHandle);
> }
>
now i have the name of my input file in "input_yuv"
the problem is in the function AVI_write_frame the
compilator said that it 'is a few argument for this
function. why i dont know ?
the second question i must open the input file with
fopen or not before the function AVI_write_frame ?
thinks
anna :)
Hello
>
> think you for the answer , i've installed avilib and
> i
> create file .c. In your source i dont understand
> where
> i place the name for my file yuv. for example i have
> "akiyo.yuv" input file et and i would to have in the
> output "anna.avi":) . i give you an example :
>
> #include "avilib.h"
>
> void main()
> {
> avi_t* pAviHandle;
>
> char VideoFmtYV12[4] =
> {
> 'Y','V','1','2'
> };
>
> pAviHandle = AVI_open_output_file("anna.avi");
>
> if(! pAviHandle)
> {
> printf("avi file open failed \n");
> return -1;
> }
> AVI_set_video(pAviHandle,352,288,25,VideoFmtYV12);
>
> do {
> AVI_write_frame(pAviHandle,akiyo.yuv);
> } while(1)
>
> // close open file
> AVI_close(pAviHandle);
> }
>
> I dont understand where i declared the path of my
> input and output file .
>
> If it is possible give me an complete source for
> this
> programme that work. and why i will compile it.
>
> think you for help :)
> anna
>
>
>
>
>
>
>
>
___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et
> en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
> _______________________________________________
> Technotes mailing list
> Technotes lists.m4if.org
> http://lists.m4if.org/mailman/listinfo/technotes
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
_______________________________________________
Technotes mailing list
Technotes lists.m4if.org
http://lists.m4if.org/mailman/listinfo/technotes
More information about the Mp4-tech
mailing list