Log in

View Full Version : Multiple AVC-videos+DTS/subs/multiaudio on one DVD(DL) or FAT32: AVCHD menu-generator


kaid
16th September 2008, 15:59
Okay, so I made it (and I'm quite proud! ;-): I've hacked my own menu driven AVCHD-DVD with several completely different H.264-tracks that plays beautifully on my PS3.
You get the full (PS3)AVCHD-featureset with all its pros and cons (as compared to playing H.264 in .mp4, .m2ts or .vob from the PS3 XMB):

Pros: Supports multiple audiotracks, DTS, AC3 (no AC3 in MP4, yes in m2ts/vob), subtitles and chaptermarkers

Cons: Video needs to be exactly 1280x720 or 1920x1080 and a certain framerate. I've verified 720p in 23,9 and 59,9fps, though 24, 50 and 60fps should also be possible according to the spec (http://www.avchd-info.org/format/index.html). I also verified 1080p to work with 24 and 23,9 fps, no go on 25fps in either 720p or 1080p! I could not find any material in 1080i that would work, though theoretically it should (in 60/50fps).. I have a creeping suspicion that tsMuxer's BD muxer is broken for 1080i, since I tried 3 different 1080is (25p/50fps, which is in the spec!) and all of them resulted in a black screen (PS3 needs to be reset)...
Update: I have seen 25fps AVCHDs play fine on PS3s connected via component (720p) and on composite on a normal TV. So the black screen seems to be a HDMI/HDCP issue, I'll try on other HDMI-monitors/TVs, maybe it's just mine! How is 25fps working out for you guys? Still no beef on 1080i AVCHDs, anyone ever got that to work with TsMuxer (or TsRemux)?

Of course the video itself must be playable on the PS3 (Levelflag set to 4.1 max, not too many reference frames), but the totally awesome tsMuxer (http://www.smlabs.net/tsmuxer_en.html) does a fantastic job in making everything but a few idiotic encodes (15 ref-frames for 1080p - right!) playable..

The Problem

Since H.264/AVC is pretty damn efficient, you can fit a lot of HD-content even on a good old DVD (even more so with DVD-DL). It's so efficient, that sometimes you would like to put multiple tracks onto one DVD because one does not fill it up (e.g. several documentaries or several episodes of a TV series).

Unfortunately tsMuxer's "BD mux" feature leaves a lot to be desired (especially in the Linux-version, where it simply does not seem to work!), since you cannot put multiple tracks onto one AVCHD. You can append tracks, but then they would have to have the same resolution and you'd need to set the chapter markers exactly right, it's not very pretty..

With my solution you can integrate several tracks with 1080p, 720p, AC3 and DTS to nicely fill up that DVD, DVD-DL or FAT32 volume to your heart's content - as long as the material is AVCHD-ready in general! You can now also use it to overcome the limitations of the XMB (no DTS/subtitles/multiple audiotracks) by using it as an intermediate to integrate your videos on a FAT32 volume! Split streams (see tsmuxers "split" tab) are now supported, so tracks over 4GB on FAT32 volumes are working..

Hacking your own menu driven AVCHD

I knew you guys would want to do the same thing, so I spent the last 2 days compiling a nice little package for you! ;-) It contains empty menu structures for AVCHDs with 2 to 6 tracks and a shellscript that chooses the right menu, creates the AVCHD-structure and does the integration of the single-track AVCHD/BD-structures that tsMuxer generated. Unfortunately very little is known about crafting your own AVCHD menues, so I don't know how to generate individual labels for buttons, title etc. So, for now, it's a generic menu (Track 1, Track 2 etc), but I spent some time to make it look nice. It's just a single static screen with overlays, but hey, it's in HD and has fancy shmancy alphablended overlays! ;-) Just write on the DVD itself which track is what...

The shellscript should be pretty foolproof and I went to great lengths to include many checks, good documentation and I extensively commented it. It runs under MacOS X, but Linux should be no problem (may need some minor tweaks)... Basically what it does is choosing the right menu for you and copying the .mpls/.clpi/.m2ts files where they belong (and naming them correctly). The .mpls files need a little binary tweaking to change the video they point to, hence perl is required (couldn't get sed to NOT add that stupid $0a linebreak at the end, sorry!)

Here's what you do: download the zip and extract it. Do NOT extract the menu tarballs (tgz), the script will do that for you when you need them!
Put the script and tarballs wherever you want to (preferrably somewhere within your $PATH), if the script does not find the tarballs it will ask where they are.

Start the script from a folder that contains one directory for each track you want to include. Make sure the total of all your videos fits onto one DVD/DVD-DL (or your FAT32 volume), and remember that muxing anything into .m2ts adds some extra padding! Right now anything from 2 to 6 tracks is supported, which should cover most needs.
Each directory should contain an AVCHD ready track (such as tsMuxer's "BD mux" generates, but stuff from your AVCHD-camera should work nicely, too - as long as it's numbered sequentially!), more specifically: The script is only looking for sequentially named .mpls, .clpi and .m2ts files within each track directory, and it does not matter where exactly they are and what they're called (well, as long as they still have the correct file extension and no spaces or other weird characters in the filename!)

After the script has done its job, either burn the contents of the generated avchd-Xitems folder onto DVD/DVD-DL with the burning program of your choice that supports UDF 2.5. Make sure the BDMV and CERTIFICATE folders are on the root level, otherwise it will not work. Or, if you chose FAT32, copy the AVCHD folder into the root of your FAT32 volume.

Here's what it looks like:
http://www.koolex.net/deekay/AVCHDmenu-prv.jpg

Enjoy your menu-driven AVCHD on your PS3! ;-) Press Square to switch between menu and video, when a track is finished it will jump back to the menu automatically. So far the PS3 is all I could test on, but it should work on other BD-players, too (especially those from Sony and Panasonic, since they mainly specified the AVCHD format). If you have a regular BD-player, please let me know if it works for you...

Update v0.2: I added support for FAT32 output. Split file support will come soon. Is there any need to accept FAT32 AVC input, too, e.g. from a Flash-based camera? If so, I must know if the .MPL files do reference MTS or M2TS (right now I did not change the M2TS to MTS within the MPL for the output, it works nonetheless! The PS3 seems to have some fault-tolerance built in there! ;-)

Update v0.3: Added split stream support as promised, so the 4GB limit of FAT32 volumes should not be an issue anymore. Up to 16 chunks per track are supported, which covers tracks up to 64GB at 4GB per chunk. Quite often there's a pause and/or the PS3 skips a few seconds when going from one chunk to the next (sometimes over 20 seconds!), but I've verified this to be the exact same behaviour with the original tsMuxer BD-muxed structure, so it's not my fault. But maybe that's just my 1GB FAT16 USB-stick, or I just split my testfiles too small (30MB).. Feel free to try this with larger files and on other media and let me know your findings!

Download AVCHD-menugenerator v0.3 (for anything that can run bash-scripts) (http://www.koolex.net/deekay/avchd-menu-generator-v0.3.zip)

Version History

v0.1 - 16th Sep 2009:
initial release

v0.2 - 19th Sep 2009:
-support for FAT32 AVCHD folders
-minor updates (tarball-dir endslash irrelevant, cannot enter wrong path)

v0.3 - 22nd Sep 2009:
-support for split tracks (up to 16 chunks) to compensate for the 4GB FAT32-limit
-minor improvements

mmace
17th September 2008, 13:05
brilliant, thanks for this, will give it a go over the weekend

jagaskywalker
18th September 2008, 17:38
I think this is very good news !

Thanks for your effort.

I already see a couple of points for improvement:

- could you make it work for FAT32 devices ? The only differences would be in the filenaming (8.3 formatted). Many of us are using FAT32 hard disks to store data and a menu to access it from the PS3 would be great.

- allow for multiple-tracks per "movie". Due to the fact that FAT32 is limited to 4 Gb files we usually split the files in <4Gb chunks (AVCHD cameras also generate a separate file per scene).

Do you think you could manage with this ?

THX

kaid
18th September 2008, 19:23
I think this is very good news !

Thanks for your effort.

I already see a couple of points for improvement:

- could you make it work for FAT32 devices ? The only differences would be in the filenaming (8.3 formatted). Many of us are using FAT32 hard disks to store data and a menu to access it from the PS3 would be great.

- allow for multiple-tracks per "movie". Due to the fact that FAT32 is limited to 4 Gb files we usually split the files in <4Gb chunks (AVCHD cameras also generate a separate file per scene).

Do you think you could manage with this ?

THX

The first should not be fairly easy, since as far as I know a FAT32 AVCHD folder only differs from an UDF AVCHD in the filenames. If that's not the case and the filename is also stored somewhere in the files (i know it is in the .mpls files, but i'm patching that already, so changing M2TS to MTS shan't be a problem!) I'll try to patch it.

The second is a little more tricky, since I need to rework my script to handle multiple m2ts, clpi and mpls files, the copy loop also needs to be rewritten. But it should also be doable....
When I find some time I'll work on it, prolly next week...

fffuusky
18th September 2008, 21:52
Removed: Spam

kaid
19th September 2008, 02:54
Jaga, your request just sparked an idea: Theoretically one could use my menu as a dummy to overcome the limitations of the XMB by using a FAT32 formatted external HD with my FAT32-compatible Menu as a frontend and "injecting" whatever you want to watch - with DTS, multiple audiotracks or subtitles...
Basically someone could make a simple drag & drop solution for MKVs that does all the work for you: putting it through tsmuxer, muxing it as BD, splitting it and moving/modifying the files accordingly! ;-)
The problem so far is that if you used an AVCHD folder on a FAT32 volume, it was the only track you could play. Not so anymore with my menu! ;-D

The problem of cropped video not being AVCHD compatible however remains.. Someone knows if uncropping without re-encoding the whole video is possible at all? I mean macroblocks are still macroblocks, right? Adding a few black ones on the top and bottom should theoretically be possible... But then again I have only a vague idea of all the far-out tricks that H.264 uses, so I should not make such assumptions... ;-)

jagaskywalker
19th September 2008, 08:41
The first should not be fairly easy, since as far as I know a FAT32 AVCHD folder only differs from an UDF AVCHD in the filenames....

As far as I know the only difference is in the filenames, and there is no change within them.... (although my experience is only for AVCHD disks without menu...)

Thank you for taking on board the recommendations. Actually what I would like to see is what you describe in your last post... a way to select among different AVCHD encoded files from within the XMB in the PS3...

kaid
19th September 2008, 16:23
Version update. Added FAT32 support, minor improvements. Split file support coming soon!...

frank
19th September 2008, 20:09
It runs under MacOS X, but Linux should be no problem
Should be written in the title!!!

What can xp users do??

kaid
19th September 2008, 21:56
Should be written in the title!!!

Okay, I'll do that the minute Windows-users do the same thing to all their threads! ;-)

What can xp users do??

Install Linux or MacOS X! ;-D Or install Cygwin (http://www.cygwin.com/). It's just a script, should work right out of the box! ;-)

Atak_Snajpera
21st September 2008, 22:17
Install Linux or MacOS X!
most people use windows if you didn't know. BTW Good idea but we need win version...

kaid
21st September 2008, 22:26
most people use windows if you didn't know.

No, I did not know! ;-)

BTW Good idea but we need win version...

Yeah, just like we need Linux/MacOS versions of avisynth, besweet, megui, tsmuxer, tsremux, mkv2vob, godsent etc/pp!... ;-)

kaid
22nd September 2008, 14:46
Version update. Split streams are now supported...

cantonesejim
15th October 2008, 02:33
any news on a version with more menu items?

Krawhitham
15th October 2008, 08:50
Is it possible to add a "Play All" option to the next version?

kaid
16th October 2008, 03:01
any news on a version with more menu items?

Well technically I could *maybe* support one more with a bit of hacking in the .mpls, maybe two, but I'd have to investigate first. But I think you want way more? ;-)

So is anyone actually using this? I haven't heard from anyone... Please do report on how it works for you!

kaid
16th October 2008, 03:05
Is it possible to add a "Play All" option to the next version?

*Maybe*, but I don't want to get your hopes too high! ;-) It may be possible to hack a special .mpls that plays all the files sequentially and link that to an extra menu item.. I have the tsremux source now which has BD/AVCHD generation in it, i expect to learn quite a bit about the structure from that...

But I won't have time to work on it within the next few weeks though...

cantonesejim
27th October 2008, 05:58
well i was thinking of maybe a max of 20 selections, i have a bunch of 2-4minute clips in 720p that i want to keep separate and distribute to friends and family on DVD5s

Krawhitham
6th November 2008, 01:37
*Maybe*, but I don't want to get your hopes too high! ;-) It may be possible to hack a special .mpls that plays all the files sequentially and link that to an extra menu item.. I have the tsremux source now which has BD/AVCHD generation in it, i expect to learn quite a bit about the structure from that...

But I won't have time to work on it within the next few weeks though...

any news?

deank
21st December 2008, 12:24
I'm working on something and will post the results later.

Windows executable (gui) that will let you:

* fix wrong clpi info generated by tsmuxer
* convert to 8.3 filenames
* generate avchd folder, containing multiple tracks (as kaid script does)

Dean

magnop
21st December 2008, 13:38
I'm working on something and will post the results later.

Windows executable (gui) that will let you:

* fix wrong clpi info generated by tsmuxer
* convert to 8.3 filenames
* generate avchd folder, containing multiple tracks (as kaid script does)

Dean

Great!

:thanks:

b66pak
21st December 2008, 20:07
i can't wait to see a win solution!
_

n0mag!c
21st December 2008, 22:32
I'm working on ... Windows executable (gui) that will let you:
* generate avchd folder, containing multiple tracks (as kaid script does)
This would be great, especially if it will support up to about 50 titles, including splitted titles by TsMuxer.

deank
22nd December 2008, 15:07
A little update...

I'm ready with the 'command-line' portion of the program.

So far, so good. It has a limit of up-to 999 .m2ts/.cpli/.mpls segments.

Something interesting happened...

I have some files encoded at AVC High@5.1 profile, which wouldn't play until now.

I made a compilation of 4 tracks:

1: 1920x1080p
2: 1280x720p
3: 1920x1080i (High@5.1)
4: 1280x576p

They all show and play (consecutively), show subtitles and everything. (Of course track#4 shows green bars :) )

Will post again later.

Dean

----

GUI Features:
---------------
* Select multiple .mkv files to add to AVCHD-multi structure (.srt subtites and embeded ones will be added)
* Select multiple AVCHD/Blu-Ray-Disk folders to add to AVCHD-multi structure
* Select folder, containing multiple AVCHD/Blu-Ray compliant folders:
--- GUI is searching for BMVD\index.bmv*, so AVCHD name is not mandatory, nor 8.3 naming
--- i.e. you may name the folders: My_birthday, test_movie, presentation, hdtvtest, etc...
--- it is important that they have BDMV subfolder and all playlists/clipinfo-files inside
* All clip-inf files are fixed
* GUI processes all selected files and compiles them in a single AVCHD/Blu-Ray format folder,
--- providing Track# selection in player menu
--- overall .m2ts files count should not exceed 1000

~bT~
23rd December 2008, 01:03
^ dude, that is awesome! i cant wait :D

deank
23rd December 2008, 18:29
Here is the initial version:

The thread of multiAVCHD is http://forum.doom9.org/showthread.php?p=1228044#post1228044.

Please post your questions, comments and requests there.

zoner
23rd December 2008, 18:41
Thanks ALOT! Exactly what i needed :)

I just got 2 questions: 1. What the current beta can do?
2. Why is it 112MB? :S


EDIT: The torrent doesn't seem to work, dont know why...

deank
23rd December 2008, 21:07
If someone could test the program with a stand-alone BD player and share their experience it would be great.

Thanks beforehand.

Dean

Deepstar
23rd December 2008, 21:36
Hi,
its a great Tool!
Insert a option, that you can move, instead copy the Files. If you have multiple AVCHD Folders on a USB HDD, there is no need to have the same m2ts Files twice.

Deepstar

n0mag!c
23rd December 2008, 22:15
Support for more than 10 titles is badly needed!
Can you add nested menu items? This will solves the problem.

deank
24th December 2008, 01:38
Hi,
its a great Tool!
Insert a option, that you can move, instead copy the Files. If you have multiple AVCHD Folders on a USB HDD, there is no need to have the same m2ts Files twice.

Deepstar

It's just a beta, programmed in couple of hours... Everyone is pulling me away from the computer, so I wasn't able to do everything I wanted...

Next release will include:

copy/move option
re-arrange selected folders list (up/down/delete)
10 titles were just for a test - next version will be unlimited in titles/tracks number

Dean

Krawhitham
24th December 2008, 06:33
Tested on 6 episodes

Page one works (1-5)
Page two (6-10) all link to episode #1

deank
24th December 2008, 11:20
Are you sure about this?

While playing a title (from 1 to 5) can you select directly title 6 from your player's navigation menu?

The default for all titles is 1, so all 10 point to #1. If you correctly loaded 6 folders, then title 6 should point to folder 6, not 1.

What player did you test it on?

Dean

zoner
24th December 2008, 12:53
Something is wierd i loaded 3 eps named 1 ,2 ,3 and in another case a b & c
and in each time ep2 was 1 on the menu, ep3 was 2 on the menu and ep1 was 3 on the menu.
this is correct for both folder labels, to make it in order i had to hexedit the mpls files.

how does your GUI determines the order of the files?

deank
24th December 2008, 13:36
Do you add folders one by one, or you select a folder that contains these 3 subfolders?

If folders are added one by one - no sorting is performed.

If you select a folder, that contains other AVCHD folders - their order is shown in the MAIN tab of the program.

deank
24th December 2008, 15:14
Quick update...

I uploaded a new version (EXE only)...
See it in the previous post with the screenshot..

Added up/down/delete/clear buttons to arrange folder list before creating multiavchd folder.
For now... MKV files are imported, but SKIPPED while processing... Will add functionality later.

Executable only (for updating purposes): multiavchd.exe (http://multiavchd.deanbg.com/multiavchd.exe)

zoner
24th December 2008, 15:33
Well, i just tried the new update and i sorted the same folder as a, b & c
but somehow its still gets it wrong i dont know why...
so i always finding b on 1 slot on the menu, c on #2 on the menu and a on #3 slot on the menu

musky5789
24th December 2008, 16:20
great prog mate,
Theres just one thing that needs to be added,
how can i put my custom menus ive made with scenarist?
I have replaced the mts files, and the menu comes up with my menu, but the buttons are not there

deank
24th December 2008, 17:31
Well, i just tried the new update

@zoner: I just uploaded the fixed exe... the previous update was for gui buttons and stuff.. not fixing wrong clips...


@musky5789:

It is not that easy... replacing .mts files is the easiest step.
movieobj.bdm contains little programs, that tell your player what to do with all playlists/videos/etc...

without proper changes to movieobj.bdm your menus won't come up the way you want.

for now you'll be stuck with my menu :)
later i will see what could be done.

Krawhitham
24th December 2008, 18:17
Are you sure about this?

While playing a title (from 1 to 5) can you select directly title 6 from your player's navigation menu?

The default for all titles is 1, so all 10 point to #1. If you correctly loaded 6 folders, then title 6 should point to folder 6, not 1.

What player did you test it on?

Dean

Cyberlink Power Dvd

Buttons 1-5 launches titles 1-5 (EP 1-5)
Button 6 launches title 7 (ep1)
Button 7 launches title 7 (ep1)
Button 8 launches title 8 (ep1)
Button 9 launches title 9 (ep1)
Button 10 launches title 10 (ep1)

If I select to goto title 6 it plays title 7 plus when title 5 is finished title 7 starts

deank
25th December 2008, 11:14
This is fixed and a new version is available...

Now MKV -> AVCHD support is functional.

Move instead of copy will be added as an option later.

* Update check and info added in log tab
* Author messages added in log tab
* mkvinfo & tsmuxer used for mkv->avchd conversion, so download again the full package


I will open a new thread for my program to avoid confusion with kaid's perl script.

Dean

Deepstar
25th December 2008, 18:03
Hi,
can you add jddobs fixclpi Tool? This were great.
An idea: if you already create a avchd dir with your Tool. An option that you add another avchd dir. Without add the menufiles.
In the moment there is an error. Because the the Tool think the menufiles is an movie.
You did a great job :thanks:

deank
26th December 2008, 09:13
So :) it is done. Test it.

I searched the forum, but couldn't find the thread with fixcli.exe.

Can you help with that?

And what exactly does it fix?

The thread of multiAVCHD is http://forum.doom9.org/showthread.php?p=1228044#post1228044.

Please post your further questions/reports there.

nosnoop
26th December 2008, 09:54
I searched the forum, but couldn't find the thread with fixcli.exe.
Can you help with that?
And what exactly does it fix?


Here's the post by jdobbs with his fixclpi utility:
http://forum.doom9.org/showthread.php?p=1207492#post1207492

And his description of tsMuxeR's bug:
TSMUXER seems to have a small bug that causes fast-forward, rewind, and seeking issues when creating Blu-ray output.

It appears as though the COARSE/FINE table relationship in the .CLPI file isn't being structured properly. The program correctly creates a new COARSE entry with the PTS rolls over (the LSBs contained in the FINE table get to a point where they will require an increment in the COARSE table). But it appears it doesn't do so (at least not always) when the same thing happens to the COARSE/FINE SPN. As a result, you have combined SPN pointers that suddenly drop to very small values (at least until the next COARSE reference)...

causing glitches in rewind and forwarding video.

deank
29th December 2008, 21:06
It is added in multiAVCHD (yet not visible) but when applied, the tool always says: "Not a valid CLPI file..." or something alike...

Strange...