[Ffmpeg-devel] Decode ISO MPEG4 with CODEC_ID_MPEG4: picture result align problem

patrice patrice.roulet
Fri Jan 27 10:11:18 CET 2006


Dear All

	I am a newbies in the c++ utilisation of ffmpeg.

	I try to decompress ISO MPEG4 raw data with ffmpeg thanks to ffmpeg 
0.4.9-pre1
	
	After Decompression, I save the planar YUV4:2:0 AvFrame in a PPM file 
thanks to this method and the the picture line have not a good 	align

	void pgm_save(unsigned char *buf,int wrap, int xsize,int ysize,char 
*filename) 
	{
   	  FILE *f;
    	  int i;

    	  f=fopen(filename,"w");
    	  fprintf(f,"P5\n%d %d\n%d\n",xsize,ysize,255);
    	  for(i=0;i<ysize;i++)
   	  {
          fwrite(buf,1,xsize,f);
          buf+=wrap;
    	  }
    	  fclose(f);
	}

	Where buf=picture->data[0]
	      wrap=picture->linesize[0]
            xsize=codecContex->width
 		ysize=codecContex->height

	

	Do you have an idea about this problem?

	Many thanks for your help.

	Patrice





More information about the ffmpeg-devel mailing list