Log in

View Full Version : A MP4 file for both PSP and iPod devices


David1105
25th January 2007, 00:57
Does anyone have info on how to make a single MP4 file playable on both iPod and PSP devices?

Someone told me that this can be done by modifying the header of a MP4 file with "blank" bytes at specific locations of it. Is this true? If so, what're the locations?

Thanks!

bond
25th January 2007, 22:57
normal ipod and psp devices dont need f**ked up headers.

i think the ipod is the worse device so you might want to simply try an encode done with the megui ipod profile on the psp and see if it works

David1105
26th January 2007, 02:43
Thanks for your reply!

A MP4 file is generated by our app for either iPod or PSP, but not both yet. Ideally I'd like to just need to "tweak" the MP4 file directly so that the MP4 file for iPod can be played on PSP, or vice versa.

cast42
27th January 2007, 15:03
Video for PSP:
H.264 Video
File format: m4v, mp4
Video: 768kbps or less, 320x240 pixels or less, 30 frames/s (fps) or less,
Level 1.3 or less Baseline Profile and
Level 2.1 or less Main Profile (CABAC only)
Audio: AAC 128kbps or less, 48kHz or less, stereo

mp4 for IPOD:
# H.264 video, up to 1.5 Mbps, 640 x 480, 30 frames per sec., Baseline Low-Complexity Profile with AAC-LC audio up to 160 kbps, 48 Khz, stereo audio in .m4v, .mp4, and .mov file formats
# H.264 video, up to 768 kbps, 320 x 240, 30 frames per sec., Baseline Profile up to Level 1.3 with AAC-LC audio up to 160 kbps, 48 Khz, stereo audio in .m4v, .mp4, and .mov file formats

PSP can decode CABAC but Ipod Video 5 not. PSP mp4 resolution is restricted to 320x240 (4:3) or 368 x 208 for 16:9 user generated material.
Ipod plays 368x208, because it is 76544 pixels, just under the 76800 limit. (http://forum.doom9.org/showthread.php?p=880325#post880325)

For audio both devices handle stero AAC-LC upto 128Kbps.

Conclusion: take AVC encoding options for ipod and resolution for PSP and limit bitrate to 768Kbps for video and 128Kbps for stereo.

The only problem that remains is that mp4 for ipod must contain a dedicated UUID (try Nic's mp4box) (http://nic.dnsalias.com/NicMP4Box.zip) otherwise iTunes will not sync to the ipod.... I didn't test yet if mp4 with the UUID can be played on PSP. I guess it will.

So solution could be:
x264.exe --level 30 --bitrate 500 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --me umh --progress --no-psnr --output "video.264" "video_ipod_psp.avs"
nicMP4Box.exe -add video.264 video_ipod_psp.mp4

When playing with encode options, Nic's tests (http://forum.doom9.org/showthread.php?p=880331#post880331)may be helpful.

kalin
27th January 2007, 19:54
Actually the resolution is 480x272 in firmware 3.03 and if you´re using Dark Alex 3.03 OE-C then you have bitrate up to
16383 Kbps.

Cheers Kalle.

David1105
30th January 2007, 20:18
Thanks for the help!

I installed x264 based on the info from the thread: http://forum.doom9.org/showthread.php?t=98032

What's the input file "video_ipod_psp.avs"? How to generate or obtain one?

What's the input file "video.264"? How to generate or obtain one?

Is "video_ipod_psp.mp4" supposed to be the final output MP4 file?

ilovejedd
30th January 2007, 20:39
video_ipod_psp.avs - AviSynth script. Basically text file with .avs extension.
sample AviSynth script:DirectShowSource("yourfilehere")

video.264 - Raw h264 video file. Created via x264 (first line of code)
x264.exe --level 30 --bitrate 500 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --me umh --progress --no-psnr --output "video.264" "video_ipod_psp.avs"

Yes, video_ipod_psp.mp4 is your output. But it doesn't have an audio track.

David1105
31st January 2007, 00:04
Following the above procedure, I just confirmed that the output MP4 file can be played on iPod, but it can NOT on PSP.

Any comments are greatly appreciated!

cast42
31st January 2007, 22:16
Try
MP4Box.exe -add video.264 video_ipod_psp.mp4
instead of:
nicMP4Box.exe -add video.264 video_ipod_psp.mp4

If the mp4 file that results from MP4box plays on PSP, then we are sure that the problem is induced by nicMP4box that adds that pesky iTunes UUID that makes PSP barf.

Another issue is that ipod video screen is 4:3 and PSP is 16:9. Hence if source video has a 4:3 aspect ratio, black bands at the right and left are needed on PSP and is source aspect ratio is 16:9, black bands at the top and bottom are needed on Ipod video.

ilovejedd
31st January 2007, 23:13
Why would you need to add black left and right bands for the PSP? It can play 4:3 videos just fine. Actually, I'm not sure which firmware they added it, probably 2.00, but prior to that firmware update, the only resolution the PSP will support is 320x240. You can change the viewing mode during playback on the PSP from Original (original resolution, video centered on the screen), Normal (resizes video to fit height 272px, maintain AR), Zoom (2x original resolution?) and Full Screen (resize to 480x272).

Using Dark_Alex's custom firmware 3.03 OE-A (and I'm guessing official Sony 2.80+ firmware), I was able to play a video tailored for the iPod (supposedly, as I don't have an iPod to test it with, but iTunes seems to like the file). I used 3GP_Converter (http://www.nurs.or.jp/~calcium/3gpp/) with the included iPod profile and the following settings (2nd option):
Title=AVC QVGA/•W€‰æŽ¿(384kbps)
TitleE=AVC QVGA/384kbps
FileNameMax=59
Command0=""<%AppPath%>\cores\ffmpeg" -y -maxfr 30 -i "<%InputFile%>" -title "<%Title%>" -timestamp "<%TimeStamp%>" -bitexact -vcodec h264 -coder 0 -bufsize 256 -g 250 -vlevel 13 -fixaspect -s 320x240 -b 384 -maxrate 768 -qmin 2 -qmax 51 -acodec aac -ac 2 -ar 48000 -ab 64 -f ipod "<%TemporaryFile%>.M4V""
Command1=""<%AppPath%>\cores\QT3GPPFlatten" "<%TemporaryFile%>.M4V" "<%TemporaryFile%>_2.M4V" -c QT_H264_QVGA_AAC.ini -t mpg4"
Command2="rm "<%TemporaryFile%>.M4V""
Command3=""<%AppPath%>\cores\ATOMChanger" "<%TemporaryFile%>_2.M4V" "<%OutputFile%>.M4V" "Camouflage_MOVIE_for_iPod.ini" "<%Title%>""
Command4="rm "<%TemporaryFile%>_2.M4V""
Command5=""<%AppPath%>\cores\AddiTunes" "<%OutputFile%>.M4V""

The video worked fine when I put it inside the folder {ms_root}:\VIDEO\. It gave me "Unsupported Format" when using the old folder and file naming structure {ms_root}:\MP_ROOT\100ANV01\MAQ10001.MP4

I'm not sure if the source code for QT3GPPFlatten and ATOMChanger is available since the site's in Japanese and I couldn't navigate it very well. Anyway, it seems that PSPs w/firmware 2.80+ can play videos encoded for iPods. Firmwares 2.71 and below require the PSP atom.

giandrea
31st January 2007, 23:55
Just wanted to point out that Google Video already has downloadable MP4 files compatible with both the PSP and the iPod.

And if you use a resolution of 320x240 or lower and bitrate up to 768 kbps for the iPod, you can safely turn CABAC on. You should turn it off only for 640x480 content. (And I suggest you to turn off the inloop filter too at that resolution because it is very CPU and battery intensive).

David1105
1st February 2007, 00:06
cast42,

Using "MP4Box.exe" instead causes the output MP4 file either cannot be copied to iPod (iTune complained and stopped copying), or PSP recognizes it as "Unsupported data."