[MEncoder-users] Why can't the PS3 play the mp4s produced by this mencoder command?

Stroller stroller at stellar.eclipse.co.uk
Mon Sep 22 07:13:23 CEST 2008


Hi there,

I'm using the "undvd" wrapper script [1][2] to convert DVDs to .mp4  
files. The results play fine under Linux, Windows & Mac, but not on my  
PS3 which describes them merely as "unrecognised data".

I can find loads of "recipes" online which use mencoder (or more  
commonly ffmpeg) to convert video to PS3-playable mp4, but none of  
them do the whole job as conveniently as undvd. So I'd prefer not to  
rewrite this conversion script from scratch, but instead make the  
minimum changes to undvd in order to add PS3 compatibility.

The command lines passed from undvd:

$ head -n 1 logs/*
==> logs/07.log.pass1 <==
time /usr/bin/nice -n20 /usr/bin/mencoder -v dvd://07 -dvd-device  
"disc.iso" -alang en -slang off -vf  
crop=704:304:8:86,scale=704:304,harddup -ovc x264 -x264encopts  
pass 
=1:subq=1:frameref=1:partitions=all:weight_b:bitrate=939:threads=auto - 
oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -of avi -o /dev/ 
null

==> logs/07.log.pass2 <==
time /usr/bin/nice -n20 /usr/bin/mencoder -v dvd://07 -dvd-device  
"disc.iso" -alang en -slang off -vf  
crop=704:304:8:86,scale=704:304,harddup -ovc x264 -x264encopts  
pass 
=2:subq=5:frameref=2:partitions=all:weight_b:bitrate=939:threads=auto - 
oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -of avi -o  
"07.avi.partial"

==> logs/07.remuxlog <==
if [[ -e "07.mp4" ]]; then /bin/rm "07.mp4"; fi && /usr/bin/mplayer  
"07.avi" -dumpaudio -dumpfile "07.aac" && /usr/bin/mplayer "07.avi" - 
dumpvideo -dumpfile "07.h264" && /usr/bin/mp4creator -create="07.aac"  
"07.mp4" && /usr/bin/mp4creator -create="07.h264" -rate=29.970  
"07.mp4" && /usr/bin/mp4creator -hint=1 "07.mp4" && /usr/bin/ 
mp4creator -hint=2 "07.mp4" && /usr/bin/mp4creator -optimize "07.mp4"  
&& /bin/rm "07.aac" && /bin/rm "07.h264" && /bin/rm "07.avi"
$

Resultant video file:

$ mplayer -really-quiet -ao null -vo null -frames 0 -identify 07.mp4
ID_AUDIO_ID=0
ID_VIDEO_ID=1
ID_FILENAME=07.mp4
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=704
ID_VIDEO_HEIGHT=304
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=255
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=147.52
ID_SEEKABLE=1
ID_VIDEO_CODEC=ffh264
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=faad
$

If I compare this with a trailer I downloaded from the Playstation  
Store I find the only substantial & obvious differences to be the FPS  
& dimensions:

$ mplayer -really-quiet -ao null -vo null -frames 0 -identify ELEFUNK\  
English.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x87642d4]edit list not starting at 0, a/v  
desync might occur, patch welcome
ID_AUDIO_ID=0
ID_VIDEO_ID=1
ID_FILENAME=ELEFUNK English.mp4
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=1280
ID_VIDEO_HEIGHT=720
ID_VIDEO_FPS=59.940
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=255
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=88.34
ID_SEEKABLE=1
ID_VIDEO_CODEC=ffh264
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=faad
$ mplayer -really-quiet -ao null -vo null -frames 0 -identify 07.mp4 >  
07.mp4.txt
$ mplayer -really-quiet -ao null -vo null -frames 0 -identify ELEFUNK\  
English.mp4  > ELEFUNK\ English.mp4.txt
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x87642d4]edit list not starting at 0, a/v  
desync might occur, patch welcome
$ diff ELEFUNK\ English.mp4.txt 07.mp4.txt
3c3
< ID_FILENAME=ELEFUNK English.mp4
---
 > ID_FILENAME=07.mp4
7,9c7,9
< ID_VIDEO_WIDTH=1280
< ID_VIDEO_HEIGHT=720
< ID_VIDEO_FPS=59.940
---
 > ID_VIDEO_WIDTH=704
 > ID_VIDEO_HEIGHT=304
 > ID_VIDEO_FPS=29.970
15c15
< ID_LENGTH=88.34
---
 > ID_LENGTH=147.52
$

I'd read that the PS3 can be fussy about mp4 framerates, and I'm kinda  
hoping the problem isn't the video dimensions, so I had a quick hack  
of undvd to do everything the same, but double the framerate to match  
that of the Sony download:

$ head -n 1 logs/*
==> logs/07.log.pass1 <==
time /usr/bin/nice -n20 /usr/bin/mencoder -v dvd://07 -dvd-device  
"disc.iso" -alang en -slang off -vf  
crop=704:304:8:86,scale=704:304,harddup -ofps 59.94 -ovc x264 - 
x264encopts  
pass 
=1:subq=1:frameref=1:partitions=all:weight_b:bitrate=939:threads=auto - 
oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -of avi -o /dev/ 
null

==> logs/07.log.pass2 <==
time /usr/bin/nice -n20 /usr/bin/mencoder -v dvd://07 -dvd-device  
"disc.iso" -alang en -slang off -vf  
crop=704:304:8:86,scale=704:304,harddup -ofps 59.94 -ovc x264 - 
x264encopts  
pass 
=2:subq=5:frameref=2:partitions=all:weight_b:bitrate=939:threads=auto - 
oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -of avi -o  
"07.avi.partial"

==> logs/07.remuxlog <==
if [[ -e "07.mp4" ]]; then /bin/rm "07.mp4"; fi && /usr/bin/mplayer  
"07.avi" -dumpaudio -dumpfile "07.aac" && /usr/bin/mplayer "07.avi" - 
dumpvideo -dumpfile "07.h264" && /usr/bin/mp4creator -create="07.aac"  
"07.mp4" && /usr/bin/mp4creator -create="07.h264" -rate=59.94 "07.mp4"  
&& /usr/bin/mp4creator -hint=1 "07.mp4" && /usr/bin/mp4creator -hint=2  
"07.mp4" && /usr/bin/mp4creator -optimize "07.mp4" && /bin/rm "07.aac"  
&& /bin/rm "07.h264" && /bin/rm "07.avi"
$

(in the above the only changes are the addition of "-ofps 59.94" and "- 
rate=59.94", I think)

This seems to have been successful, now the framerates are the same:
$ mplayer -really-quiet -ao null -vo null -frames 0 -identify 07.mp4 >  
07.mp4.txt
$ diff ELEFUNK\ English.mp4.txt 07.mp4.txt
3c3
< ID_FILENAME=ELEFUNK English.mp4
---
 > ID_FILENAME=07.mp4
7,8c7,8
< ID_VIDEO_WIDTH=1280
< ID_VIDEO_HEIGHT=720
---
 > ID_VIDEO_WIDTH=704
 > ID_VIDEO_HEIGHT=304
15c15
< ID_LENGTH=88.34
---
 > ID_LENGTH=147.52
$

Unfortunately, I still get the same problem of the Playstation  
refusing to recognise the video.

Any suggestions as to how I can fix this, please?
Am I being dumb in overlooking the dimensions of my MP4 file? Is that  
somehow important?

Hopefully if I can make only one or two changes to the command passed  
to mencoder - if I can make the changes to undvd minimal then  
hopefully I can pass them upstream & get someone else to maintain  
them. :)

Thanks in advance for any suggestions,

Stroller.




[1] http://www.matusiak.eu/numerodix/blog/index.php/2007/01/30/undvd-dvd-ripping-made-easy/
[2] http://sourceforge.net/projects/undvd/



More information about the MEncoder-users mailing list