forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

a sample to decode a psp mp4(avc) file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Tue Mar 11, 2008 1:55 pm    Post subject: a sample to decode a psp mp4(avc) file Reply with quote

Here is a sample code to decode a psp mp4(avc) file.
to decode mp4(avc), we need a mpeg_vsh.prx from psp fw (ver > 2.00)
so I use the mpeg_vsh.prx from psp fw(3.30),
I decompress and decrypt mpeg_vsh.prx from psp fw(3.30) and rename to mpeg_vsh330.prx , and use it to decode mp4(avc)

now, I can decode <=480*272 avc frame from psp mp4 file,
and I am trying to decode 720*480 avc frame from psp mp4 file.

Code:

/*
 *   Copyright (C) 2008 cooleyes
 *   eyes.cooleyes@gmail.com
 *
 *  This Program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  This Program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */
#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdisplay.h>
#include <psputils.h>
#include <pspgu.h>
#include <pspdebug.h>
#include <psppower.h>
#include <stdio.h>
#include <stdlib.h>
#include <psprtc.h>
#include <pspsdk.h>
#include <string.h>
#include <malloc.h>
#include "mem64.h"
#include "pspmpeg/pspmpeg.h"
#include "mp4ff.h"

int SetupCallbacks();

PSP_MODULE_INFO("avcdecode test", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
PSP_HEAP_SIZE_KB(18*1024);

SceCtrlData input;

typedef struct {
   ScePVoid sps_buffer;
   SceInt32 sps_size;
   ScePVoid pps_buffer;
   SceInt32 pps_size;
   SceInt32 unkown0;
   ScePVoid nal_buffer;
   SceInt32 nal_size;
   SceInt32 mode;
} AvcNalStruct;

typedef struct {
   SceInt32 unknown0;
   SceInt32 unknown1;
   SceInt32 width;
   SceInt32 height;
   SceInt32 unknown4;
   SceInt32 unknown5;
   SceInt32 unknown6;
   SceInt32 unknown7;
   SceInt32 unknown8;
   SceInt32 unknown9;
} AvcInfoStruct;

typedef struct {
   ScePVoid buffer0;
   ScePVoid buffer1;
   ScePVoid buffer2;
   ScePVoid buffer3;
   ScePVoid buffer4;
   ScePVoid buffer5;
   ScePVoid buffer6;
   ScePVoid buffer7;
   SceInt32 unknown0;
   SceInt32 unknown1;
   SceInt32 unknown2;
} AvcYuvStruct;


typedef struct {
   SceInt32 unknown0;
   SceInt32 unknown1;
   SceInt32 unknown2;
   SceInt32 unknown3;
   AvcInfoStruct* info_buffer;
   SceInt32 unknown5;
   SceInt32 unknown6;
   SceInt32 unknown7;
   SceInt32 unknown8;
   SceInt32 unknown9;
   SceInt32 unknown10;
   AvcYuvStruct* yuv_buffer;
   SceInt32 unknown12;
   SceInt32 unknown13;
   SceInt32 unknown14;
   SceInt32 unknown15;
   SceInt32 unknown16;
   SceInt32 unknown17;
   SceInt32 unknown18;
   SceInt32 unknown19;
   SceInt32 unknown20;
   SceInt32 unknown21;
   SceInt32 unknown22;
   SceInt32 unknown23;
} AvcCodecStruct;

typedef struct {
   SceInt32 height;
   SceInt32 width;
   SceInt32 mode0;
   SceInt32 mode1;
   ScePVoid buffer0;
   ScePVoid buffer1;
   ScePVoid buffer2;
   ScePVoid buffer3;
   ScePVoid buffer4;
   ScePVoid buffer5;
   ScePVoid buffer6;
   ScePVoid buffer7;
} AvcCscStruct;

typedef struct {
   ScePVoid mpeg_buffer;
   SceMpeg mpeg;
   SceMpegRingbuffer mpeg_ringbuffer;
   SceMpegAu* mpeg_au;
   SceInt32 mpeg_mode;
   SceInt32 mpeg_buffer_size;
   ScePVoid mpeg_ddrtop;
   ScePVoid mpeg_au_buffer;
   AvcNalStruct mpeg_nal;
   AvcCodecStruct* mpeg_codec_buffer;
   AvcYuvStruct* mpeg_yuv_buffer;
   AvcInfoStruct* mpeg_info_buffer;   
} AvcDecodeStruct;

static uint32_t mp4_read(void *user_data, void *buffer, uint32_t length) {
   FILE** fp = (FILE**)user_data;
   uint32_t res = fread(buffer, length, 1, *fp);
   return (res*length);
}

static uint32_t mp4_seek(void *user_data, uint64_t position) {
   FILE** fp = (FILE**)user_data;
   return fseek(*fp, position, PSP_SEEK_SET );
}

AvcDecodeStruct avc_struct;
AvcDecodeStruct* avc = &avc_struct;
AvcCscStruct csc_struct;
AvcCscStruct* csc = &csc_struct;
//unsigned char RGBBuffer[4*512*512];
unsigned char RGBBuffer0[4*512*272];
unsigned char RGBBuffer1[4*512*272];
unsigned char* FrameBuffer[] = {RGBBuffer0, RGBBuffer1};
int frame_index = 0;
char filename[1024];

mp4ff_callback_t mp4_callback = {mp4_read, 0, mp4_seek, 0, 0};

int main(void)
{
   SetupCallbacks();
   
   pspDebugScreenInit();
   pspDebugScreenSetXY(0, 2);
   //scePowerSetClockFrequency(333,333,166);
   //scePowerSetCpuClockFrequency(333);
   //scePowerSetBusClockFrequency(166);
   scePowerSetClockFrequency(133,133,66);
   scePowerSetCpuClockFrequency(133);
   scePowerSetBusClockFrequency(66);
   u32 cpu = scePowerGetCpuClockFrequency();
   u32 bus = scePowerGetBusClockFrequency();
   
   pspDebugScreenPrintf("cpu=%d, bus=%d\n", cpu, bus);
   
   getcwd(filename, 256);
   strcat(filename, "/mpeg_vsh330.prx");
   pspDebugScreenPrintf("%s\n", filename);
   
   FILE* mp4_file = fopen("ms0:/VIDEO/Test.MP4", "rb");
   mp4_callback.user_data = &mp4_file;
   mp4ff_t* mp4_handle = mp4ff_open_read(&mp4_callback);
   u32 total_tracks = mp4ff_total_tracks(mp4_handle);
   pspDebugScreenPrintf("total_tracks=%d\n", total_tracks);
   int ii;
   for(ii = 0; ii < total_tracks; ii++) {
      pspDebugScreenPrintf("track%d : type 0x%08X\n", ii, mp4ff_get_track_type(mp4_handle, ii));
      pspDebugScreenPrintf("track%d : %d samples\n", ii, mp4ff_num_samples(mp4_handle, ii));
   }
   u32 total_samples = mp4ff_num_samples(mp4_handle, 0);
   unsigned char* sps_pps_buffer;
   unsigned int sps_size, pps_size;
   
   if ( mp4ff_get_avc_sps_pps(mp4_handle, 0, &sps_pps_buffer, &sps_size, &pps_size) != 0 || sps_size == 0 || pps_size == 0 )  {
      pspDebugScreenPrintf("\nerr: get_avc_sps_pps\n");
      goto wait;
   }
   
   //pspDebugScreenPrintf("sps_size=%d, pps_size=%d\n", sps_size, pps_size);
   
   int result;
   result = sceUtilityLoadAvModule(0);
   if ( result < 0 ) {
      pspDebugScreenPrintf("\nerr: sceUtilityLoadAvModule(0)\n");
      goto wait;
   }
   
   SceUID modid;
   int status;
   modid = sceKernelLoadModule(filename, 0, NULL);
   if(modid >= 0) {
      modid = sceKernelStartModule(modid, 0, 0, &status, NULL);
   }
   else {
      pspDebugScreenPrintf("\nerr=0x%08X : sceKernelLoadModule\n", modid);
      goto wait;
   }

//   result = pspSdkLoadStartModule("ms0:/mpeg_vsh330.prx", PSP_MEMORY_PARTITION_USER);
//   result = sceUtilityLoadAvModule(3);
//   if ( result < 0 ){
//      pspDebugScreenPrintf("\nerr=0x%08X : sceUtilityLoadAvModule(3)\n", result);
//      goto wait;
//   }
   
   result = sceMpegInit();
   if ( result != 0 ){
      pspDebugScreenPrintf("\nerr: sceMpegInit\n");
      goto wait;
   }
   
   avc->mpeg_mode = 4;
//   avc->mpeg_ddrtop = 0x09400000;
//   avc->mpeg_au_buffer = 0x09410000;
   avc->mpeg_ddrtop =  memalign(0x400000, 0x400000);
   avc->mpeg_au_buffer = avc->mpeg_ddrtop + 0x10000;

//   pspDebugScreenPrintf("\naddress=0x%08X\n", avc->mpeg_au_buffer);
   
   
   result = sceMpegQueryMemSize(avc->mpeg_mode);
   if ( result < 0 ){
      pspDebugScreenPrintf("\nerr: sceMpegQueryMemSize(0x%08X)\n", avc->mpeg_mode);
      goto wait;
   }
   
//   pspDebugScreenPrintf("\n%d\n", result);
   
   avc->mpeg_buffer_size = result;
   
   if ( (result & 0xF) != 0 )
      result = (result & 0xFFFFFFF0) + 16;
         
   avc->mpeg_buffer = malloc_64(result);
   if ( avc->mpeg_buffer == 0 ) {
      pspDebugScreenPrintf("\nerr: alloc\n");
      goto wait;
   }
   
   result = sceMpegCreate(&avc->mpeg, avc->mpeg_buffer, avc->mpeg_buffer_size, &avc->mpeg_ringbuffer, 512, avc->mpeg_mode, avc->mpeg_ddrtop);   
   if ( result != 0){
      pspDebugScreenPrintf("\nerr: sceMpegCreate\n");
      goto wait;
   }
   
   avc->mpeg_au = (SceMpegAu*)malloc_64(64);
   if ( avc->mpeg_au == 0 ) {
      pspDebugScreenPrintf("\nerr: alloc\n");
      goto wait;
   }
   memset(avc->mpeg_au, 0xFF, 64);
   if ( sceMpegInitAu(&avc->mpeg, avc->mpeg_au_buffer, avc->mpeg_au) != 0 ){
      pspDebugScreenPrintf("\nerr: sceMpegInitAu\n");
      goto wait;
   }
   
   unsigned char* nal_buffer = (unsigned char*)malloc_64(1024*1024);
   
//   unsigned char sps_pps_buffer[27];
//   
//   FILE* fp;
//   fp = fopen("ms0:/sps_pps.dat", "rb");
//   fread(sps_pps_buffer, 27, 1, fp);
//   fclose(fp);
//   sps_size = 23;
//   pps_size = 4;
   
   //---------------------------------------------------------------------------------//
   float curr_ms = 1.0f;
   u64 last_tick;
   sceRtcGetCurrentTick(&last_tick);
   u32 tick_frequency = sceRtcGetTickResolution();
   int frame_count = 0;
   sceCtrlReadBufferPositive(&input, 1);
   
   int pic_num;
   
   sceDisplayWaitVblankStart();
   sceDisplaySetFrameBuf(FrameBuffer[frame_index], 512, PSP_DISPLAY_PIXEL_FORMAT_8888, PSP_DISPLAY_SETBUF_IMMEDIATE);
   
while(!(input.Buttons & PSP_CTRL_TRIANGLE)) {
   
   float curr_fps = 1.0f / curr_ms;
   //pspDebugScreenSetXY(0,0);
   //pspDebugScreenPrintf("fps: %d.%03d \n",(int)curr_fps,(int)((curr_fps-(int)curr_fps) * 1000.0f));
   
   avc->mpeg_nal.sps_buffer = (&sps_pps_buffer[0]);
   avc->mpeg_nal.sps_size = sps_size;
   avc->mpeg_nal.pps_buffer = (&sps_pps_buffer[sps_size]);
   avc->mpeg_nal.pps_size = pps_size;
   avc->mpeg_nal.unkown0 = 4;
   memset(nal_buffer, 0, 1024*1024);
   mp4ff_read_sample_v2(mp4_handle, 0, frame_count, nal_buffer);
   avc->mpeg_nal.nal_buffer = nal_buffer;
   avc->mpeg_nal.nal_size = mp4ff_read_sample_getsize(mp4_handle, 0, frame_count);//size1 ;
   if ( frame_count == 0 )
      avc->mpeg_nal.mode = 3;
   else
      avc->mpeg_nal.mode = 0;
   FILE* fp1;
//   memset(filename,0,1024);
//   sprintf(filename, "ms0:/mpeg%d_0.dat", frame_count);
//   fp1 = fopen(filename, "wb");
//   fwrite(p1, 512, 1, fp1);
//   fclose(fp1);
   
   result = sceMpegGetAvcNalAu(&avc->mpeg, &avc->mpeg_nal, avc->mpeg_au);
   memset(filename,0,1024);
//   sprintf(filename, "ms0:/au%d_1.dat", frame_count);
//   fp1 = fopen(filename, "wb");
//   fwrite(au0, 64, 1, fp1);
//   fclose(fp1);
//   pspDebugScreenPrintf(" GetAvcNalAu=0x%08X\n", result);
   
   result = sceMpegAvcDecode(&avc->mpeg, avc->mpeg_au, 512, 0, &pic_num);
//   pspDebugScreenPrintf(" AvcDecode=0x%08X,0x%08X\n", result, pic_num);
   result = sceMpegAvcDecodeDetail2(&avc->mpeg, &avc->mpeg_codec_buffer);
//   pspDebugScreenPrintf(" AvcDecodeDetail2=0x%08X\n", result);
   
   
   if ( result == 0 ) {
      avc->mpeg_yuv_buffer = avc->mpeg_codec_buffer->yuv_buffer;
      avc->mpeg_info_buffer = avc->mpeg_codec_buffer->info_buffer;
      
      if ( pic_num > 0 ) {
         int i;
         for(i=0;i<pic_num;i++) {
            int csc_mode = 0;//i % 2;
            csc->height = avc->mpeg_info_buffer->height >> 4;
            csc->width = avc->mpeg_info_buffer->width >> 4;
            csc->mode0 = csc_mode;
            csc->mode1 = csc_mode;
            if ( csc_mode == 0 ) {
               csc->buffer0 = avc->mpeg_yuv_buffer->buffer0 ;
               csc->buffer1 = avc->mpeg_yuv_buffer->buffer1 ;
               csc->buffer2 = avc->mpeg_yuv_buffer->buffer2 ;
               csc->buffer3 = avc->mpeg_yuv_buffer->buffer3 ;
               csc->buffer4 = avc->mpeg_yuv_buffer->buffer4 ;
               csc->buffer5 = avc->mpeg_yuv_buffer->buffer5 ;
               csc->buffer6 = avc->mpeg_yuv_buffer->buffer6 ;
               csc->buffer7 = avc->mpeg_yuv_buffer->buffer7 ;
            }
            else {
               csc->buffer0 = avc->mpeg_yuv_buffer->buffer2 ;
               csc->buffer1 = avc->mpeg_yuv_buffer->buffer3 ;
               csc->buffer2 = avc->mpeg_yuv_buffer->buffer0 ;
               csc->buffer3 = avc->mpeg_yuv_buffer->buffer1 ;
               csc->buffer4 = avc->mpeg_yuv_buffer->buffer6 ;
               csc->buffer5 = avc->mpeg_yuv_buffer->buffer7 ;
               csc->buffer6 = avc->mpeg_yuv_buffer->buffer4 ;
               csc->buffer7 = avc->mpeg_yuv_buffer->buffer5 ;
            }
            
            result = sceMpegBaseCscAvc(FrameBuffer[frame_index],0,512,csc);
//            pspDebugScreenPrintf(" BaseCscAvc=0x%08X\n", result);
            if ( result == 0 ) {
//               memset(filename,0,1024);
//               sprintf(filename, "ms0:/RGB%d.%d.dat", frame_count,i);
//               fp1 = fopen(filename, "wb");
//               fwrite(RGBBuffer, 4*512*512, 1, fp1);
//               fclose(fp1);
               sceDisplayWaitVblankStart();
               sceDisplaySetFrameBuf(FrameBuffer[frame_index], 512, PSP_DISPLAY_PIXEL_FORMAT_8888, PSP_DISPLAY_SETBUF_IMMEDIATE);
               frame_index = (frame_index+1) % 2;
               //sceKernelDelayThread(10000);
            }
         }
      }
   }
//   memset(filename,0,1024);
//   sprintf(filename, "ms0:/mpeg%d.dat", frame_count);
//   fp1 = fopen(filename, "wb");
//   fwrite(p1, 512, 1, fp1);
//   fclose(fp1);
   ++frame_count;
   if ( frame_count >= total_samples )
      break;
   u64 curr_tick;
   sceRtcGetCurrentTick(&curr_tick);
   if ((curr_tick-last_tick) >= tick_frequency)
   {
      float time_span = ((int)(curr_tick-last_tick)) / (float)tick_frequency;
      curr_ms = time_span / frame_count;
      //frame_count = 0;
      sceRtcGetCurrentTick(&last_tick);
   }
   sceCtrlReadBufferPositive(&input, 1);
}
//   fclose(fp);

wait:
   mp4ff_close(mp4_handle);
   fclose(mp4_file);
   pspDebugScreenPrintf("\n");
   pspDebugScreenPrintf("press triangle to exit...\n");
   sceCtrlReadBufferPositive(&input, 1);
   while(!(input.Buttons & PSP_CTRL_TRIANGLE))
   {
      sceKernelDelayThread(10000);   // wait 10 milliseconds
      sceCtrlReadBufferPositive(&input, 1);
   }
   
   sceKernelExitGame();
   return 0;
}


/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
   sceKernelExitGame();
   return 0;
}


/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
   int cbid;

   cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
   sceKernelRegisterExitCallback(cbid);

   sceKernelSleepThreadCB();

   return 0;
}


/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
   int thid = 0;

   thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
   if(thid >= 0)
   {
      sceKernelStartThread(thid, 0, 0);
   }

   return thid;
}


Makefile, it build a fw3xx eboot
Code:

TARGET = AvcDecodeTest
OBJS = main.o mem64.o mpegbase.o

BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -G0 -Wall -O2
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

INCDIR = ./mp4ff/include
LIBDIR =  .
LDFLAGS =
LIBS= -lpsppower -lm -lpsprtc -lpspgu -lpspmpeg -lmp4ff

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = AvcDecode Test

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Last edited by cooleyes on Tue Mar 11, 2008 3:06 pm; edited 2 times in total
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Tue Mar 11, 2008 1:58 pm    Post subject: Reply with quote

Excellent work.

Careful or you'll run out of formats to decode soon ;)
Back to top
View user's profile Send private message
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Tue Mar 11, 2008 2:00 pm    Post subject: Reply with quote

do not use "sceUtilityLoadAvModule(3)",
because when use sceUtilityLoadAvModule(3), it will load mpeg.prx from psp fw(ver>300), not mpeg_vsh.prx.
the mpeg.prx in psp fw(ver>300) is same mpeg_vsh.prx in psp fw(ver=150)
it can not decode avc frame in psp mp4 file
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Mar 12, 2008 5:45 am    Post subject: Reply with quote

These are the AVC movies we use in the XMB?
Very good :)
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Wed Mar 12, 2008 11:08 am    Post subject: Reply with quote

Art wrote:
These are the AVC movies we use in the XMB?
Very good :)

yes! :P
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Mar 12, 2008 12:37 pm    Post subject: Reply with quote

Trouble compiling on my old toolchain :(
I assume mem64.H is part of the new updates for the slim?
Could these be uploaded somewhere so I can try in 1.50 kernel?
I can get the firmware file for myself.
Or does it actually require the 64Mb of the slim?
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Wed Mar 12, 2008 1:00 pm    Post subject: Reply with quote

Art wrote:
Trouble compiling on my old toolchain :(
I assume mem64.H is part of the new updates for the slim?
Could these be uploaded somewhere so I can try in 1.50 kernel?
I can get the firmware file for myself.
Or does it actually require the 64Mb of the slim?


no, it can run in slim psp or fat psp.
but it must run in 3.xx kernel.
here is my full source package,
http://www.mediafire.com/?zs1ojnnrxtx
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Mar 12, 2008 1:24 pm    Post subject: Reply with quote

Thanks heaps :)
If I can get that running with an MP3 player app, I'll make it the autoboot program
and use a PSP for that entirely :)
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
Vincent_M



Joined: 03 Apr 2007
Posts: 73

PostPosted: Thu Mar 13, 2008 3:12 am    Post subject: Reply with quote

I uh, kinda still use FW 1.5 because I haven't gotten around to making a Pandora Battery (I don't have XP on a computer I can get to...). Is it possible to do this with a 1.5 PSP? Are there methods for creating a Pandora's Battery on 64-bit Vista or 64-bit Linux systems out there?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Mar 13, 2008 6:22 am    Post subject: Reply with quote

Windows has never been necessary to make a Pandora battery... see e.g. http://psp.jim.sh/fanjita/linux.txt. These days, just follow a guide like http://forums.exophase.com/showthread.php?t=3780 and you won't need a PC at all other than to move files around.
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Tue Mar 18, 2008 9:22 pm    Post subject: Reply with quote

Many thanks again cooleyes, exellent work.
I will try to add this to the shell i'm working on.
Back to top
View user's profile Send private message
Vincent_M



Joined: 03 Apr 2007
Posts: 73

PostPosted: Wed Mar 19, 2008 3:22 pm    Post subject: Reply with quote

Quote:
Windows has never been necessary to make a Pandora battery... see e.g. http://psp.jim.sh/fanjita/linux.txt. These days, just follow a guide like http://forums.exophase.com/showthread.php?t=3780 and you won't need a PC at all other than to move files around.

Thanks, that's just what I need.
Back to top
View user's profile Send private message
noxa



Joined: 05 Aug 2006
Posts: 39

PostPosted: Sun Apr 06, 2008 1:58 am    Post subject: Reply with quote

Has anyone got this working? I'm trying to test it out and am having a bit of trouble; I put an MP4 on my memory stick and ran the app, it prints out the track information for the file but it fails with 'err: sceMpegInit'.
Using psplink's modlist command after this error, I see that sceMpeg_library is loaded but nothing like sceMpegbase/sceAudiocodec/Videocodec/etc are.

I'm running on a fat w/ 3.52 M33. Old, I know, but it works for most things. Does this require a newer firmware?

Edit: turns out that running under psplink causes it to fail - if I try running it from the xmb it starts and I'm assuming it plays something (constant ms usage), but I can't see anything. Progress :)
Back to top
View user's profile Send private message Visit poster's website
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun Apr 06, 2008 2:35 am    Post subject: Reply with quote

It's working great here on 390 under psplink.
Back to top
View user's profile Send private message
edepot



Joined: 09 Apr 2005
Posts: 111

PostPosted: Sun Apr 06, 2008 1:50 pm    Post subject: mp4 Reply with quote

What about mpeg2? I am assuming there is no hardware acceleration of mpeg2 in the psp? Has anyone compiled vlc for the psp? I also forgot where the source is for reading inside .iso files (I assume it is inside the custom firmware). So the next step would be to be able to read .vob and once that is accomplished, shouldn't the psp slim be able to read dvd iso's and output to the TV in full 740x480 24bits/pixel mode? Your PSP becomes a dvd player. I think the 4.7gb of a DVD would fit inside 4GB if the dolby is stripped to containing only the stereo signals (the PSP slim can only output stereo to the tv). Even this may not be needed because most DVD is not filled up. Or just put the iso on a 8gb stick. Of course, using some of the hardware of the PSP to speed up mpeg2 decoding would greatly enhance the speed. To keep this in perspective, it can be used for homemade burned movies.
Back to top
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Sun Apr 06, 2008 8:22 pm    Post subject: Reply with quote

I want divx!!! Sigh sigh...(crying on the bed with face pushed in pillow)
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sun Apr 06, 2008 8:30 pm    Post subject: Reply with quote

jean wrote:
I want divx!!! Sigh sigh...(crying on the bed with face pushed in pillow)


http://forums.ps2dev.org/viewtopic.php?t=8846
Back to top
View user's profile Send private message
noxa



Joined: 05 Aug 2006
Posts: 39

PostPosted: Tue Apr 08, 2008 12:37 am    Post subject: Reply with quote

I was able to get it working - it just can't be run under psplink for me. Probably just an old version issue.

Thanks for the sample cooleyes!
Back to top
View user's profile Send private message Visit poster's website
thereapman



Joined: 04 Apr 2008
Posts: 2

PostPosted: Thu Apr 10, 2008 6:17 am    Post subject: Reply with quote

noxa wrote:
...if I try running it from the xmb it starts and I'm assuming it plays something (constant ms usage), but I can't see anything. Progress :)


Same here. MS is doing some work but nothing on the Screen after the print of the Tracks. what's to do to see and hear the videostream?
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Thu Apr 10, 2008 5:27 pm    Post subject: Reply with quote

Maybe you have the same problem i had with the mp3 decoding code, you should try to install the 3xx fatmsmod patch made by dark_alex.
Back to top
View user's profile Send private message
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Thu Apr 10, 2008 8:12 pm    Post subject: Reply with quote

Cpasjuste wrote:
Maybe you have the same problem i had with the mp3 decoding code, you should try to install the 3xx fatmsmod patch made by dark_alex.


hehe, I had updated PPA svn, the new beta fw3xx verison PPA can play mp4avc file now

PPA source svn:

http://code.google.com/p/pmplayer-advance/
Back to top
View user's profile Send private message
frenchskud



Joined: 05 Sep 2007
Posts: 2

PostPosted: Sat May 03, 2008 6:19 pm    Post subject: Reply with quote

Hello, I m very impressed by all of this;
As you know the PSP is still not able to read Ipod MP4 movie because the stream is coded CAVLC and not CABAC ... this is really stupid from Sony to limit the decoding software.

Based on this work, is there any chance to enable CAVLC video stream decoding?

keep continuing such a good job, tis will probably enforce Sony to open there firmware one day or another:)
_________________
PSP+Ipod+Archos
Back to top
View user's profile Send private message
peb



Joined: 12 Mar 2007
Posts: 26

PostPosted: Sat Aug 02, 2008 2:42 am    Post subject: Reply with quote

Wooo, it's very nice!

I had try your app, but I have problem with get_avc_sps_pps, why?!
_________________
Sorry for my English, I'm french.
Back to top
View user's profile Send private message
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Thu Feb 05, 2009 4:36 pm    Post subject: Reply with quote

frenchskud wrote:
Hello, I m very impressed by all of this;
As you know the PSP is still not able to read Ipod MP4 movie because the stream is coded CAVLC and not CABAC ... this is really stupid from Sony to limit the decoding software.

Based on this work, is there any chance to enable CAVLC video stream decoding?

keep continuing such a good job, tis will probably enforce Sony to open there firmware one day or another:)


ok

if you want decode baseline profile avc, call sceMeBootStart(4) before sceMpegInit
decode main profile avc, call sceMeBootStart(3) before sceMpegInit
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Feb 06, 2009 8:15 am    Post subject: Reply with quote

Does that affect the supported resolutions as well?
Back to top
View user's profile Send private message AIM Address
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Fri Feb 06, 2009 11:23 am    Post subject: Reply with quote

J.F. wrote:
Does that affect the supported resolutions as well?


still <=480*272

but I will continue to find out how to decode 480P . :P
Back to top
View user's profile Send private message
victorprosa



Joined: 14 Jan 2009
Posts: 38

PostPosted: Sat Feb 07, 2009 11:39 am    Post subject: Reply with quote

cooleyes

Can you re-upload the full pack, with the libs, etc, because the link has expired :(
Back to top
View user's profile Send private message Send e-mail
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Sat Feb 07, 2009 9:02 pm    Post subject: Reply with quote

victorprosa wrote:
cooleyes

Can you re-upload the full pack, with the libs, etc, because the link has expired :(


sorry , this sample code source, I had deleted. :(
but you can find the code from PPA project

http://pmplayer-advance.googlecode.com
Back to top
View user's profile Send private message
victorprosa



Joined: 14 Jan 2009
Posts: 38

PostPosted: Sun Feb 08, 2009 2:15 am    Post subject: Reply with quote

i found the "pspmpeg" and the "mem64" libs, but no "mp4ff" lib, do someone has this lib, or maybe, knows it as an other name?
Back to top
View user's profile Send private message Send e-mail
cooleyes



Joined: 18 May 2006
Posts: 125

PostPosted: Sun Feb 08, 2009 1:37 pm    Post subject: Reply with quote

victorprosa wrote:
i found the "pspmpeg" and the "mem64" libs, but no "mp4ff" lib, do someone has this lib, or maybe, knows it as an other name?


ok, just wait a few days, I will post a new sample code
It can decode <=480*272 main profile avc,
it also can decode 480P main profile avc

:)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group