Log in

View Full Version : x264 and Sony PSP?


Pages : 1 2 [3] 4 5 6 7 8 9 10 11 12

Gimpi
8th December 2005, 19:08
I was having fits trying to figure out what I was doing wrong with this. I ended up figuring out that my PSP is very picky on the AAC encoder used. It finally worked when I used BeLight to convert the ripped audio track via AAC FAAC encoder engine with output sampling rate of 48000, and options of wrap aac stream in MP4 and profile LC. Hopefully this insight will help anyone with files that were locking up thier PSPs. My PSP firmware is 2.60 and it works fine.

I used this psp.bat:
start /belownormal /b /w x264.exe --progress --bitrate 384 --ref 2 --mixed-refs --bframes 16 --subme 7 --b-rdo --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --merange 64 --no-psnr --output video.264 psp.avs
start /belownormal /b /w MP4Box.exe -fps 29.97 -add video.264 audio.mp4
start /belownormal /b /w ATOMChanger.exe audio.mp4 MAQ10001.MP4 AtomAVC.ini

bond
8th December 2005, 20:21
start /belownormal /b /w MP4Box.exe -fps 29.97 -add video.264 audio.mp4why dont you encode directly to .mp4?

Gimpi
8th December 2005, 21:10
why dont you encode directly to .mp4?

Because I'm new to all this stuff and that was what finally worked for me? :) Any suggestions for improvement are welcomed. I'm still just learning.

quake74
12th December 2005, 10:15
I used this psp.bat:
start /belownormal /b /w x264.exe --progress --bitrate 384 --ref 2 --mixed-refs --bframes 16 --subme 7 --b-rdo --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --merange 64 --no-psnr --output video.264 psp.avs
start /belownormal /b /w MP4Box.exe -fps 29.97 -add video.264 audio.mp4
start /belownormal /b /w ATOMChanger.exe audio.mp4 MAQ10001.MP4 AtomAVC.ini
The one problem I see is that --bframes 16, try put 2 or 3. Actually, I tried with 4 and it works too, but seeing 4 bframes in a row is a rarity, and 16... well...
You could use the sharktooth profies, at least to start experimenting, for megui (which gives you an integrated gui) at http://forum.doom9.org/showthread.php?t=101813

damrod
13th December 2005, 23:57
btw add this last line

ffmpeg.exe -an -y -t 0:0:0.005 -i psp.avs -f image2 -s 160x120 MAQ10001.THM

for a psp thumbnail ;-)))

make sure to choose the rigth frame to export ... (-t 0:0:0.005 is timeset... ) ...


for me i follow these steps :

- make avs with resizing (16/9 - 4/3 - 2.35)
- extract audio as wave
- encode wave to lc-aac via faac (not sure he-aac is supported)
- encode video to mp4 via x264.exe
- mux aac and mp4 into new mp4 via mp4muxer.exe
- change header of mp4 with atomchanger.exe
- generate thumbnails

i make a little soft to use it since i want to make also mpeg4-asp mp4 ;)

ffmpeg can directly make audio/video mp4 files with lc-aac and xvid as codec...and can resize also so i wonder if it can encode using h264 codec...there's still the problem to update h264 encoder when using fffmpeg ;-)

Chris Benoit
15th December 2005, 18:13
Ok guys i will need your help in this one.I'm new to avc encoding.I have a psp and i'm not satisfied with tha asp mp4 so i guess i'll have to start tsting some avc ones.

What programms will i need,and what settings to get me started?

Sharktooth
15th December 2005, 18:30
:search:

Chris Benoit
15th December 2005, 18:35
Well there are a lot of things written here in this topic which i do not comprehend so i would like someone to give some more specific instructions,in baby steps so do speak.

EDIT:I did a little searching.Is MEGUI the one i should use?What bitrate do you guys use for avc,and is there a way to put subtitles?

Hyper Shinchan
16th December 2005, 17:52
Well, you need Atom changer (included in this link http://www.x264.nl/psp/x264-psp.exe) and then you have to hack your MP4 with this tool (you can use it with commandline or editing the batch, I prefer to use it with command line).
About the settings I use almost all the Main Profile L3 features excluding Pyramid B-frame and I set 2 B and 2 Reference frames (but you can rise B frames lowering Reference and viceversa, but I'm not sure about it). For the bitrate I suggest something like 300kbps or 400kbps but AVC is really powerful and with anime contents you can use really low bitrate (I don't know about movies because I watch only anime).
Anyway that .exe include a batch with low settings that you can modife as you wish, i think that it's good for a newbbie.Or you can use 3GPP Converter, but it's not so good, imo, also if it uses X264 libraries with FFMPEG.
C'ya.
EDIT: keep in mind that your AAC must be 48 khz and your video frame rate 29.97 fps, but maybe you've noticed it.

damrod
17th December 2005, 08:50
if the aac is not 48khz (44,1 for exemple) can i have problems with audio sync??

because i have probleme of a/v sync ;-)

i will check the freq of my vids....

Chris Benoit
17th December 2005, 13:12
What do the options "me esa --merange 64" that have been mentioned do?

qyqgpower
17th December 2005, 13:59
with 2.6 firmware you can play 24fps(and 23.98 etc.) AVC now. just use x264 bundled ffmpeg to encode a 24fps clip and give a try.
if you use x264 or ND to create a 24fps clip and go through psp video 9's atomchanger to get a psp-playable AVC, you need edit 0x00A0~0x00A7 to 00 17 F9 DC 00 17 F9 DC to get a sync clip.

so I have compiled an atomchanger which won't fix FPS to 29.97 but depends on the input file's FPS.
Use this INI file with this atomchanger:

[Config]
Title=PSP/AVC:FPS Depends on Input File
MQV=2

[DeleteAtom]
Item0=ftyp
Item1=udta
Item2=free
Item3=drm%20

[InsertAtom]
Item0=ftypMSNV%01%00%07%86MSNVmp42isom
Item1=/moov/trak/edts%00%00%00%1Celst%00%00%00%00%00%00%00%01%00%7E%31%B6%00%00%00%00%00%01%00%00

Chris Benoit
17th December 2005, 18:09
What settings do you use for audio guys?CBR or VBR,and what bitrate?

zshadow
17th December 2005, 18:23
edit: got it working

a3217055
19th December 2005, 09:15
I have been reading through this discussion for some time and I have had some problems.
#All this happened under Linux #
I have been able to make PSP videos using ffmpeg on my PSP Fimware 1.51. But after upgrading to Firmware 2.0 I have not been able to do any of that. How do i encode videoes under ffmpeg or anyother application under Linux to play on my PSP with firmware 2.00.
I have been playing around with ffmpeg and I compiled as such.

./configure --enable-mp3lame --enable-faac --enable-faad --enable-amr_nb --enable-amr_wb --disable-ffplay --enable-small --enable-memalign-hack --enable-gpl --enable-xvid --enable-dts --enable-a52 --disable-vhook --enable-x264 --enable-pthreads

And when I encode a video in h264 format

fmpeg -i SOME.avi -b 384 -vcodec h264 -acodec aac -ac 2 -ar 48000 -ab 48 -vol 256 -f psp -r 29.97 -s 320x240 -bufsize 256 -g 250 -coder 1 ~/M4V00022.MP4

#Please note I got this cmd line from the pspvideo9 debug console output.

The psp cannot read it. It says the file cannot be played.

Is there anyway to make video into PSP format with out running on PSPvideo9 under windows?

I personally think the PSP firmware is being very picky in looking at the files and seeing if it is not compliant it will drop the file.

So in short does anyone have any ideas how to convert an xvid avi file into a PSP MP4; with AVC encoding ; under linux. Or do I just need to upgrade my firmware?

Doom9
19th December 2005, 12:51
with 2.6 firmware you can play 24fps(and 23.98 etc.) AVC now. just use x264 bundled ffmpeg to encode a 24fps clip and give a try.What about 25 fps? Rather important for us PAL folks.

quake74
19th December 2005, 15:16
I have been reading through this discussion for some time and I have had some problems.
#All this happened under Linux #
I have been able to make PSP videos using ffmpeg on my PSP Fimware 1.51. But after upgrading to Firmware 2.0 I have not been able to do any of that. How do i encode videoes under ffmpeg or anyother application under Linux to play on my PSP with firmware 2.00.


It seems that with 2.0 the format changed slightly. I have a link http://article.gmane.org/gmane.comp.video.ffmpeg.devel/25043/
I checked last week and this patch was not in CVS yet, but don't know anything else. Good luck!

Clown shoes
19th December 2005, 16:31
What about 25 fps? Rather important for us PAL folks.

Ah, this is great news though, because at least we can use slow down and no nasty duplicated frames. Hurrah!

Has anyone else tested this yet?

damrod
19th December 2005, 20:45
M4V00022.MP4

the h264 mp4 files for psp are named MAQ00022.MP4

M4V is for mpeg4 asp

more : you can't put them in the same directory

some help (in french sorry)
http://geekitude.over-blog.com/

btw i have some problem : when i encode the same file with ffmpeg and x264 in h264 format @500kbits i get different files : ffdshow says x264 file has abr=500...ffmpeg abr is around 1000-1200...it's weird because the files are not of the same size so it must be true...

for info : my psp has 2.5 firmware...

nrx][Natas
20th December 2005, 15:47
What about 25 fps? Rather important for us PAL folks.

Good question. I encoded an episode of scrubs at 25 fps with x264 MeGUI and used the modified AtomChanger and the movie is out of sync. Perhaps I did something wrong or it doesn't work with 25 fps videos.

Clown shoes
20th December 2005, 15:51
@nrx][Natas

How is your speed issue going? I know you were having the same problems I was?

I think the modified atomchanger is only for 23.976. Has anyone seen it working yet?

nrx][Natas
20th December 2005, 16:13
@nrx][Natas

How is your speed issue going? I know you were having the same problems I was?


The speed issue is solved. A complete reinstallation of MeGui and x264 was the solution. :)

@nrx][Natas

I think the modified atomchanger is only for 23.976. Has anyone seen it working yet?

Now I want to test the "slow down" thing you mentioned. I never used it before. Can I use ChangeFPS as well or is there another Avisynth filter?

Clown shoes
20th December 2005, 16:21
[Natas']The speed issue is solved. A complete reinstallation of MeGui and x264 was the solution. :) .

Really?? I have tried reinstalling several times with several builds of MeGUI and X264! Can you confirm you are encoding large feature length files to .MP4 and not .264. There is an entire thread covering this right now.

http://forum.doom9.org/showthread.php?t=104262

Can you tell me which versions of things you are using, also any scripts you are using? If you have the time that is. Thanks

nrx][Natas
20th December 2005, 17:44
Really?? I have tried reinstalling several times with several builds of MeGUI and X264! Can you confirm you are encoding large feature length files to .MP4 and not .264. There is an entire thread covering this right now.

http://forum.doom9.org/showthread.php?t=104262

Can you tell me which versions of things you are using, also any scripts you are using? If you have the time that is. Thanks

Yes, everytime before I update I uninstall MeGUI and x264. I only convert PAL 25 FPS DVDs (mpeg2source) to MP4/264. Normaly I encode directly to 264. If i forget to switch and i get an MP4 file, i extract the video. In the end i always have an 264 file.

I uses this line to demux the video "mp4box.exe -raw 1 Video.mp4"

Versions:
GKnot: latest available to create an avs file
AviSynth: 2.5.6
MeGUI: latest version
x264: latest version

Before i encode a new movie i always look if there is a new build of Sharktooths Full x264 package.

Cleaned GKnot avs:
# PLUGINS
LoadPlugin("D:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")
LoadPlugin("D:\PROGRA~1\GORDIA~1\AviSynthPlugins\UnDot.dll")

# SOURCE
mpeg2source("E:\Movies\DVD\video.d2v")

# CROPPING
crop(10,2,702,568)

# RESIZING
LanczosResize(368,208)
ChangeFPS(29.97)

# DENOISING: choose one combination (or none)
Undot()
MeGUI Commandline
"x264.exe" --pass 2 --bitrate 220 --stats ".stats" --ref 2 --mixed-refs --bframes 4 --subme 7 --b-rdo --weightb --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "" ""
demux.cmd
mp4box.exe -raw 1 Sound.mp4
mp4box.exe -raw 1 Video.mp4
mux.cmd
start /belownormal /b /w MP4Box.exe -fps 29.97 -add video.264 "Scrubs.-.S01E01.mp4"
start /belownormal /b /w MP4Box.exe -add "sound.aac" "Scrubs.-.S01E01.mp4"

start /belownormal /b /w ATOMChanger.exe "Scrubs.-.S01E01.mp4" MAQ30008.MP4 AtomAVC.ini
AtomAVC.ini
[Config]
Title=PSP MPEG-4 AVC
MQV=2
CODEC=2

[DeleteAtom]
Item0=ftyp
Item1=free

[InsertAtom]
Item0=ftypMSNV%01%00%07%86MSNVmp42isom
Item1=/moov/trak/edts%00%00%00%1Celst%00%00%00%00%00%00%00%01%00%7E%31%B6%00%00%00%00%00%01%00%00

I hope it helps :)

bond
20th December 2005, 18:01
the slow down happens with strange framerates (normally used in .avi sources)

pal dvd sources have nice 25 fps, so they dont cause a problem

Clown shoes
20th December 2005, 18:16
The reason I asked him was several days ago he mentioned the same problem of progressivly slower encodes on the second pass!

Sharktooth
20th December 2005, 18:30
let's talk about PSP and keep the slowdown in the proper thread please.

damrod
20th December 2005, 21:58
i think as usual sony doesn't care about europe users :-(...always ntsc for japan and usa....

Clown shoes
21st December 2005, 01:20
I have tested the new atom changer and it works perfectly on 2.60. We can now play 23.976 progressive video. This is a real breakthrough! Proper smooth movies at last. Hooray. :)

qyqgpower
21st December 2005, 02:43
[Natas']Good question. I encoded an episode of scrubs at 25 fps with x264 MeGUI and used the modified AtomChanger and the movie is out of sync. Perhaps I did something wrong or it doesn't work with 25 fps videos.
this atomchanger will write the fps flag according to the input file, so it will work with any file in any fps. but since 2.6 psp only supports 15, 24, 23.98, 23.976, 29.97 and 30 fps, of course you can not get a sync 25 fps playback.

nrx][Natas
21st December 2005, 10:57
this atomchanger will write the fps flag according to the input file, so it will work with any file in any fps. but since 2.6 psp only supports 15, 24, 23.98, 23.976, 29.97 and 30 fps, of course you can not get a sync 25 fps playback.

Ok i have 2.60 but didn't know what framerates are supported now. I can life with 24 fps, too. Better than 29.97. Can i use ChangeFPS for this or is there are different/better Avisynth filter?

:thanks:

Clown shoes
21st December 2005, 13:15
I am having a strange new error playing .avcs on my PSP. If I exit to the main screen or allow the PSP to go into stand by mode. I am unable to contine playing the .avc. All I get is a black screen. The only way to play it again is to reset the PSP and fast forward to where I was last watching! Also if i try using the go to function, it completely freezes the PSP and once again I must reset. I used to encode .avcs with PSPVideo9 and they did not have this problem. My current process is avi-MeGui-MP4Box-Atomchanger. Any ideas what the problem might be?

I am running PSP software version 2.60

Doom9
21st December 2005, 14:42
Bah, first it's "can't play AVC from memorystick", then it's "only plays AVC at a limited framerate", now it's "only plays AVC at NTSC framerates", but the PSP has no problem playing full resolution AVC at higher bitrates (http://www.engadget.com/2005/11/30/psps-2-60-firmware-does-480-x-270-video/#comments) and I suspect that supporting 25 fps is also only a political question, but what do you expect from a company that takes over your computer?

nrx][Natas
21st December 2005, 15:36
@Clown shoes: I'll test it when I'm home. But for now I only have "old" 29.97 FPS Atomchanger movies :)

@Doom9: Hehe, you are right but i think there is still hope :D

Clown shoes
21st December 2005, 16:55
To be fair it is getting better. 23.976fps is a god send. The problem I'm having right now isn't resolution dependant though! Any avc's I am putting on the PSP are reacting in the same way. This is definately a new thing though and I don't know whether the problem is with the new firmware 2.60, or with the encoding process. When I get home I will try encoding an avc with PSPVideo9 and see what happens. In the meantime, could someone who has the 2.60 firmware just check whether they are able to come out of the movie and then back in to it succesfully?

nrx][Natas
21st December 2005, 19:09
@Clown shoes: Your are right. There is a new problem. I have 7 Chappelles Show and one Futurama episode on my PSP. This is what i did:

1. Starting Futurama
2. Exit with O
3. Start again

= Futurama starts from last position

------

1. Starting Futurama
2. Exit with O
3. Selecting an Chappelle Episode (not playing!)
4. Switching back to Futurama
5. Start again

= Futurama doesn't start (black screen)

--------

1. Starting Chappelle
2. Exit with O
3. Start again

= Futurama doesn't start (black screen)

--------

1. Starting Chappelle
2. Exit with O
3. Selecting and stating another Chappelle Episode

= New Chappelle Episode starts

4. Switching back to last episode

= Starts again from the beginning



Futurama filename: MAQ30001.MP4
Chappelle Filename: MAQ40001.MP4 - MAQ40007.MP4

Perhaps the behavior (starting or not starting) has something to do with the filename? My encodes are a little older. Tomorrow i'll encode a new movie.

Clown shoes
21st December 2005, 19:15
Hmm, interesting. Some times they did, some times they didn't. Did you say you were running 2.60? And could you tell me your encoding process?

nrx][Natas
21st December 2005, 21:12
Yes, and i'm running 2.60.

Right now i'm preparing The movie Wasabi for tomorrow.

1. encoding audio with "original" MeGUI" NAAC 80 kbps CBR
2. encoding movie to raw with sharktooth latest build of his x264 Fullpackage (x264 MeGUI)

"x264.exe" --pass 2 --bitrate 220 --stats ".stats" --ref 2 --mixed-refs --bframes 3 --subme 7 --b-rdo --weightb --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "" ""

3. creating a raw audio file (aac) from my mp4 file
4. mux video and audio
5. atomchanger

And this will be my fist 24 FPS movie...i hope *g*

Doom9
21st December 2005, 21:16
May I ask what this step is for: 3. creating a raw audio file (aac) from my mp4 file ? It's no problem muxing an MP4 containing AAC with an MP4 file containing AVC video (or ASP)

nrx][Natas
21st December 2005, 21:26
May I ask what this step is for: ? It's no problem muxing an MP4 containing AAC with an MP4 file containing AVC video (or ASP)

Oh okay. Wasn't sure about it and during my first PSP experiments it didn't always work as planed. So someday I ended with this, muxing only raw files. :)

I'll change it. :)

qyqgpower
22nd December 2005, 02:53
to the "can't resume/jump to problem":
it only happens on 2.6 psp,use only these settings for ref and bframe:
1ref + 1bframe
2ref without bframe
3ref without bframe

all other settings will cause "can't resume/jump to problem".
the reason is 2.6 have changed some methods in these function. in previuos version you can only resume/jump-to at the nearest I frame, but in 2.6 you can resume/jump-to at any frame. so a new bug in decoding multiple bframes clip have occured. hope will fix it in future version.

nrx][Natas
22nd December 2005, 07:30
That makes sense. But how do you know all that stuff? Weren't you the one how reported the 24 FPS thing? ;) Anyway, good to know.

I have tested the new atom changer and it works perfectly on 2.60. We can now play 23.976 progressive video. This is a real breakthrough! Proper smooth movies at last. Hooray. :)

Yes it works. But how do I get it smooth? I used ChangeFPS to get it from 25 fps to 23.976 fps. I have ghost effects an it isn't smooth. :(

deets
24th December 2005, 00:55
hmm, i am having no joy when i use the x264 PSP profile and meGUI.

I mux my 264 video and mp4 audio into an mp4, do the atomchanger thing, upload and yet the psp says the video cannot be displayed.

if i do the same process, but use my cli one pass created video then all works just fine.

has anyone had any success with the psp profile in x264?

Clown shoes
24th December 2005, 14:51
check your PMs Deets

@Nrx][Natas

I do my slow down in VDub when I extract my audio.

I think you can do assumefps(23.976) instead of changefps(). Someone correct me if I'm wrong though.

nrx][Natas
25th December 2005, 16:15
@Clown shoes: Thanks! I'll test it.

qyqgpower
25th December 2005, 16:57
assumefps will change playback speed, and of course will out of sync.
i think changefps won't cause ghost effects(convertfps does), it only deletes or duplicates frames, it is recommended for anime. convertfps is recommended for real life footages.

Clown shoes
26th December 2005, 02:31
The best way to go from 25fps to 23.976fps is by slowing down as you do not make any alteration to the frames themselves. Both Besweet and Belight have a simple tick box to convert audio from 25fps to 23.976fps. If you are genuinely into upmost picture quality (and who isn't) then this has to be the only option. Try it. I don't think you will be dissapointed.

nrx][Natas
26th December 2005, 10:28
Hi,

that's exactly what I do right now. AssumeFPS and BeSweet for Audio. Yesterday I tested ChangeFPS and ConvertFPS. Ghost effect or not, the video doesn't play smooth. :)

:thanks:

deets
27th December 2005, 20:21
weird locking up problem....

i dont just get videos that say cant be played, i get some that dont give the message and the screen goes black and the only way to get the psp back is to tak out the battery...

heres the megui log of a test i just did:

"C:\Program Files\x264\x264.exe" --bitrate 220 --keyint 300 --ref 2 --bframes 3 --subme 7 --weightb --analyse p8x8,b8x8,i4x4,p4x4 --qpstep 1 --me esa --threads 2 --progress --no-psnr --output "C:\psp\psp.264" "C:\psp\psp.avs"

mux it using the same mux bat i use for all other clips, but the clip causes a hard lock up...

also, i say 1 thread in megui but it always puts 2 anyway

Doom9
27th December 2005, 20:29
also, i say 1 thread in megui but it always puts 2 anywayIf you go to the settings, is "Automatically set number of threads" checked? If it is, then you either have an X2, Pentium D or HyperThreadig capable CPU.

--me esaPlease don't use that unless you're running a contest of which AVC encoder is the slowest.

And why the low bitrate? the PSP ought to be able to handle higher bitrates, does it not?

Even though I have a PSP (recently flashed to the 2.60 firmware even.. but that's the only thing I've done with it since the day I got it) I can't help with your problems.