Log in

View Full Version : [GUIDE] Encoding 3D Frame Sequential MP4 for the PlayStation 3 and Sony Bravia W8


tal.aloni
8th July 2014, 10:23
It's a little known fact that the Sony PlayStation 3 and the Sony Bravia W8 series can play 3D Frame Sequential video files from USB storage,
Example for such files (Created by Sony):
E320103DSizzle_Trailer-3D720.MP4 (http://poseidon.dl.playstation.net/cdn/UP9000/NPUL00108_00/FREE_CONTENT6h5UXVMKmPkL0JiN7yIY/E320103DSizzle_Trailer-3D720.MP4)
Uncharted3DrakesDeception_3DAnnouncementTrailer-3D.MP4 (http://poseidon.dl.playstation.net/cdn/UP9000/BCUS98233_00/FREE_CONTENTHqB8xktUCLpiJ408eXpi/Uncharted3DrakesDeception_3DAnnouncementTrailer-3D.MP4)

And another example created by me:
BigBuckBunny-720p-3D-AAC5.1.mp4 (https://drive.google.com/open?id=0B1wrdynUizpMYVNGdm5vZDZrbzg)

And another example I created specifically for the Sony W8:
BigBuckBunny-1080p-3D-DD5.1.mp4 (https://drive.google.com/open?id=0B1wrdynUizpMaEF0MXlfS1RpTlE)

This post is about creating such files.

Requirements (Sony W8):
1. Container: MP4 works best (brand: mp42 or MSNV, must have the audio/video intearleaved, the temporal offset between the first audio and video sample data of an interleave unit should be kept to a minimum), MKV works but may has some issues (muxer related?).
2. Video: H264, 1280x720 or 1920x1080 (High@L4.2 was tested successfully), must contain frame_packing_arrangement SEI messages to point which frame goes to which eye.
3. Audio: AAC-LC, AC3 or DTS. (2.0 or 5.1)

Requirements (PlayStation 3):
1. Container: Must be MP4 conforming to the MSNV brand specs (IEC/TS 62592) and must includes customized 3D descriptors.
2. Video: H264, 1280x720 (23.976/29.97/30 fps per eye), High@L4.0 (or below), must contain frame_packing_arrangement SEI messages to point which frame goes to which eye.
3. Audio: Must be AAC-LC (2.0 or 5.1) for MSNV compatibility.
4. The MP4 file must be placed inside a "VIDEO" directory within the root folder. (the disk must be formatted to FAT32)

Step 1 - Creating the 3D frame-sequential H264 video stream:
You must use x264 r2434 or later. (thanks goes to the x264 team!)
Command line example:
"%x264Path%" "%input%" --crf %crf% --level 4.0 --ref %ref% --b-pyramid normal --mixed-refs --no-fast-pskip --bframes 8 --b-adapt 2 --weightb --direct auto --deblock -3:-3 --subme 9 --trellis 2 --aq-strength 0.8 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 31250 --vbv-maxrate 25000 --me esa --merange 32 --rc-lookahead 100 --threads auto --sar 1:1 --fps 48000/1001 --frame-packing 5 --output "%output%" --aud --slices 4

Step 2 - Encoding the audio:
I've used the latest version of the free Nero AAC Encoder, you must choose the AAC-LC profile (You'll need to demux the AAC from the m4a container after the encode)
(You can use BeHappy if you need a GUI, make sure to select AAC-LC and update the NeroAacEncoder binary)

Step 3 - Muxing the video and audio:
Grab a copy of MP4Maker (https://github.com/TalAloni/MP4Maker), a multiplexer I wrote specifically to suit the needs of the PlayStation 3 / Sony W8,

To create MSNV-compliant MP4 with the customized 3D descriptors necessary for the PlayStation 3D detection:
MP4Maker /mux /profile=MSNV3D /input=<h264-path> /input=<aac-path> /output=<mp4-path>

(output > 4GB will not be 100% MSNV compliant but will likely to work anyway, the PS3 is limited to that size anyway (FAT32))

or, if you're only interested in the Sony W8 support:
MP4Maker /mux /input=<h264-path> /input=<audio-path> /output=<mp4-path>

Happy encoding!

Kurtnoise
8th July 2014, 13:37
Nice work, thank you !!!

But why reinvent the wheel concerning the muxer ? There are already some MP4 muxers which are able to create such files like MP4Box from GPAC Framework or L-SMASH one...

tal.aloni
8th July 2014, 15:08
You welcome,
Kurtnoise, not all MP4 files are created equal, and there are various MP4 brands and standards.

This has started as a reverse engineering effort (read about it here (http://www.avsforum.com/forum/194-3d-tech-talk/1281356-how-create-3d-frame-sequential-video-3.html) and here (http://forum.doom9.org/showthread.php?t=158457&page=9))
In the beginning I had an MP4 that the PS3 could detect as 3D and I tried to figure out why existing muxers (MP4Box, MP4Creator) would break 3D detection upon remux.

Eventually it turned out that the PS3 requires that the MP4 will follow the MSNV brand specs (IEC/TS 62592) in addition to some undocumented customizations, no existing open-source muxer supported any of that.

In addition, when working with both MP4Box and MP4Creator I encountered some unrelated bugs, (e.g. MP4Creator will misdetect an AAC with 5.1 channels as 2.0), try to feed an MP4 with a descriptor containing an incorrect number of audio channels to the PS3 and it will refuse to play it in 3D.

p.s. So I wrote my custom tool to modify various aspects of the MP4 file, and by the time I realized what the PS3 / W8 require, it was just a single step from transforming my tool into an MP4 multiplexer.
(in other words, at that point in time, it would have taken me much longer to discard my previous work and start adapting an existing muxer, not to mention fixing existing bugs)