we can use videocodec.prx to decode xvid(divx)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
cooleyes
Posts: 123
Joined: Thu May 18, 2006 3:30 pm

we can use videocodec.prx to decode xvid(divx)

Post by cooleyes »

hi, I think I had found out how use videocodec.prx to decode xvid(divx) frame .

heres is my demo src code:
http://www.fx-world.org/cooleyes/downlo ... ectest.rar
and two demo data:

1. Test.dat( just one frame(320*240) encoded by xvid)
http://www.fx-world.org/cooleyes/downloads/Test.dat
2. Test1.dat( just one frame(480*272) encoded by xvid)
http://www.fx-world.org/cooleyes/downloads/Test1.dat
cooleyes
Posts: 123
Joined: Thu May 18, 2006 3:30 pm

Post by cooleyes »

Code: Select all

#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <psppower.h>
#include <stdio.h>
#include <stdlib.h>
#include <pspkernel.h>
#include <pspctrl.h>
#include <psppower.h>
#include <pspdebug.h>
#include <psprtc.h>
#include <pspsdk.h>
#include <pspaudiocodec.h>
#include <pspaudio.h>
#include <string.h>
#include <malloc.h>
#include <pspmpeg.h>
#include "pspvideocodec.h"

int SetupCallbacks&#40;&#41;;

PSP_MODULE_INFO&#40;"videocodec test", 0x1000, 1, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;

__attribute__ &#40;&#40;constructor&#41;&#41;
void loaderInit&#40;&#41;&#123;
	pspKernelSetKernelPC&#40;&#41;;
	pspSdkInstallNoDeviceCheckPatch&#40;&#41;;
	pspSdkInstallNoPlainModuleCheckPatch&#40;&#41;;
	pspSdkInstallKernelLoadModulePatch&#40;&#41;;
&#125;

SceCtrlData input;

unsigned long Video_Codec_BufferMP4V&#91;96&#93; __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
unsigned long Video_Codec_BufferAVC1&#91;96&#93; __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
unsigned long Video_YCrCbCopy_SrcBufferMP4V&#91;24&#93;  __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
unsigned long Video_YCrCbCopy_DestBufferMP4V&#91;24&#93;  __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
unsigned char YBuffer&#91;512*512&#93; __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
unsigned char CrBuffer&#91;512*128&#93; __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
unsigned char CbBuffer&#91;512*128&#93; __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;


int main&#40;void&#41;
&#123;
	SetupCallbacks&#40;&#41;;
	
	pspDebugScreenInit&#40;&#41;;
	pspDebugScreenSetXY&#40;0, 2&#41;;
	//scePowerSetClockFrequency&#40;120,120,60&#41;;
	//scePowerSetCpuClockFrequency&#40;120&#41;;
	//scePowerSetBusClockFrequency&#40;60&#41;;
	u32 cpu = scePowerGetCpuClockFrequency&#40;&#41;;
	u32 bus = scePowerGetBusClockFrequency&#40;&#41;;
	
	pspDebugScreenPrintf&#40;"cpu=%d, bus=%d\n", cpu, bus&#41;;
	
	pspDebugScreenPrintf&#40;"Press any key to exit.\n"&#41;;
	
	int result;
	
	result = pspSdkLoadStartModule&#40;"flash0&#58;/kd/me_for_vsh.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	if &#40;result < 0 &#41; goto wait;
	
	result = pspSdkLoadStartModule&#40;"flash0&#58;/kd/videocodec.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	if &#40;result < 0 &#41; goto wait;
	
	result = pspSdkLoadStartModule&#40;"flash0&#58;/kd/audiocodec.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	if &#40;result < 0 &#41; goto wait;
	
	result = pspSdkLoadStartModule&#40;"flash0&#58;/kd/mpegbase.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	if &#40;result < 0 &#41; goto wait;
	
	result = pspSdkLoadStartModule&#40;"flash0&#58;/kd/mpeg_vsh.prx", PSP_MEMORY_PARTITION_USER&#41;;
	if &#40;result < 0 &#41; goto wait;
	
	pspSdkFixupImports&#40;result&#41;;
	
	sceMpegInit&#40;&#41;;
	
	FILE* fp = fopen&#40;"ms0&#58;/Test1.dat", "rb"&#41;;
	fseek&#40;fp, 0, PSP_SEEK_END&#41;;
	long fsize = ftell&#40;fp&#41;;
	long buffer_size = fsize;
	int mod_64 = buffer_size & 0x3f;
	if &#40;mod_64 != 0&#41; buffer_size += 64 - mod_64;
	unsigned char* file_buffer = memalign&#40;64, buffer_size&#41;;
	fseek&#40;fp, 0, PSP_SEEK_SET&#41;;
	fread&#40;file_buffer, fsize, 1, fp&#41;;
	fclose&#40;fp&#41;;

	
	memset&#40;Video_Codec_BufferMP4V, 0, sizeof&#40;Video_Codec_BufferMP4V&#41;&#41;;
	
	int res ;
	int i;
	
	//---------------------------------------------------------------------------------//
	Video_Codec_BufferMP4V&#91;4&#93; = &#40;unsigned long&#41;&#40;&#40;&#40;void*&#41;Video_Codec_BufferMP4V&#41; + 128 &#41;;
	Video_Codec_BufferMP4V&#91;11&#93; = 512;
	Video_Codec_BufferMP4V&#91;12&#93; = 512;
	Video_Codec_BufferMP4V&#91;13&#93; = 512*512;
	
	fp = fopen&#40;"ms0&#58;/sceVideocodecOpen&#40;mp4v&#41;.dat", "wb"&#41;;
	for&#40;i=0;i<96;i++&#41; &#123;
		fwrite&#40; &Video_Codec_BufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	fclose&#40;fp&#41;;
	if &#40; &#40;res = sceVideocodecOpen&#40;Video_Codec_BufferMP4V, 0x1&#41;&#41; < 0 &#41; &#123;
		pspDebugScreenPrintf&#40;"sceVideocodecOpen=0x%08X\n", res&#41;;
		goto wait;
	&#125;
	pspDebugScreenPrintf&#40;"sceVideocodecOpen=0x%08X\n", res&#41;;
	
	//---------------------------------------------------------------------------------//
	Video_Codec_BufferMP4V&#91;7&#93; = 16384;
	
	fp = fopen&#40;"ms0&#58;/sceVideocodecGetEDRAM&#40;mp4v&#41;.dat", "wb"&#41;;
	for&#40;i=0;i<96;i++&#41; &#123;
		fwrite&#40; &Video_Codec_BufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	fclose&#40;fp&#41;;
	if &#40; &#40;res = sceVideocodecGetEDRAM&#40;Video_Codec_BufferMP4V, 0x1&#41;&#41; < 0 &#41; &#123;
		pspDebugScreenPrintf&#40;"sceVideocodecGetEDRAM=0x%08X\n", res&#41;;
		goto wait;
	&#125;
	pspDebugScreenPrintf&#40;"sceVideocodecGetEDRAM=0x%08X\n", res&#41;;
	
	//---------------------------------------------------------------------------------//
	fp = fopen&#40;"ms0&#58;/sceVideocodecInit&#40;mp4v&#41;.dat", "wb"&#41;;
	for&#40;i=0;i<96;i++&#41; &#123;
		fwrite&#40; &Video_Codec_BufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	fclose&#40;fp&#41;;
	if &#40; &#40;res = sceVideocodecInit&#40;Video_Codec_BufferMP4V, 0x1&#41;&#41; < 0 &#41; &#123;
		pspDebugScreenPrintf&#40;"sceVideocodecInit=0x%08X\n", res&#41;;
		goto wait;
	&#125;
	pspDebugScreenPrintf&#40;"sceVideocodecInit=0x%08X\n", res&#41;;
	
	//---------------------------------------------------------------------------------//
	Video_Codec_BufferMP4V&#91;34&#93; = 7;
	Video_Codec_BufferMP4V&#91;36&#93; = 0;
	
	fp = fopen&#40;"ms0&#58;/sceVideocodecStop&#40;mp4v&#41;.dat", "wb"&#41;;
	for&#40;i=0;i<96;i++&#41; &#123;
		fwrite&#40; &Video_Codec_BufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	fclose&#40;fp&#41;;
	if &#40; &#40;res = sceVideocodecStop&#40;Video_Codec_BufferMP4V, 0x1&#41;&#41; < 0 &#41; &#123;
		pspDebugScreenPrintf&#40;"sceVideocodecStop=0x%08X\n", res&#41;;
		goto wait;
	&#125;
	pspDebugScreenPrintf&#40;"sceVideocodecStop=0x%08X\n", res&#41;;
	
	//---------------------------------------------------------------------------------//
	Video_Codec_BufferMP4V&#91;9&#93; = file_buffer;
	Video_Codec_BufferMP4V&#91;10&#93; = fsize;
	Video_Codec_BufferMP4V&#91;14&#93; = 7;
	
	fp = fopen&#40;"ms0&#58;/sceVideocodecDecode&#40;mp4v&#41;.dat", "wb"&#41;;
	for&#40;i=0;i<96;i++&#41; &#123;
		fwrite&#40; &Video_Codec_BufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	fclose&#40;fp&#41;;
	if &#40; &#40;res = sceVideocodecDecode&#40;Video_Codec_BufferMP4V, 0x1&#41;&#41; < 0 &#41; &#123;
		pspDebugScreenPrintf&#40;"sceVideocodecDecode=0x%08X\n", res&#41;;
		goto wait;
	&#125;
	pspDebugScreenPrintf&#40;"sceVideocodecDecode=0x%08X\n", res&#41;;
	
	/****************************************************************************
	Video_Codec_BufferMP4V&#91;44&#93; &#58; frame width
	Video_Codec_BufferMP4V&#91;45&#93; &#58; frame height
	Video_Codec_BufferMP4V&#91;53&#93; &#58; maybe Ybuffer start address in ME ram
	Video_Codec_BufferMP4V&#91;54&#93; &#58; maybe CrBuffer start address in ME ram
	Video_Codec_BufferMP4V&#91;55&#93; &#58; maybe CbBuffer start address in ME ram
	Video_Codec_BufferMP4V&#91;56&#93; &#58; frame padding width
	Video_Codec_BufferMP4V&#91;57&#93; &#58; &#40;frame padding width&#41; >> 1
	*****************************************************************************/
	
	
	
	Video_YCrCbCopy_SrcBufferMP4V&#91;0&#93; = &#40;Video_Codec_BufferMP4V&#91;45&#93;+15&#41; & 0xFFFFFFF0;
	Video_YCrCbCopy_SrcBufferMP4V&#91;1&#93; = &#40;Video_Codec_BufferMP4V&#91;44&#93;+15&#41; & 0xFFFFFFF0;
	Video_YCrCbCopy_SrcBufferMP4V&#91;2&#93; = 0;
	Video_YCrCbCopy_SrcBufferMP4V&#91;3&#93; = 1;
	Video_YCrCbCopy_SrcBufferMP4V&#91;4&#93; = Video_Codec_BufferMP4V&#91;53&#93;;
	Video_YCrCbCopy_SrcBufferMP4V&#91;5&#93; = Video_YCrCbCopy_SrcBufferMP4V&#91;4&#93; + &#40;Video_Codec_BufferMP4V&#91;56&#93; * &#40;Video_YCrCbCopy_SrcBufferMP4V&#91;0&#93; >> 1&#41;&#41;; 
	Video_YCrCbCopy_SrcBufferMP4V&#91;6&#93; = Video_Codec_BufferMP4V&#91;54&#93;;
	Video_YCrCbCopy_SrcBufferMP4V&#91;7&#93; = Video_Codec_BufferMP4V&#91;55&#93;;
	Video_YCrCbCopy_SrcBufferMP4V&#91;8&#93; = Video_YCrCbCopy_SrcBufferMP4V&#91;6&#93; + &#40;Video_Codec_BufferMP4V&#91;57&#93; * &#40;Video_YCrCbCopy_SrcBufferMP4V&#91;0&#93; >> 2&#41;&#41;;
	Video_YCrCbCopy_SrcBufferMP4V&#91;9&#93; = Video_YCrCbCopy_SrcBufferMP4V&#91;7&#93; + &#40;Video_Codec_BufferMP4V&#91;57&#93; * &#40;Video_YCrCbCopy_SrcBufferMP4V&#91;0&#93; >> 2&#41;&#41;;
	Video_YCrCbCopy_SrcBufferMP4V&#91;10&#93; = 0;
	Video_YCrCbCopy_SrcBufferMP4V&#91;11&#93; = 0;
	
	Video_YCrCbCopy_DestBufferMP4V&#91;0&#93; = &#40;Video_Codec_BufferMP4V&#91;45&#93;+15&#41; >> 4;
	Video_YCrCbCopy_DestBufferMP4V&#91;1&#93; = &#40;Video_Codec_BufferMP4V&#91;56&#93;+15&#41; >> 4;
	Video_YCrCbCopy_DestBufferMP4V&#91;4&#93; = YBuffer;
	Video_YCrCbCopy_DestBufferMP4V&#91;5&#93; = &#40;unsigned long&#41;&#40;&#40;&#40;void*&#41;YBuffer&#41; + &#40;Video_Codec_BufferMP4V&#91;56&#93; * &#40;Video_YCrCbCopy_SrcBufferMP4V&#91;0&#93; >> 1&#41;&#41; &#41;;
	Video_YCrCbCopy_DestBufferMP4V&#91;6&#93; = CrBuffer;
	Video_YCrCbCopy_DestBufferMP4V&#91;7&#93; = CbBuffer;
	Video_YCrCbCopy_DestBufferMP4V&#91;8&#93; = &#40;unsigned long&#41;&#40;&#40;&#40;void*&#41;CrBuffer&#41; + &#40;Video_Codec_BufferMP4V&#91;57&#93; * &#40;Video_YCrCbCopy_SrcBufferMP4V&#91;0&#93; >> 2&#41;&#41; &#41;;
	Video_YCrCbCopy_DestBufferMP4V&#91;9&#93; = &#40;unsigned long&#41;&#40;&#40;&#40;void*&#41;CbBuffer&#41; + &#40;Video_Codec_BufferMP4V&#91;57&#93; * &#40;Video_YCrCbCopy_SrcBufferMP4V&#91;0&#93; >> 2&#41;&#41; &#41;;
	Video_YCrCbCopy_DestBufferMP4V&#91;10&#93; = Video_Codec_BufferMP4V&#91;45&#93;;
	Video_YCrCbCopy_DestBufferMP4V&#91;11&#93; = Video_Codec_BufferMP4V&#91;44&#93;;
	Video_YCrCbCopy_DestBufferMP4V&#91;12&#93; = 512;
	
	fp = fopen&#40;"ms0&#58;/sceMpegBaseYCrCbCopyVme&#40;mp4v&#41;.dat", "wb"&#41;;
	for&#40;i=0;i<12;i++&#41; &#123;
		fwrite&#40; &Video_YCrCbCopy_SrcBufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	for&#40;i=0;i<12;i++&#41; &#123;
		fwrite&#40; &Video_YCrCbCopy_DestBufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	fclose&#40;fp&#41;;
	
	res = sceMpegBaseYCrCbCopyVme&#40;Video_YCrCbCopy_DestBufferMP4V, Video_YCrCbCopy_SrcBufferMP4V, 3&#41;;
	pspDebugScreenPrintf&#40;"sceMpegBaseYCrCbCopyVme=0x%08X\n", res&#41;;
	
	fp = fopen&#40;"ms0&#58;/YBuffer&#40;mp4v&#41;.dat", "wb"&#41;;
	fwrite&#40; YBuffer, 512*512 , 1, fp&#41;;
	fclose&#40;fp&#41;;
	
	fp = fopen&#40;"ms0&#58;/CrBuffer&#40;mp4v&#41;.dat", "wb"&#41;;
	fwrite&#40; CrBuffer, 512*128 , 1, fp&#41;;
	fclose&#40;fp&#41;;
	
	fp = fopen&#40;"ms0&#58;/CbBuffer&#40;mp4v&#41;.dat", "wb"&#41;;
	fwrite&#40; CbBuffer, 512*128 , 1, fp&#41;;
	fclose&#40;fp&#41;;

	
	//---------------------------------------------------------------------------------//	
	sceCtrlReadBufferPositive&#40;&input, 1&#41;;
	while&#40;!&#40;input.Buttons & PSP_CTRL_TRIANGLE&#41;&#41;
	&#123;
		sceKernelDelayThread&#40;10000&#41;;	// wait 10 milliseconds
		sceCtrlReadBufferPositive&#40;&input, 1&#41;;
	&#125;
	
	fp = fopen&#40;"ms0&#58;/mp4vend.dat", "wb"&#41;;
	for&#40;i=0;i<96;i++&#41; &#123;
		pspDebugScreenPrintf&#40;"0x%08X ", Video_Codec_BufferMP4V&#91;i&#93;&#41;;
		fwrite&#40; &Video_Codec_BufferMP4V&#91;i&#93;, sizeof&#40;unsigned int&#41;, 1, fp&#41;;
	&#125;
	pspDebugScreenPrintf&#40;"\n"&#41;;
	fclose&#40;fp&#41;;

wait&#58;
	sceCtrlReadBufferPositive&#40;&input, 1&#41;;
	while&#40;!&#40;input.Buttons & PSP_CTRL_TRIANGLE&#41;&#41;
	&#123;
		sceKernelDelayThread&#40;10000&#41;;	// wait 10 milliseconds
		sceCtrlReadBufferPositive&#40;&input, 1&#41;;
	&#125;
	
	sceKernelExitGame&#40;&#41;;
	return 0;
&#125;


/* Exit callback */
int exit_callback&#40;int arg1, int arg2, void *common&#41;
&#123;
	sceKernelExitGame&#40;&#41;;
	return 0;
&#125;


/* Callback thread */
int CallbackThread&#40;SceSize args, void *argp&#41;
&#123;
	int cbid;

	cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
	sceKernelRegisterExitCallback&#40;cbid&#41;;

	sceKernelSleepThreadCB&#40;&#41;;

	return 0;
&#125;


/* Sets up the callback thread and returns its thread id */
int SetupCallbacks&#40;void&#41;
&#123;
	int thid = 0;

	thid = sceKernelCreateThread&#40;"update_thread", CallbackThread, 0x11, 0xFA0, 0, 0&#41;;
	if&#40;thid >= 0&#41;
	&#123;
		sceKernelStartThread&#40;thid, 0, 0&#41;;
	&#125;

	return thid;
&#125;
Last edited by cooleyes on Mon Aug 27, 2007 1:23 pm, edited 1 time in total.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

cooleyes man you are the FUCKING Man ! :)
ahh now you just gotta figure out where the SYNC calls are :)

but thanx alot this saves me alot of bloat from xvidcore
keep it up man ...already i am forever in your debt

PS> did you ever figure the address of where me_for_vsh looks
up for its audio DEMUXing ability / Digital Signal Processor / for synthesis processing ???

PISS> why did you add sceMpegBaseYCrCbCopyVme to videocodec ?

thanx alot again

ADD to PSPSDK SVN
10011011 00101010 11010111 10001001 10111010
cools
Posts: 46
Joined: Sat Mar 04, 2006 12:57 pm

Post by cools »

This is pretty cool! Well im glad that xvid/divx can be decoded! this will probably lead to further developments.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Wow!, you don't stop do you?
Thanks a lot :)
Art.
cooleyes
Posts: 123
Joined: Thu May 18, 2006 3:30 pm

Post by cooleyes »

hehe, I had updated some code.
after call sceMpegBaseYCrCbCopyVme
we can get a three buffer( Y, Cr, Cb)
and the data is stored as YV12 format
so we can do a CSC, change it to RGB format, to draw
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Whopper! Definitely useful.
Great work once again cooleyes :)
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Post by Matrixdub »

I'm sorry for bumping this with no useful information, but I am wondering if an application has materialised from this code. If not, is it even feasible? Would the PSP be able to decode XviD at 480p at 30fps?

There are other applications that decode Xvid avis but nnowhere near 272p at 30fps.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Matrixdub wrote:I'm sorry for bumping this with no useful information, but I am wondering if an application has materialised from this code. If not, is it even feasible? Would the PSP be able to decode XviD at 480p at 30fps?

There are other applications that decode Xvid avis but nnowhere near 272p at 30fps.
When my other zillion of projects are coming to an end I'll deploy this in PMPVLC and my upcoming PSP Gnash port.
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Post by Matrixdub »

thank you!
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Yep, adding native xvid support to your excellent pmpvlc would be awsome jockyw2001 :)
someone
Idiot
Posts: 71
Joined: Tue Sep 13, 2005 9:03 pm

Post by someone »

Any update?

Really want!
Rangu2057
Posts: 87
Joined: Mon Jul 23, 2007 8:37 am
Location: wilmington, NC

Post by Rangu2057 »

Good job man, keep up the awesome work
the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2)
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

Just for notification: I added pspvideocodec and pspmpegbase to the SDK.
Still needs some documentation on the use of the "Video_Codec_BufferMP4V" (best create a matching struct) and Video_YCrCbCopy_Buffer (already created a struct for that - see pspmpegbase.h).
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Post by Matrixdub »

Sorry, I've been out of it for a while, can we play avi files natively on the PSP yet?
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Post by Matrixdub »

I'm sorry, can someone please tell me how to load this under the PSP to play XviD files? I don't have any coding experience.

Thank you.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Matrixdub wrote:I'm sorry, can someone please tell me how to load this under the PSP to play XviD files? I don't have any coding experience.

Thank you.
You clearly don't understand video either. :)

xvid is a method of compressing a video stream. You won't find any files that are xvid, but they might have a video stream that had been compressed using xvid. The file level is the container. Containers are AVI, MKV, OGM, MP4, etc. Within the container, you'll have a number of streams - usually at least one video and one audio stream (multiple audio streams and a subtitle stream are also common).

You can already play "xvid" as long as the dimensions are correct, the encoding was compliant, and it's in a supported container. Generic AVI files are not supported by the PSP. If you are looking for something that can play generic video files (like AVIs with unspecified xvid streams), get PSPTube and put the video files in the favorites drawer. It can play a variety of video files, but expect the higher resolution ones to skip.

Your best bet for playing video on the PSP is still to convert the video into something the PSP can handle using an app like xvid4psp.
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Post by Matrixdub »

I thought this code meant that the PSP could decode "XviD files" faster than simply changing the container to pmp (which works reasonably well). Was I wrong in that aspect?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Matrixdub wrote:I thought this code meant that the PSP could decode "XviD files" faster than simply changing the container to pmp (which works reasonably well). Was I wrong in that aspect?
Not entirely. Just as with the hw accelerated h.264, the xvid encoding probably has to follow the same guidelines as the "official" xvid/mp4 files the built-in player handles. The Sony libs don't handle arbitrary streams. For example, the dimensions still need to be divisible by 16. Hopefully the xvid decoder is less constrained than the h.264 decoder. I suppose someone will have try it and see.
Matrixdub
Posts: 60
Joined: Fri May 13, 2005 3:47 am

Post by Matrixdub »

J.F. wrote: I suppose someone will have try it and see.
I've looked but I can't find a binary for this.
Post Reply