case mlt_image_yuv422: return "yuv422";
case mlt_image_yuv420p: return "yuv420p";
case mlt_image_opengl: return "opengl";
- case mlt_image_rgb24_full: return "rgb24_full";
- case mlt_image_rgb24a_full: return "rgb24a_full";
- case mlt_image_yuv422_709: return "yuv422_709";
}
return "invalid";
}
*buffer = NULL;
break;
case mlt_image_rgb24:
- case mlt_image_rgb24_full:
size *= 3;
size += *width * 3;
*buffer = mlt_pool_alloc( size );
memset( *buffer, 255, size );
break;
case mlt_image_rgb24a:
- case mlt_image_rgb24a_full:
case mlt_image_opengl:
size *= 4;
size += *width * 4;
return samples;
}
+
+void mlt_frame_write_ppm( mlt_frame frame )
+{
+ int width;
+ int height;
+ mlt_image_format format = mlt_image_rgb24;
+ uint8_t *image;
+
+ if ( mlt_frame_get_image( frame, &image, &format, &width, &height, 0 ) == 0 )
+ {
+ FILE *file;
+ char filename[16];
+
+ sprintf( filename, "frame-%05d.ppm", mlt_frame_get_position( frame ) );
+ file = fopen( filename, "wb" );
+ if ( !file )
+ return;
+ fprintf( file, "P6\n%d %d\n255\n", width, height);
+ fwrite( image, width * height * 3, 1, file );
+ fclose( file );
+ }
+}