PDA

View Full Version : PSP Video encode using Megui and X264


Drillakilla
7th February 2006, 04:10
i need some help guys and iv been told this is the place to ask. Iv been bashing my head into a wall using the above apps,

i started using the more commercial psp video apps but the quality was crap, then on another forum someone mentioned x264 using Megui.
Iv got all the programs i need ( mp4 box, besweet etc).


I can encode automated two pass and i get an mp4 file, the problem is whenever i try and encode 2 pass 2nd pass i get a okb mp4 file ( the encode is instant), whenever i try 2 pass 1st pass i get a .stats file ( the file size seems fine) but no mp4

i cant work out what i am doing wrong, i am really desperate to get this to work because iv heard the quality is excellent ( much better than the other psp apps)

below is more information on my encodes::



--------------------------------------------------------------------------------

My test video clip is 7 mb big and 7 seconds long

Heres my avs file i created for the encodes:

AviSource("D:\Mpegs\xvid movies\Test.avi",TRUE)
BlindPP(cpu=4)
Blockbuster(method="noise",detail_min=1,detail_max=3,variance=0.1,seed=1)
Convolution3D(1, 6, 12, 6, 8, 2.8, 0)
LanczosResize(368,208)
Undot()
TemporalSoften(2,7,7,3,2)
DCTFilter(1,1,1,1,1,1,0.5,0)
assumefps(29.00)

This is the command line i got, encoded at 2 Pass- 2nd Pass,
400 kbps


C:\Program Files\x264\x264.exe --pass 2 --bitrate 400 --stats ".
stats" --ref 2 --mixed-refs --bframes 3 --b-rdo
--weightb --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4
--sar 360:208 --progress --no-psnr --output
"D:\PSP Test script 360 208.mp4"
"D:\PSP Test script 360 208.avs"

and the Log

Next job job1 is a video job. encoder commandline:
--pass 2 --bitrate 400 --stats "D:\PSP Test script 360 208.stats" --ref 2 --mixed-refs --bframes 3 --b-rdo --weightb --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --sar 360:208 --progress --no-psnr --output "D:\hh.mp4" "D:\PSP Test script 360 208.avs"
successfully started encoding of job job1
job commandline: --pass 2 --bitrate 400 --stats "D:\PSP Test script 360 208.stats" --ref 2 --mixed-refs --bframes 3 --b-rdo --weightb --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --sar 360:208 --progress --no-psnr --output "D:\hh.mp4" "D:\PSP Test script 360 208.avs"
----------------------------------------------------------------------------------------------------------

Log for job job1

desired video bitrate of this job: 400 kbit/s - obtained video bitrate: 0 kbit/s
----------------------------------------------------------------------------------------------------------



Heres the command line for 2 pass 1st pass:

C:\Program Files\x264\x264.exe --pass 1 --bitrate 400 --stats ".stats" --bframes 3 --subme 1 --analyse none --me dia --sar 360:208 --progress --no-psnr --output NUL "D:\PSP Test script 360 208.avs"

and the log:

Next job job1 is a video job. encoder commandline:
--pass 1 --bitrate 400 --stats "D:\PSP Test script 360 208.stats" --bframes 3 --subme 1 --analyse none --me dia --sar 360:208 --progress --no-psnr --output NUL "D:\PSP Test script 360 208.avs"
successfully started encoding of job job1
job commandline: --pass 1 --bitrate 400 --stats "D:\PSP Test script 360 208.stats" --bframes 3 --subme 1 --analyse none --me dia --sar 360:208 --progress --no-psnr --output NUL "D:\PSP Test script 360 208.avs"
----------------------------------------------------------------------------------------------------------

Log for job job1

avis [info]: 368x208 @ 29.00 fps (278 frames)
x264 [info]: using SAR=45/26
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [info]: slice I:2 Avg QP:23.50 size: 14738
x264 [info]: slice P:112 Avg QP:28.41 size: 3262
x264 [info]: slice B:164 Avg QP:30.54 size: 518
x264 [info]: mb I I16..4: 6.0% 0.0% 94.0%
x264 [info]: mb P I16..4: 2.3% 0.0% 0.0% P16..4: 89.8% 0.0% 0.0% 0.0% 0.0% skip: 7.9%
x264 [info]: mb B I16..4: 0.0% 0.0% 0.0% B16..8: 11.5% 0.0% 0.0% direct:15.7% skip:72.7%
x264 [info]: final ratefactor: 27.02
x264 [info]: kb/s:400.4

Actual bitrate after encoding without container overhead: 400.87

----------------------------------------------------------------------------------------------------------


Please could someone help me sort this out, thanks in advance for anyhelp

bond
7th February 2006, 10:33
moved

Doom9
7th February 2006, 13:06
sounds like the usual to me.. run the job on the commandlines, you'll see what the errors are (the abort in the second pass is caused by a number frame mismatch because the first pass suddenly quit without any message (that's what a Log for job job1Without anything like avis [info]: 368x208 @ 29.00 fps (278 frames)means)). If anybody knows how x264.exe handles exit codes, perhaps I could flag such aborts in the future (note that there's no console output telling you that there has been an error).

Drillakilla
10th February 2006, 03:33
sorry mate i am fairly new to x264 how do i run the job on commandline??

berrinam
10th February 2006, 06:41
Read the instructions at the beginning of the Bug Reporting thread. They explain about running commandlines, as well as many other ways to solve problems.

Drillakilla
13th February 2006, 05:55
i got the encodes working finally, i didnt realise that 2 pass 2nd pass was not automated and that you had to run 2 pass first pass the 2 pass 2nd pass immediately afterwards ( on the commnd promt said no stats file which gave me a clue as to what went wrong),

finally got my mp4 file

thanks guys for your help, but i just transfered my mp4 and it shoes up as a unrecognised format on my psp

when i got my mp4 oc test.mp4, i renamed it to M4V10034.MP4 and transfered using psp video manger

i encoded using meguix264 pd psp profile, no audio ( just video for test)

I HAVE FW 2.01

Doom9
13th February 2006, 06:35
thanks guys for your help, but i just transfered my mp4 and it shoes up as a unrecognised format on my pspI'm afraid you'll have to run atomchanger on the file first.. even though the extension is the same, PSP files are not standard compliant MP4 files.

quake74
13th February 2006, 08:01
when i got my mp4 oc test.mp4, i renamed it to M4V10034.MP4 and transfered using psp video manger

i encoded using meguix264 pd psp profile, no audio ( just video for test)


For my experiments back in the days, the psp (or atomchanger) doesn't like files without audio and refuses to play them. Try again with audio.

Drillakilla
13th February 2006, 15:30
where can i find atomchanger to download??

another question my avs seems to show fine when i double click it and it plays through media player classic, but when i convert it it comes out very long (almost like a super wide) and distorted horizontally, how can i fix this?? where are the options in megui to change resolution ( i assumed it wasd the sample aspect ratio bit )

FOund atomchanger got it off psp video 9 avc, now the problem is using it,

i opened command, draged atomchnager.exe to the window, then copied my source video path, then wrote my target video path, then copied atomchanger ini and hit enter and it didnt work,

any ideas please?

I also just tried typing in the full code like so:


D:\Mpegs\psp\MeGui\atomchanger.exe "D:\Mpegs\PSP Encoding\Scripts\OC TEST.mp4""D:\Mpegs\PSP Encoding\Scripts\M4V10027.MP4" "D:\Mpegs\psp\MeGui\atomAVC.ini"

and that just brings up the atom changer details, (3gp converter etc and how to run)

deets
13th February 2006, 18:54
i run atomchanger through a batch file, i just then edit the batch file and double click on it.

put your ini and atomchanger.exe in the same folder.

start /belownormal /b /w ATOMChanger.exe c:\brother\obrother.mp4 c:\MAQ02732.MP4 AtomAVC.ini

put that in a text file and then save as atom.bat and change the files to your paths. double click and it will output the file to the location you put above

EDIT: and be careful of the file name, it needs to follow a set structure. if you use the above it will work, but only change the final numbers for different files, keep the same structure.

Drillakilla
13th February 2006, 20:54
big thanks to deeks who helped me get atomchanger working, just when i thought im finally there, i tried transfering the file over to the psp as MAQXXXXX.mp4 and it shoes up as unsupported format, i then change the file name to M4VXXXXX.mp4 and still no luck.

anyhelp here will be much appreciated, i encoded a small clip, pd-psp, main profile, adjusted the bit rate and passes, & i left the rest of the settings as they were

edit:

no i cant beleieve it it has worked now , i got the video on there, and the quality is wow so much better. video is a little bit jerky though

a couple of questions regarding this:

1. if my video is 23.976 fps and i want the same on the out put should i put a line on my avs scipt assumefps....... or should i leave it out because the frame rate is already that?

deets
13th February 2006, 21:15
you can leave it out to keep the original frame rate :)

Drillakilla
13th February 2006, 21:42
CAn psp firmware 2.01 handle 23.976fps?? if not how does it play it back? is this why the playback of my clip is jerky,

i know using change instead of convert can reuce ghosting but make clip a bit jerky, but what does assumefps do compared to the others?

can the latest firmware do 25fps /?

deets
13th February 2006, 21:49
nope, you need the latest firmware for the other frame rates.

otherwise you need to convert the audio and video to 29.97

Drillakilla
14th February 2006, 03:02
i dont know whats hapened but i downloaded the latest firmware 2.6 and half my movies have become unsupported format, the ones that i encoded prior to the firmware change with x264 and they had worked before. i tried deleting them and transferring them again but no luck.

deets
14th February 2006, 03:15
avc files must be put in a specific folder:
\MP_ROOT\100ANV01

Drillakilla
14th February 2006, 05:58
I had my avc files in 100mnv01 before and they worked fine, i tried them in the other folder and now they dont show up at all.

deets i tried formating the card but that didnt help either, i cant believe this just when i got the hand of the encoding this happens, 2.6 firware problem any ideas anyone?

my file names are like M4V10219.mp4

bond
14th February 2006, 12:44
i know actually nothing about the psp, but arent "M4V..." filenames for asp video stream mp4 files and not for ones with avc video?

Drillakilla
14th February 2006, 16:55
so then what are the file names meant to be for avc encoded files and what folders do they go in?? please someone help, i had them as M4VXXXXX.mp4 before and they worked just fine, but since i got 2.6 firware evrything screwed up, i even read sumwhere that they have taken out avc support on 2.6 now

Varium
14th February 2006, 17:40
M4VXXXXX is Mpeg-4 ASP video. For avc, you need to name the file MAQXXXXX. Both types go in the Mp4 container.
avc files must be put in a specific folder:
\MP_ROOT\100ANV01
avc does work on 2.6 btw.

Drillakilla
14th February 2006, 20:20
Thanks mate worked a charm now. the demo avc clips worked, some of the tests i did last nite for a dvd conversion didnt, going to try them again

heres my script:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")
LoadPlugin("D:\Mpegs\psp\MeGui\dgindex\dgdecode.dll")
mpeg2source("D:\Mpegs\PSP Encoding\troy clips\troy1.d2v")
assumefps(23.976)
crop(0,76,-0,-76)
LanczosResize(400,192)
Tweak(sat=1.2)
Sharpen(0.3)

just wanted to make sure, that it should be 23.976 or 24.000??

Varium
14th February 2006, 21:31
If you're using 2.6 psp you can use 23.976, 24 , 29.97 & 30 but not 25fps. Not that you'll probably need it but I think it supports 14.97 as well, but I'm not too sure on that one.

Drillakilla
15th February 2006, 03:00
i cannot get 23.976 fps to work, keeps showing as unsupported data, i know its something to do with the frame rate though, as i followed the exact same encode prosedure, the only thing i changed in my script to assume 24fps, and that clip worked fine. i used atomchanger

The above was for a dvd to avc file, i tried another test for avi to avc at 23.976 fps and that worked fine


thanks

Varium
15th February 2006, 04:32
what framerate is displayed when you use atomchanger? If its something odd like -100fps or 000fps then you need to demux the raw avc stream & the aac stream & then remux it again into a new mp4 file. If you use atomchanger again it should work hopefully.

Drillakilla
15th February 2006, 16:34
it says 2065.80 fps in atom changer, how can i remux that mp4? wot tool can i use?

thanks

Varium
15th February 2006, 19:28
try yamb (http://yamb.unite-video.com/download.html) Just install it, open Yamb and select the extract tab click on the input button & select the mp4 file you made for ur psp. select the extract track id in a raw format & choose track 1 for video (usually) & track 2 for audio (usually) You should get xxxfilename_video1.h264 or something like that for the raw avc stream. You should be able to figure out how to remux it pretty easily, If not then, let me know.

quake74
15th February 2006, 21:03
i cannot get 23.976 fps to work, keeps showing as unsupported data, i know its something to do with the frame rate though, as i followed the exact same encode prosedure, the only thing i changed in my script to assume 24fps, and that clip worked fine. i used atomchanger

The above was for a dvd to avc file, i tried another test for avi to avc at 23.976 fps and that worked fine

I wonder if the NiceFPS avisynth plugin is still needed. There used to be a problem with fractional frame rates but I do not recall if it was fixed or what. I still have a 2.0 PSP and so I always add
changefps(29.97)
nicefps()
to the end of my avs and they work fine.

Drillakilla
15th February 2006, 21:16
just tried it, what i got was a .aac audio and mp4 video files extracted from original mp4 file, muxed them back 2getha, then ran atomchanger, didnt work still unsupported format, i tried same method but on a different atom changer and this time came up as courrpted data

bond
15th February 2006, 21:16
M4VXXXXX is Mp4 video. For avc, you need to name the file MAQXXXXX. there is no such thing as "mp4 video". in mpeg-4 you can have either mpeg-4.2 video (aka mpeg-4 asp) or mpeg-4.10 video (aka mpeg-4 avc and h.264)

if you take "mp4" as the shortform of mpeg-4 it can mean everything...

I wonder if the NiceFPS avisynth plugin is still needed. There used to be a problem with fractional frame rates but I do not recall if it was fixed or what. I still have a 2.0 PSP and so I always add x264 is producing spec compliant files now without nicefps
whether the files work on the psp is a question sony needs to answer (or someone owning a psp ;) )

Drillakilla
15th February 2006, 21:23
when i extracted from my original mp4 file, two files came out, the first was xx xx xx .mp4 i opened it, it was just the video no sound, the second was xx x xx .aac again i opened it was just the sound, that is what i meant,

@quake, i think anythings worth a shot at the mo, il give it a try when comp done encoding of a avi movie (dvd im havin trouble with)

it keeps getting worse

i did a conversion of shrek dvd to avc using the above method at 24 fps, iv been trying to encode the audio in besweet and i have cbr 64kbps checked, but the file i am getting is way too big for that rate, its almost 90mins video, and the audio at 64 is coming out at 85 mb (thats a bit big isnt it for 64kbps, in atomchanger its reporting it as 126751 bytes, when transfer the film onto psp under information audio is AAC 128kbps

??

Drillakilla
16th February 2006, 00:23
okay the besweet is defin. encding the sound at 128kbps even though i have 64 selected. Belight is doing this aswell, i put my sound wav file into headache (104 min sound), at 64 kbps heachache says the output should be 49mb, the files im getting off besweet are coming out at 91mb even though it says they are encoded at 64kbps.

Does anyone know anything of this problem??

also the framerate problem above iv still had no luck?

Thanks for the help

Varium
16th February 2006, 02:52
there is no such thing as "mp4 video". in mpeg-4 you can have either mpeg-4.2 video (aka mpeg-4 asp) or mpeg-4.10 video (aka mpeg-4 avc and h.264)

if you take "mp4" as the shortform of mpeg-4 it can mean everything...

x264 is producing spec compliant files now without nicefps
whether the files work on the psp is a question sony needs to answer (or someone owning a psp ;) ) Yeah, my mistake, I'll change that and yes, x264 should produce psp compliant files providing that the framerate is compatible.

EDIT:
I tried to knock up a rough guide for fixing the framerate problem, it might help you i dunno. Its step by step using pictures, sorry about the size, just wanted to make sure everything is clear to see
Link (http://s43.yousendit.com/d.aspx?id=0SPEQKQAUJEBP14YWOUS5ODZAG)

Drillakilla
16th February 2006, 04:38
thanks mate will try the guide

what do you do after the last step of muxing it back together? i tried just copying the file and it shoews up as unsup.
, i then tried using atom changer on the new file and when it displaying the info ( bitrate, frame size etc) it was all gibberish, unreadable. once i got the file back changed and copied it over again unsupp.

was that what i was meant to do? i did follow all your steps

Varium
16th February 2006, 11:26
what framerate is the video at? It definately shouldn't be gibberish. Atomchanger should display the correct framerate e.g 23.98 (23.976), 29.97 etc, as well as an average audio bitrate. Try using this version of atomchanger, see if that helps.

5462

Just to check, are you sure it's an avc stream? If it is, and you're still having problems, I'd suggest re-encoding the file.

Drillakilla
16th February 2006, 21:24
iv re encoded several times, no luck , its definatly a avc file,

heres my script:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")
LoadPlugin("D:\Mpegs\psp\MeGui\dgindex\dgdecode.dll")
mpeg2source("D:\Mpegs\PSP Encoding\troy clips\troy1.d2v")
assumefps(23.976)
crop(0,76,-0,-76)
LanczosResize(400,192)
Tweak(sat=1.2)
Sharpen(0.3)

This is exactly what im doing:

I get the above file, mux with audio, which works (as iv tested by muxing to a completely dif. video), i then use atom changer ( info looks fine), put the file on my psp into anv folder. that didnt work, so i used ur method on the atomchanged file, i.e un muxed, re muxed, then used atom changer again ( this time the info is jiberish ) and ....again unsup. format.

my megui set up is fine because i use the same set up everytme on avi cinversions at 23.976 and they are all fine.

There is no link for atomchanger on your post mate

Varium
16th February 2006, 22:56
you have to extract the rar file, it has the atomavc.ini file & the atomchanger program as well. What name have you given the file when you put it in the PSP? Do you have a clip of the source you are encoding as well?

Drillakilla
17th February 2006, 01:07
i have not used the atom changer you have given above, there is no link?? it says ATTACHMENT PENDING APPROVAL

Varium
17th February 2006, 17:04
Ah, ok then. Try this link (http://s55.yousendit.com/d.aspx?id=29NDRQCEB6RGR36RUJ05AK5S6M) instead then. I'm pretty much running out of ideas of what the problem is, so sorry about that. My guesses are a) the audio samplerate isn't 48,000 b) there is something atomchanger has a problem with in the video file. I'll still try & see if i can figure it out for you though. Plus, I'm pretty sure that if i can't figure it out, someone is will know for sure.

Drillakilla
18th February 2006, 23:06
tried it mate, followed your instructions and used the new atom changer.
this time though on atom changer all the correct info was shown,a all except one.
23.98 fps, 48000khz audio etc the one problem i saw was the frame size was 700 x something which was wrong, straight away i knew it wouldnt work, but tried it out and it didnt.

i m giving up on this till i see a mate of mine who has had luck with dvd conversions, thanks for all the help guys , much appreciated, at least i can do 24.00 fps dvd conversions, and 23.976fps avi conversions , which aint all bad