Uderstanding SSIF.SMAP

Everything related to MakeMKV
Axehandler
Posts: 36
Joined: Tue Nov 16, 2010 6:06 pm

Uderstanding SSIF.SMAP

Post by Axehandler »

I thought I would play around with my Despicable me 3d BluRay - I did a full backup and unencrypted the files.

Now I know to play the 3d version it uses the SSIF files in the SSIF folder under the stream folder.
But the Backup changed those to SSIF.SMAP

StereoScopic Player doesn't understand the file. SO I thought I would look around to see what a smap file is...
about the only thing I find... when looking for SMAP file is a bunch of music by a band called SMAP - SMAP (???? Sumappu?) is a Japanese idol group formed by Johnny & Associates

So... I'm trying to understand how to either convert or translate the smap back to a standard SSIF file.

Help? :)

Axe
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Uderstanding SSIF.SMAP

Post by mike admin »

SSIF.SMAP is a text file. Inside is the information how to concatenate multiple M2TS files in order to create SSIF file - otherwise backup would've been two times bigger. Can your player play M2TS files directly?
Axehandler
Posts: 36
Joined: Tue Nov 16, 2010 6:06 pm

Re: Uderstanding SSIF.SMAP

Post by Axehandler »

Thanks for replying Mike,

I can play the M2ts files directly - but the program doesn't read the file as 3d - due to the 2nd 1/2 of the file missing. (it "should" be 2 times bigger then normal when using the 3d)

Basicly the left 1/2 appears to be fine - the right 1/2 is missing. now the program is robust enough to allow me to "force" a pseudo 3d mode - but I'm no expert at that :P

Would it be possiable in Future revisions to allows us to Select the option of outputing the SSIF folder properly (with the full files) but maybe just default to the way you currently do it?

Or possiably release a exe that reads the SMAP and builds the needed files? (I suppose I could look into tthis as well)

Thanks in Advance.
Axe
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Uderstanding SSIF.SMAP

Post by mike admin »

Axehandler wrote:Or possiably release a exe that reads the SMAP and builds the needed files? (I suppose I could look into tthis as well)
This should be trivial to write, even by someone with basic coding skills. :)
But I'm surprised that your player can't play 3D from two M2TS files. Even more, the "main" M2TS file always contains reference to the "secondary" M2TS and I'm surprised that this reference isn't parsed properly. Is it an unofficial player? Is it popular?
Axehandler
Posts: 36
Joined: Tue Nov 16, 2010 6:06 pm

Re: Uderstanding SSIF.SMAP

Post by Axehandler »

The player I'm "playing" with (pun intended) is called "Stereoscopic Player" and It can play 2 M2TS files - however MakeMKV doesn't currently output 2 M2ts files for the 3D files. (left/right or top/bottom)

As an example - on Despicable me 3D bluray - the Main file to watch is
00027.m2ts - 18.0 GB (19,433,097,216 bytes) AVCHD Video (.m2ts)

When you peruse the Stereoscopic player site. I did find this...
--
Stereoscopic Player 1.7 features playback of 3D Blu-ray SSIF files, has build-in support for Matroska, Flash, MP4 and MPEG-TS formats and adds generic support for arbitrary single-viewer and multi-viewer autostereoscopic displays.
--

So this Player needs the SSIF files as a whole to play the 3d part, if I try to play from the disk thou I get a "this media is encrypted"... thats why I mentioned the "option" to output them correctly ;) I just found it odd you would make your own file format (.smap) without any info anywhere on it.

Overall I see 3d as a Gimmick and won't mess with it much. As I said thou - this is just me playing around and seeing what is possible. I don't have a nvidia 3d set or a 120Hz monitor - but the above software lets me output those and also Anaglyph (red/cyan)- and the kids still have fun with it! ;)

Axe
ixceuh
Posts: 2
Joined: Wed Apr 20, 2011 1:47 pm

Re: Uderstanding SSIF.SMAP

Post by ixceuh »

I'd actually be interested in writing the said tool, could you provide a little documentation on the SMAP format ? Is it like sourcefile, start offset, length of chunk ? (that's what it definitely looks to be, I'm just wondering what unit the smap file is using, since the biggest offset for one of my files is 6342720, file which is actually 13G ? multiples of 2048B ?)

Edit : ok, it actually seems to work, though I had overlooked the fact that it'd still include the audio data and, while I was hoping to get only a merged left h264 + delta h264 stream that I could feed to JM Ref Software (I'm trying to write a proper open source modification to JM to do 3D blu ray ripping on Linux).. anyway.
I included my minitool. preparse.py parses the smap file to prelist the input streams and do minor substitutions, while rebuild.c is the actual rebuilding tool, which has to be compiled with something like gcc -o rebuild -std=c99 rebuild.c
Usage : cat 00002.ssif.smap | python /path/topreparse.py | /path/to/rebuild 00002.ssif
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Uderstanding SSIF.SMAP

Post by mike admin »

ixceuh wrote:Is it like sourcefile, start offset, length of chunk ? (that's what it definitely looks to be, I'm just wondering what unit the smap file is using, since the biggest offset for one of my files is 6342720, file which is actually 13G ? multiples of 2048B ?)
Exactly. On any unix-based system one coul write a script that would output or execute plain DD commands to reconstruct SSIF file.
shane.cole
Posts: 6
Joined: Fri Oct 28, 2011 9:22 pm

Re: Uderstanding SSIF.SMAP

Post by shane.cole »

The Stereoscopic player plays SSIF files fine, however the SSIF file is of course the entire left eye and all the audio/subs as well as the right eye partner mts (which just relates to the video only as I understand it)

makemkv knows how to identify the mapping of the SSIF file to the interleaved blocks of the 2D + MVC mts files. Could makemkv not allow us to deselect all but the audio languages / subs we are interested in and output a new SSIF file only (which we can use on the Stereoscopic Player?)?

I know it isn't making a mkv strictly but it is still giving us the ability to take a 50GB blu-ray which has DTS-HD when i want the core only and 6 other languages and extract a movie only with one audio track and the original 3D to a single file that is 25-30gig that we can use in a player...

If not that perhaps mike could figure out a logical way to mux in the MVC mts data interleaved in to a MKV, give the specs to matroska and 3dtv.at (stereoscopic player creators) and watch the rest fall into line as a method.
mhelin
Posts: 5
Joined: Thu Dec 29, 2011 2:42 pm

Re: Uderstanding SSIF.SMAP

Post by mhelin »

Anybody downloaded the attachments above, please repost! They don't seem to be existing anymore.
mhelin
Posts: 5
Joined: Thu Dec 29, 2011 2:42 pm

Re: Uderstanding SSIF.SMAP

Post by mhelin »

mhelin wrote:Anybody downloaded the attachments above, please repost! They don't seem to be existing anymore.
Nevermind, should be easy to write the merger myself.

Is it possible to merge the 2 files (AVC+MVC) to make the ssif (=combined m2ts) file easily without the map generated by the makemkv? How is the map generated in the first place, read directly from the disk partitioning (UDF directory)? I gues you could demux the streams and remux (using eac3to, tsmuxer etc. tools) to make the single file which contains both AVC and MVC streams (+audio and subtitles), but is there an easier way (like directly reading the streams frame-by-frame or using GOP's)?
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Uderstanding SSIF.SMAP

Post by mike admin »

mhelin wrote:
mhelin wrote:Anybody downloaded the attachments above, please repost! They don't seem to be existing anymore.
Nevermind, should be easy to write the merger myself.

Is it possible to merge the 2 files (AVC+MVC) to make the ssif (=combined m2ts) file easily without the map generated by the makemkv? How is the map generated in the first place, read directly from the disk partitioning (UDF directory)? I gues you could demux the streams and remux (using eac3to, tsmuxer etc. tools) to make the single file which contains both AVC and MVC streams (+audio and subtitles), but is there an easier way (like directly reading the streams frame-by-frame or using GOP's)?
It's complicated. In theory CLPI file for a primary clip has a 3D extension that points to secondary clip and interleaving information. But in practice this data may be malformed, for example part of a new structure protection by disney are SSIF files that reference non-existing M2TS files.

MakeMKV always uses UDF layout to create ssif.map .
mhelin
Posts: 5
Joined: Thu Dec 29, 2011 2:42 pm

Re: Uderstanding SSIF.SMAP

Post by mhelin »

It's complicated.
Structure protection, yes of course.

Here's a beginning of the SSIF MAP of some BD. Seems that almost all right eye (dependent view=00006.m2ts, MVC stream) blocks interleaved are 0C60h*2048 bytes, and left view (AVC stream) about 2000h sectors. Does it really matter how the AVC and MVC stream relate to each other when interleaved? It would be easy to test using some statistically calculated distribution. This movie has about 2800 maps so you could just divide the file sizes by that and round it to closest one which is divident by 3*2048 (=6144, which is the size of the aligned data unit in m2ts). Might be though that if the player uses the CLPI information it wouldn't find correct 3D data.

I tested the mapping produced by MakeMKV (created the SSIF) and was able to play the movie on PowerDVD, so the UDF mapping can at least be trusted.


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

# SSIF MAP FILE v1
#
# Generated by MakeMKV v1.7.0 win(x64-release)
#

../00006.m2ts 00000000 00000C60
../00005.m2ts 00000000 00002040
../00006.m2ts 00000C60 00000C60
../00005.m2ts 00002040 00001A40
../00006.m2ts 000018C0 00000C60
../00005.m2ts 00003A80 00002040
../00006.m2ts 00002520 00000C60
../00005.m2ts 00005AC0 00001BC0
../00006.m2ts 00003180 00000C60
../00005.m2ts 00007680 00001CE0
../00006.m2ts 00003DE0 00000C60
../00005.m2ts 00009360 00001BC0
../00006.m2ts 00004A40 00000C60
../00005.m2ts 0000AF20 00002040

(and so on)
mhelin
Posts: 5
Joined: Thu Dec 29, 2011 2:42 pm

Re: Uderstanding SSIF.SMAP

Post by mhelin »

Ok, tried quickly creating the ssif.smap file by interleaving 0C60h MVC blocks and the same number of bigger AVC (base view, left eye) blocks to ssif file. The resulting SSIF was watchable by Stereoscopic Player but not without artifacts (they weren't huge, just small glitches in picture every now and then). I think the problem is that the timecodes for the blocks don't quite match and sometimes the player has to skip too big number of sectors. Got to try a better interleaving algorithm to time the base+dependent view blocks better later. The patent on MVC interleaving mentioned ATC (?) timecode being used and also that the interleaving of blu-ray is not so critical, can be done many ways. Obviously on optical media the interleaving must be perfect.
KurianOfBorg
Posts: 2
Joined: Sun Apr 08, 2012 7:28 am

Re: Uderstanding SSIF.SMAP

Post by KurianOfBorg »

I don't understand why any of this is required. On practically all my ISOs I have M2TS files in the Stream folder and the pre-interleaved SSIF 3D files in the Stream\SSIF folder. There is a corresponding SSIF file (say 00001.ssif for 00001.m2ts) for all the 3D streams in the movie. The SSIF file is around 33% bigger than the M2TS file. The total file size of the disc is over double the ISO size so it's obviously being virtually interleaved at the file system level when reading the ISO. The dependent 3D view is actually the next M2TS file in sequence (00001.m2ts + 00002.m2ts = 00001.ssif). The SSIF file is generated using a feature of ISO 9660 called Interleaved Mode based on the two M2TS files.

I can simply copy the main movie's SSIF file over to my HDD and play it in Stereoscopic player. A proper SSIF source filter and muxer would allow us to simply strip out the extra audio streams. It may be possible to strip out the audio streams from the original M2TS files themselves, and then use the ISO 9660 interleaving to obtain a smaller SSIF.
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Uderstanding SSIF.SMAP

Post by mike admin »

KurianOfBorg wrote:I don't understand why any of this is required. On practically all my ISOs I have M2TS files in the Stream folder and the pre-interleaved SSIF 3D files in the Stream\SSIF folder. There is a corresponding SSIF file (say 00001.ssif for 00001.m2ts) for all the 3D streams in the movie. The SSIF file is around 33% bigger than the M2TS file. The total file size of the disc is over double the ISO size so it's obviously being virtually interleaved at the file system level when reading the ISO. The dependent 3D view is actually the next M2TS file in sequence (00001.m2ts + 00002.m2ts = 00001.ssif). The SSIF file is generated using a feature of ISO 9660 called Interleaved Mode based on the two M2TS files.

I can simply copy the main movie's SSIF file over to my HDD and play it in Stereoscopic player. A proper SSIF source filter and muxer would allow us to simply strip out the extra audio streams. It may be possible to strip out the audio streams from the original M2TS files themselves, and then use the ISO 9660 interleaving to obtain a smaller SSIF.
SSIF file is not used for playback at all. SSIF is just an interleave of two M2TS files (not necessary with sequential numbers). Once the disc uses seamless branching, manipulation of SSIF files becomes tricky.
Post Reply