PMP Mod v2.02 & PMP Mod AVC v1.02
@digihoe:
it's interesting, i need to verify if an eventual inclusion is technically possible
@mystic_memories:
the part that should write the informations is located in muxers.c (search for "jonny 2006-06-09", after patching)
i don't have idea of why the file is empty (maybe under linux a slightly different execution path is taken)
any suggestion is welcome (i'm not able to check in a linux box atm)
anyway, the howto specify width/height/fps manually (so, you don't need this file)
@mmick:
the sentence Raphael quoted is quite offensive.
personally, i don't need the type of feedback you can offer.
if you think you have something additional to say to me or Raphael, use PMs.
it's interesting, i need to verify if an eventual inclusion is technically possible
@mystic_memories:
the part that should write the informations is located in muxers.c (search for "jonny 2006-06-09", after patching)
i don't have idea of why the file is empty (maybe under linux a slightly different execution path is taken)
any suggestion is welcome (i'm not able to check in a linux box atm)
anyway, the howto specify width/height/fps manually (so, you don't need this file)
@mmick:
the sentence Raphael quoted is quite offensive.
personally, i don't need the type of feedback you can offer.
if you think you have something additional to say to me or Raphael, use PMs.
First, more reverse in the vsh music_plugin is needed :)digihoe wrote:jonny, do you see any possibilities to use hardware MP3 decoding (as mention here: http://forums.ps2dev.org/viewtopic.php? ... c0d8922883 ) in the future in combination with AVC in a PMP container?
Best regards!
Some more modules need to be loaded, i don't know yet which ones, but it won't difficult to find. (this also means that it won't be possible to be used in 2.01+)
@ils:
not in the near future.
anyway, if your problem is mainly seek speed, pressing X while you seek will make everything a lot faster (probably in 5 seconds you can navigate an entire 2h movie)
@moonlight:
supposing it's possible, that would go probably only on the avc version (so only 1.5 anyway :)
not in the near future.
anyway, if your problem is mainly seek speed, pressing X while you seek will make everything a lot faster (probably in 5 seconds you can navigate an entire 2h movie)
@moonlight:
supposing it's possible, that would go probably only on the avc version (so only 1.5 anyway :)
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
Hehe, you might think it should be that 2.01+ is slowly catching up to 1.5 with all the new stuff Sony put in, but actually it's the other way :) Using 1.5 gets more and more advantages with time.moonlight wrote: Some more modules need to be loaded, i don't know yet which ones, but it won't difficult to find. (this also means that it won't be possible to be used in 2.01+)
Great job there by you guys :)
The following patch will fill .264.txt file when using yuv4mpeg input. I'm not completely sure if that is the correct code (as original one uses some values from AVI header). Insert this fragment at muxers.c:240
The final code should looks like:
Edit: Fixed few bits.
Code: Select all
if (info_filename_handle != 0)
{
fprintf (info_filename_handle,
"width=%i\nheight=%i\nscale=%i\nrate=%i",
p_param->i_width, p_param->i_height,
(int) 1000, (int) ((p_param->i_fps_num * 100.0) /
p_param->i_fps_den + 0.9) * 10);
fclose (info_filename_handle);
info_filename_handle = 0;
}
Code: Select all
fprintf(stderr, "yuv4mpeg: %ix%i@%i/%ifps, %i:%i\n",
h->width, h->height, p_param->i_fps_num, p_param->i_fps_den,
p_param->vui.i_sar_width, p_param->vui.i_sar_height);
if (info_filename_handle != 0)
{
fprintf (info_filename_handle,
"width=%i\nheight=%i\nscale=%i\nrate=%i",
p_param->i_width, p_param->i_height,
(int) 1000, (int) ((p_param->i_fps_num * 100.0) /
p_param->i_fps_den + 0.9) * 10);
fclose (info_filename_handle);
info_filename_handle = 0;
}
*p_handle = (hnd_t)h;
return 0;
}
Last edited by 606u on Tue Jun 27, 2006 1:46 am, edited 1 time in total.
Thanks. I just encoded the new 15min MGS4 trailer at 1200kbps(136MB) and it totally rocks the socks off of anything I've previously seen on PSP. ZOMG, Thanks to jonny for the AVC improvements! The framerate didn't stutter for a millisecond :)optimus wrote:Simply update the PSP plug-in will make it work. Get it here and put the dev_psp.dll in MediaCoder's plugins folder.
PS: Is there anyway to findout/calculate the finished size(in megabytes) of the file being encoded into AVC? That would certainly help a lot of us with only 1GB memsticks!
Checkout the MGS4 trailers Raiden Fight on your PSP :)
http://www.savefile.com/files/4805248
:)
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
Thanks for the code, it looks good (at rendering time).. I'll try it out tonight after it's finished rendering. (slow PC...)
606u wrote:The following patch will fill .264.txt file when using yuv4mpeg input. I'm not completely sure if that is the correct code (as original one uses some values from AVI header). Insert this fragment at muxers.c:240The final code should looks like:Code: Select all
if (info_filename_handle != 0) { fprintf (info_filename_handle, "width=%i\nheight=%i\nscale=%i\nrate=%i", p_param->i_width, p_param->i_height, (int) 1000, (int) ((p_param->i_fps_num * 100.0) / p_param->i_fps_den + 0.9) * 10); fclose (info_filename_handle); info_filename_handle = 0; }
Edit: Fixed few bits.Code: Select all
fprintf(stderr, "yuv4mpeg: %ix%i@%i/%ifps, %i:%i\n", h->width, h->height, p_param->i_fps_num, p_param->i_fps_den, p_param->vui.i_sar_width, p_param->vui.i_sar_height); if (info_filename_handle != 0) { fprintf (info_filename_handle, "width=%i\nheight=%i\nscale=%i\nrate=%i", p_param->i_width, p_param->i_height, (int) 1000, (int) ((p_param->i_fps_num * 100.0) / p_param->i_fps_den + 0.9) * 10); fclose (info_filename_handle); info_filename_handle = 0; } *p_handle = (hnd_t)h; return 0; }
thanks 606u
a little semplification:
it's better to keep the values intact (in some particular cases your prev code could generate av desync due to some precision lost)
now you can skip -w -h -s -r :)
a little semplification:
Code: Select all
fprintf (info_filename_handle,
"width=%i\nheight=%i\nscale=%i\nrate=%i",
p_param->i_width, p_param->i_height,
p_param->i_fps_den, p_param->i_fps_num);
now you can skip -w -h -s -r :)
Thanks, jonny. Here is a new version of Linux convertion script that will try to preserve the aspect ratio of AVI-files when downscaling:
Code: Select all
#!/bin/sh
die ()
{
echo "$1"
exit 1
}
[ -n "$1" -a -n "$2" ] || die "Usage: $0 in.avi out"
[ ! -f "$1" ] && die "$1: not found"
[ -f "$2.264" ] && die "$2.264: already exists"
[ -f "$2.mp3" ] && die "$2.mp3: already exists"
[ -f "$2.pmp" ] && die "$2.pmp: already exists"
multiple_of_16 ()
{ # scale value to multiple of 16; 1: value, 2: max
low=`expr $1 - \( $1 % 16 \)`
high=`expr $low + 16`
if [ $high -le $2 ] ; then
low_diff=`expr $1 - $low`
high_diff=`expr $high - $1`
if [ $low_diff -le $high_diff ] ; then
echo $low
else
echo $high
fi
else
echo $low
fi
}
scale ()
{ # scale up to 480 x 272, output to WIDTH/HEIGHT; 1: width, 2: height
width=$1
height=$2
scale=`expr $width \* 10000 / $height`
if [ $scale -ge 17647 ] ; then # 480 / 272 = 1,7647
WIDTH=480
HEIGHT=`expr $WIDTH \* 10000 / $scale`
HEIGHT=`multiple_of_16 $HEIGHT 272`
else
HEIGHT=272
WIDTH=`expr $HEIGHT \* $scale / 10000`
WIDTH=`multiple_of_16 $WIDTH 480`
fi
}
WIDTH=480
HEIGHT=272
avi_info=`file -b "$1" | grep 'RIFF ' | grep ', AVI, '`
if [ -n "$avi_info" ] ; then
# in.avi: RIFF (little-endian) data, AVI, 704 x 400, 23.98 fps, \
# video: XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
check_2=`echo "$avi_info" | cut -d, -f2`
if [ "$check_2" == " AVI" ] ; then
width_x_height=`echo "$avi_info" | cut -d, -f3`
width=`echo "$width_x_height" | cut -dx -f1`
height=`echo "$width_x_height" | cut -dx -f2`
scale $width $height
echo "$width x $height => $WIDTH x $HEIGHT"
fi
fi
H264CRF=24 # up to 51; 18 == XviD' Qf 2
PIPE=/tmp/pipe.y4m
rm -f $PIPE
mkfifo $PIPE || exit 1
mplayer -benchmark -nosound -quiet -really-quiet \
-vo yuv4mpeg:file=$PIPE -vf scale=$WIDTH:$HEIGHT "$1" &
x264 --crf $H264CRF -A all --level 3 --pictiming --aud --no-psnr \
--thread-input --output "$2.264" $PIPE
mencoder -quiet -really-quiet "$1" -srate 44100 -oac mp3lame \
-lameopts vol=0:mode=0:cbr:br=112 -ovc copy -of rawaudio -o "$2.mp3"
pmp_muxer_avc -v "$2.264" -a "$2.mp3" -o "$2.pmp"
# remove temporary files
# rm -f "$2.264" "$2.264.txt" "$2.mp3" "$2.pmp.log"
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
I'm current using the following call to perform the encoding, and I'm experiencing some sync issues. It's not as bad with small flicks, but as the video gets bigger (~25mins), it goes to upwards of 43 seconds. From reading the thread, I have a feeling it could be solved by the "harddup" option in mplayer. But the harddup option only works with mencoder and not mplayer (according to the man pages). Anyone have any ideas how this can be fixed? Thanks!
Code: Select all
mplayer -benchmark -nosound -quiet -really-quiet \
-vo yuv4mpeg:file=${PIPE} \
-fps ${RATE}/${SCALE} \
-vf ${CROP}scale=${TARGET_WIDTH}:${TARGET_HEIGHT},expand=::::::16,harddup \
"${infile}" &
x264 --crf ${H264CRF} -A all --level 3 --pictiming --aud --no-psnr \
--thread-input --output "${infile}.264" ${PIPE}
mencoder -quiet -really-quiet "${infile}" -srate 44100 -oac mp3lame \
-af channels=2,resample=44100:0:2 -lameopts vol=0:mode=0:cbr:br=128 \
-ovc copy -of rawaudio -o "${infile}.mp3"
#uses the .txt file for input params.
pmp_muxer_avc.pl -v "${infile}.264" -a "${infile}.mp3" -o "${infile}.pm
you should try to verify:
1) length in seconds of ${infile}
2) length in seconds of ${infile}.264 (you can derive this using rate, scale and the number of frames found by the muxer)
3) length in seconds of ${infile}.mp3
4) also, if you have enough disk space, length in seconds of the raw yuv4 file (i don't have idea about how this can be derived)
you could also try to compile mencoder with the modified x264 (and use the command line suggested by cooleyes some pages ago)
it would be really strange if mplayer doesn't output duplicate frames also when the output is raw data (actually the need to use harddup to avoid "0 bytes frames" is probably something i'll never understand :)
EDIT: i assume you are also using this:
1) length in seconds of ${infile}
2) length in seconds of ${infile}.264 (you can derive this using rate, scale and the number of frames found by the muxer)
3) length in seconds of ${infile}.mp3
4) also, if you have enough disk space, length in seconds of the raw yuv4 file (i don't have idea about how this can be derived)
you could also try to compile mencoder with the modified x264 (and use the command line suggested by cooleyes some pages ago)
it would be really strange if mplayer doesn't output duplicate frames also when the output is raw data (actually the need to use harddup to avoid "0 bytes frames" is probably something i'll never understand :)
EDIT: i assume you are also using this:
Code: Select all
fprintf (info_filename_handle,
"width=%i\nheight=%i\nscale=%i\nrate=%i",
p_param->i_width, p_param->i_height,
p_param->i_fps_den, p_param->i_fps_num);
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
@jonny
Thanks for the tip. My findings are as follows:
1) Original Video (min:sec): 46:46
2) Extracted MP3: 46:46
3) {infile}.264: Going from the 55795 which I think is the number of frames. I get 46:30 which is about 16 seconds difference there. A snipplet of the output from the muxer is as follows:
Really seems like mplayer is trying to be smart and skipping some frames. Can't find any useful flags to set to force it to output all frames either. Short of patching mplayer, does anyone have any other ideas how this can be solved?
Thanks for the tip. My findings are as follows:
1) Original Video (min:sec): 46:46
2) Extracted MP3: 46:46
3) {infile}.264: Going from the 55795 which I think is the number of frames. I get 46:30 which is about 16 seconds difference there. A snipplet of the output from the muxer is as follows:
Code: Select all
05.rmvb.264:
Processing video ...
05.rmvb.264.txt found
width: 368
height: 272
scale: 1
rate: 20
55795
05.rmvb.mp3:
Processing audio ...
107427
resync_count = 0
unused_bytes = 0 / 44900101
first frame at 0
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
The -fps is derived from the comments from mplayer. I've noticed that sometimes the rate and scale are not properly passed to x264 if it's not defined that way. But I've also tried encoding without the explicit -fps and it still produces the exact number of frames as stated before.606u wrote:mystic_memories, have you tried with no -fps ${RATE}/${SCALE} option? In your pmp avc muxer output you've scale: 1, rate: 20 which is exactly 20 fps. Maybe there are rounding problems...? Doesn't it work fine if you do not specify frames-per-second explicitly?
-
- Posts: 12
- Joined: Sun Mar 12, 2006 8:27 am
I've tried encoding with encoder with the x264 function enabled, and it does provide me with the right number of frames. But I think I'm missing some important changes in mencoder/x264, since the resultant pmp file is not playable from the PSP... (invalid format error). I would be very interested to know what changes cooleyes made to make mencoder work for pmp. :)
"pmp_file_open: invalid video format" ?
are you using this muxer:
http://jonny.leffe.dnsalias.com/pmp_mod ... source.rar
?
(i assume you are also passing to it an avi file)
EDIT:
i also assume you are using this player:
http://jonny.leffe.dnsalias.com/pmp_mod ... c_1_02.rar
this x264 with both patches (magiK patch first):
http://jonny.leffe.dnsalias.com/pmp_mod ... source.rar
and a command line similar to:
mencoder -nosound -ovc x264 -x264encopts bitrate=512 -vf scale=480:272,harddup -o test.avi 1.avi
are you using this muxer:
http://jonny.leffe.dnsalias.com/pmp_mod ... source.rar
?
(i assume you are also passing to it an avi file)
EDIT:
i also assume you are using this player:
http://jonny.leffe.dnsalias.com/pmp_mod ... c_1_02.rar
this x264 with both patches (magiK patch first):
http://jonny.leffe.dnsalias.com/pmp_mod ... source.rar
and a command line similar to:
mencoder -nosound -ovc x264 -x264encopts bitrate=512 -vf scale=480:272,harddup -o test.avi 1.avi
Re: hello
http://rapidshare.de/files/23885627/men ... d.rar.htmlpegasus wrote:hi cooleyes would you mind uploading your patched mencoder??
i get 10-15fps on x264 and its slow (1200mhz)
but in mencoder i can get as much as 40fps..
tnx if u dont mind..
for P3:
http://rapidshare.de/files/23955930/men ... 3.rar.html
for P4:
http://rapidshare.de/files/23956385/men ... 4.rar.html
for K7:
http://rapidshare.de/files/23956710/men ... 7.rar.html
I have made a player "CoolPlayer" , it is a music player, it can play APE, FLAC, WV.jonny wrote:it's in my todo list, but have a low priority (compared to mp3, aac have a larger number of samples per frame / this gives some complications in the current player structure)
FLAC also have large number of sample per frame, but it can play well in PSP.
so I think support AAC is easy, :P