Log in

View Full Version : x264 and Sony PSP?


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

fachman
7th January 2009, 22:35
Hello

I have the problemm of compatibility. I have converted video using MEGUI PSP settings. I received the following statistics:

--[NoImage] Job commandline: "C:\Program Files (x86)\megui\tools\x264\x264.exe" --pass 2 --bitrate 300 --stats "01.stats" --level 3 --ref 3 --mixed-refs --bframes 2 --weightb --direct auto --trellis 1 --partitions p8x8,b8x8,i4x4 --vbv-bufsize 200 --vbv-maxrate 2000 --me umh --threads auto --thread-input --sar 136:135 --aud --progress --no-psnr --no-ssim --output "01.mp4" "01.avs"
--[Information] [2009-01-07 13:26:43] Encoding started
--[NoImage] Standard output stream:
--[NoImage] Standard error stream
---[NoImage] avis [info]: 480x272 @ 23.98 fps (67123 frames)
---[NoImage] x264 [info]: using SAR=136/135
---[NoImage] x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
---[NoImage] x264 [warning]: VBV buffer size too small, using 250 kbit
---[NoImage] x264 [info]: profile Main, level 3.0
---[NoImage] mp4 [info]: initial delay 208541 (scale 5000000)
---[NoImage]
---[NoImage] x264 [info]: slice I:1108 Avg QP:22.44 size: 9243
---[NoImage] x264 [info]: slice P:33284 Avg QP:25.82 size: 2320
---[NoImage] x264 [info]: slice B:32731 Avg QP:26.55 size: 535
---[NoImage] x264 [info]: consecutive B-frames: 17.6% 32.1% 50.3%
---[NoImage] x264 [info]: mb I I16..4: 29.3% 0.0% 70.7%
---[NoImage] x264 [info]: mb P I16..4: 3.7% 0.0% 4.9% P16..4: 41.6% 13.2% 8.3% 0.0% 0.0% skip:28.2%
---[NoImage] x264 [info]: mb B I16..4: 1.1% 0.0% 0.0% B16..8: 19.4% 1.6% 0.9% direct: 3.5% skip:73.6% L0:32.6% L1:49.7% BI:17.7%
---[NoImage] x264 [info]: direct mvs spatial:62.7% temporal:37.3%
---[NoImage] x264 [info]: ref P L0 81.8% 11.0% 7.2%
---[NoImage] x264 [info]: ref B L0 86.7% 13.3%
---[NoImage] x264 [info]: kb/s:300.0
---[NoImage] encoded 67123 frames, 27.36 fps, 301.23 kb/s
--[Information] Final statistics
---[NoImage] Video Bitrate Desired: 300 kbit/s
---[NoImage] Video Bitrate Obtained (approximate): 301 kbit/s

And MY PSP with latest firmware 5.02 says that such video is not supported....
Anyone knows why???

lexor
7th January 2009, 22:53
Anyone knows why???

Yes, it's because of:
put the [mp4] header at the end instead of the start. That's the method x264 uses for outputting an mp4 to stdout.

you have to remux or use qt-faststart for many devices and for web playback when using either x264's or ffmpeg's muxer. This is by design.

Basically, demux the mp4 file to raw streams and mux again with megui to mp4.

For the future, it's easier to just encode to raw, and then mux (this way you don't have to demux after encode)

fachman
7th January 2009, 23:49
Thank you very much Luxor.
I wonder why x264 is using by default the settings which breaks compatibility???

Anyway I have tried to demux the file with mp4box and it quits with an error or says that is can not find js32.dll
I have VISTA64....

After a while I have found it would work with older MP4box build from October...

Your solution worked flawlessly :thanks:

Sharktooth
8th January 2009, 04:20
coz x264 cant fill the header with data it doesnt yet know.
it has to finish the encoding and then write the header at the end.

fachman
8th January 2009, 23:44
Sharktooth:

Thank you very much for the response and great programm MEGUI :)
Would it be possible to make the logs not to disappear when for some reason MEGUI quits by accident. (I have many problemms with stability of AVS script with FFT3dGPU filter and lost a lot of precious statistics)

As for the header when I have compared two files the only difference at the begining was AVC1 which was not produced directly by x264.
Of course I assume there are also more informations, but I think MP4BOX should write the correct header when muxing such mp4 file with sound. Is it possible???

Best Regards

Sharktooth
9th January 2009, 14:34
look inside the logs directory. if the log is incomplete then megui crashed for some reason.

yes, mp4box writes the header on the beginning. so whenever you remux the mp4s produced by x264 with mp4box, the header is placed where it is supposed to be.

fachman
9th January 2009, 20:37
Hello

THe logs are written when you leave the MEGUI normally, if the programm is terminated by windows all statistics is lost. I think Megui should save the statistics as soon as it will end the single coding, so when the FFT3DGPU hangs the system with the next file, the statistics wont be lost.

MP4box writes the header correctly only if you use raw stream. If you use MP4 produced by x264 it does not.

Greetings

HolyRoses
10th January 2009, 06:33
The easiest way to encode for psp if you own a Linux pc or Mac OS pc is encode-handheld.pl. The latest revision is 3.1. It will build you flawless 480 width files that will play on any iPod, Zune, or PSP. It is very simple to use. Google it, currently only available via torrent.

-HR

b66pak
15th January 2009, 20:30
b pyramid is supported by psp?

Rumbah
15th January 2009, 22:56
No, files encoded with b pyramid do not work.

teddg
17th January 2009, 06:46
b pyramid is supported by psp?

No, files encoded with b pyramid do not work.

Yes, b pyramid works on my psp.

Rumbah
17th January 2009, 11:56
Ok, the last time I tested it it did not work. Seems like Sony changed it in a new firmware. Are there any restrictions in the number of b frames with b pyramid on the PSP?

CruNcher
17th January 2009, 12:19
does 8x8dct works now eg High Profile ?

lexor
17th January 2009, 16:32
Yes, b pyramid works on my psp.

When you say "works" do you mean it just plays or that it plays smoothly? Files with b-pyramid always played, but they exhibited heavy tearing artifacts, especially in pans.

teddg
17th January 2009, 17:05
Ok, the last time I tested it it did not work. Seems like Sony changed it in a new firmware. Are there any restrictions in the number of b frames with b pyramid on the PSP?

*firmware 5.01 (Sept, I think). This update added 640x480 support, in addition to the 720x480.

*Never tried more than 3 bframes.

*Things that break psp 5.01 (that I've tried); dct8x8, 5 refs

*A test ffmpeg command that works on 5.01;
ffmpeg -i "C:\movie.VOB" -f psp -r 29.97 -vcodec libx264 -s 720x480 -aspect 1.778 -threads 0 -deblockalpha 0 -deblockbeta 0 -crf 26 -refs 3 -bf 3 -b_strategy 2 -bidir_refine 1 -directpred auto -coder 1 -flags +loop -cmp +chroma -me_method umh -me_range 16 -subq 7 -trellis 2 -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs+wpred+bpyramid -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -nr 600 -vol 512 -acodec libfaac -ab 64k -ar 48000 -ac 2 "C:\movie.mp4"

*Anyone know what the -f psp switch does? My encodes work with or without it. It throws an error if there is not one video stream and one audio stream. Other than that, it doesn't seem to be needed.

*Just double checked with megui, the following works too;
--crf 26 --level 3 --ref 3 --mixed-refs --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto --subme 7 --trellis 1 --partitions p8x8,b8x8,i4x4 --vbv-bufsize 10000 --vbv-maxrate 10000 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input"

Sagekilla
17th January 2009, 17:12
Tearing artifacts sounds more like an issue with the screen and how it's being updated. On my LCD, some videos (regardless of how they're encoded) always show tearing artifacts during panning scenes.

Atak_Snajpera
17th January 2009, 17:25
*Things that break psp 5.01 (that I've tried); dct8x8, 5 refs
PSP supports ONLY main profile \. dct8x8 belongs to HIGH PROFILE!!! No wonder that it doesn't work.

Comatose
17th January 2009, 17:28
When I used b-pyramid I saw blocky artifacts. I haven't tried since, so who knows...

teddg
17th January 2009, 18:19
When you say "works" do you mean it just plays or that it plays smoothly? Files with b-pyramid always played, but they exhibited heavy tearing artifacts, especially in pans.

I usually watch my psp thought the AV cable on my TV and haven't noticed any problem with smoothness or tearing artifacts. I'll load up some files and look for. Thanks for the info.

lexor
17th January 2009, 22:45
I usually watch my psp thought the AV cable on my TV and haven't noticed any problem with smoothness or tearing artifacts. I'll load up some files and look for. Thanks for the info.
Maybe tearing wasn't the right word. What was happening is more like part of the picture would get stuck for a moment and the spot (usually fairly small, but there are several of them) where it should have moved becomes black, like it doesn't know what to put there.

This is different from screen update issues Sagekilla is talking about (and that you would see in media players on PC). These artifacts can be turned on/off by switching the b-pyramid option.

b66pak
18th January 2009, 20:35
ok...i did a few tests today with a clip (i have i slim 2004 PSP model with 5.02 firmware):

- megui PSP profile + trellis always, 16 bframes - plays OK

- megui PSP profile + trellis always, 16 bframes + b pyramid - plays with a lot of artefacts
_

HolyRoses
18th January 2009, 20:46
b pyramid will cause problems on playback. You can use 16 b frames if you wanted, but only 3 refs. I don't advise using b frames because your video wont play on iPod.

I have updated my encode-handheld.pl to v3.2

Added ratings for US TV & Movies. Google it if you want to download it. Will give you flawless PSP movies that will work on iPod also.

-HR

HolyRoses
19th January 2009, 01:50
teddg:

the -f psp option adds the special PSP title atom that the psp reads for the title if you have it in the /MP_ROOT folder.

-HR

Comatose
19th January 2009, 15:33
Will give you flawless PSP movies that will work on iPod also.
Wouldn't call them flawless, since flawlessness is usually measured with quality & compression...

Besides, if you have either an iPod or a PSP, you likely don't have the other. They serve the same purpose.

HolyRoses
19th January 2009, 19:53
Hmm, I have both. One plays games, one doesn't.

-HR

b66pak
20th January 2009, 19:20
ok...i did new tests today with some .vobs (i have i slim 2004 PSP model with 5.02 firmware):

720x480-ws-anamorphic@29.97fps - it work but it displays as 4:3 and you have to select widescreen manually

720x576-ws-anamorphic@25fps - it did not work!!!
_

b66pak
22nd January 2009, 17:52
tested 720x480-ws-anamorphic@23.976fps - it work but it displays as 4:3 and you have to select widescreen manually
_