PDA

View Full Version : HELP - Creating custom AVCHD menu from scratch


deank
1st January 2009, 17:04
Hey there!

I'm trying to create custom menu from scratch but I have no luck so far.

Nero Vision 5 won't recognise my generated file if used for menu.

If I play it alone (with Nero Vision) - it says: AVC, interlaced, 1920x1080.. all okay.

If I use it for menu - Nero says: MPEG2, progressive (which is not true), 1920x1080... and I'll see black screen only - no menu - nothing.

Here are the files:

* My menu (http://www.deanbg.com/multiMENU.MTS)
* Nero menu (http://www.deanbg.com/neroMENU.MTS)

I can easily see that my output has additional 192 bytes in the header but can't figure out what to do.

If I can accomplish creating this file, then it's just matter of hours to make custom titled motion top menu, and decrease multiAVCHD size to 2MBs :)

I'm using aviSynth -> x264 -> tsMuxer to get my .MTS file.

Dean

G_M_C
2nd January 2009, 11:22
Could you post your AviSynth script and your x264 commandline ?

Also look as my first post in this thread, the .BAT/commandline i use work perfectly (for movies / M2TS thru tsMuxer): http://forum.doom9.org/showpost.php?p=1187360&postcount=1

PS: Everybody could use --partitions all in stead of omitting the 4x4.

PPS: I've seen suggestions that menu's can best be made @ 24p.

deank
2nd January 2009, 11:25
avisynth:

itab=" "
mmenu="\n\n\n\n\n"+itab+"Title#1"+"\n"+itab+"Title#2"+"\n"+itab+"Title#3"+"\n"+itab+"Title#4"+"\n"+itab+"Title#5"+"\n"+itab+"Title#6"+"\n"+itab+"Title#7"+"\n"+itab+"Title#8"+"\n"+itab+"Title#9"
lf=9
ImageSource("C:\Program Files\megui\tools\ffmpeg\bg.jpg", end = lf, use_DevIL=true)

#fadein(10)
Subtitle("\n\nmultiAVCHD TOP MENU", first_frame=0, last_frame=lf, font="Copperplate Gothic Bold", size=70, text_color=$e0e0e0, lsp=10, align=8)
Subtitle("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n multiAVCHD.deanbg.com", first_frame=0, last_frame=lf, font="Copperplate Gothic Bold", size=30, text_color=$606060, lsp=10, align=4)

Subtitle(mmenu, first_frame=0, last_frame=lf, font="Tahoma", size=66, text_color=$c0c0c0, lsp=10, align=7)
LanczosResize(1920,1080)
ConvertToYV12()
ConvertFPS(25)
trim(0,lf)
video = last
return video


x264


x264.exe --bitrate 50000 --interlaced --pulldown 1 --videoformat pal --keyint 25 --min-keyint 1 --ref 3 --mixed-refs --bframes 1 --weightb --subme 5 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 30000 --vbv-maxrate 50000 --qcomp 0.5 --merange 12 --threads auto --thread-input --progress --no-psnr --no-ssim --mvrange 511 --aud --nal-hrd --sar 1:1 --output %1.264 %1


It is not that the final m2ts is not playable. It is okay - just AVCHD players won't see it as a valid MENU file. If played alone - it shows okay.

G_M_C
2nd January 2009, 11:34
I've seen suggestions that menu's can best be made @ 24p.

So try ConvertFPS (24,1) or ConvertFPS (24000,1001) the first is true 24p (24.000 fps), the other is "NTSC 24p" (23.976 fps).

Anyway, vbv-maxrate is too high. It should best be: --vbv-maxrate 24000, vbv-bufsize 30000, and when you make another try: Dont forget to set --keyint equal to the framerate you use, rounded off (so 24 in the case of 23.976 for instance).

And finally; I think you can do without the video = last and return video lines.
How did the script itself play in Virtualdub for instance ?

deank
2nd January 2009, 11:44
No, it didn't work - just tried. May be it has to do with something inside *.BDMV files...

deank
2nd January 2009, 15:26
I suspect something else...

I think "button" information is stored inside menu m2ts files. I'll have to do some tests.

Could it be image information is stored as separate stream inside m2ts?

deank
2nd January 2009, 15:29
Anyway, vbv-maxrate is too high. It should best be: --vbv-maxrate 24000, vbv-bufsize 30000, and when you make another try: Dont forget to set --keyint equal to the framerate you use, rounded off (so 24 in the case of 23.976 for instance).

And finally; I think you can do without the video = last and return video lines.
How did the script itself play in Virtualdub for instance ?

It plays fine in MPC and even if I load .avs directly in Nero Showtime. I removed some lines from the script, that's why there are some extra lines.

I remember to set keyframe and other stuff :)

I just think that there may be something more with these menu m2ts files.

----

edit: I'm already ALMOST :) sure that MENU information (as buttons, navigation arrows, etc.) is stored inside m2ts, probably with special VideoID/MenuID. tsMuxer doesn't recognise these tracks and doesn't show them.

Is there some media-info tool that shows ALL tracks, not just VIDEO/AUDIO/SUBTITLES/FONTS?

~bT~
2nd January 2009, 15:36
^ avinaptic perhaps?

deank
2nd January 2009, 15:55
BDinfo showed:


Interactive Graphics English 3,784 kbps

STREAM DIAGNOSTICS:

File PID Type Codec Language Seconds Bitrate Bytes Packets
---- --- ---- ----- -------- --------------
00012.M2TS 5120 (0x1400) 0x91 IGS eng (English) 31,932 4 15*135 105


So.. that is the problem. I need to generate IGS.

idbirch2
2nd January 2009, 15:57
You might want to pm jdobbs and see if he can offer any insight. BDRebuilder is already capable of re-encoding BluRay menus and then manages to piece them back together, I doubt AVCHD menus are much different to BD ones.

deank
2nd January 2009, 16:58
I succeeded! :)

...to create a compatible blank navigational page :) with ac3 audio and navigational placeholders.

I used tsremux...

Now I need something to mux AVC+AC3+IGS into a new m2ts or just add AVC to existing m2ts, keeping other two tracks untouched.

deank
3rd January 2009, 15:35
I found the general ISO-13818-1/2 specification (suggested by jdobbs) and I'm planning to integrate TS muxing/demuxing capabilities in multiAVCHD.

This should help me to create custom transport stream files, containing video, audio and program streams (IGS navigation track).

Doing this is a great challenge for me and it may take a while.

Dean

idbirch2
3rd January 2009, 16:01
Sounds awesome Dean, I look forward to seeing what you come up with.

deank
6th January 2009, 13:34
Have anyone of you seen THUMBNAIL preview of an AVCHD folder on their PS3 or other AVCHD player?

There is a folder and files:

<root>\AVCHD\AVCHDTN\THUMB.TDT (which is a simple JPG)

and

<root>\AVCHD\AVCHDTN\THUMB.TID

Dean

robshot
9th January 2009, 17:14
I succeeded! :)

...to create a compatible blank navigational page :) with ac3 audio and navigational placeholders.

I used tsremux...

Now I need something to mux AVC+AC3+IGS into a new m2ts or just add AVC to existing m2ts, keeping other two tracks untouched.

How goes the investigation, deank? Do you think we can expect to be able to create custom menu soon?

cheers
robshot

deank
9th January 2009, 17:31
I need custom menu as badly as you, but progress is real slow :)

MadMonkey57
15th January 2009, 01:09
I found the general ISO-13818-1/2 specification (suggested by jdobbs) and I'm planning to integrate TS muxing/demuxing capabilities in multiAVCHD...

Wow a new muxing toy to play with! That would be nice.

Krawhitham
24th January 2009, 10:03
so how did you do it?

Glorioso
24th January 2009, 11:04
Have anyone of you seen THUMBNAIL preview of an AVCHD folder on their PS3 or other AVCHD player?

There is a folder and files:

<root>\AVCHD\AVCHDTN\THUMB.TDT (which is a simple JPG)

and

<root>\AVCHD\AVCHDTN\THUMB.TID

Dean
Thats a nice addition to the, already awesome, multiACVHD.

deank
24th January 2009, 12:51
so how did you do it?

It is mostly done by some program segments in movieobject.bdmv, playing m2ts menu files in correct order and using navigational m2ts file with no video stream / no background but navigational placeholders and navigational arrow.

This is where the problem arises. I can't get rid of the black background. I know there is a way to encode video as "transparent" as it is in "pop-up menus", but still haven't found a way.

Glorioso
24th January 2009, 19:45
Have anyone of you seen THUMBNAIL preview of an AVCHD folder on their PS3 or other AVCHD player?

There is a folder and files:

<root>\AVCHD\AVCHDTN\THUMB.TDT (which is a simple JPG)

and

<root>\AVCHD\AVCHDTN\THUMB.TID

Dean

deank, how can i manualy create the thumbnail?

deank
24th January 2009, 19:51
It was my question if anyone has ever seen such thumbnail.

The thumbnail is a small JPG file. PS3 doesn't show thumbnails from USB as we all know... I don't know how this could be used or it is just generated by AVCHD camcoders and Panasonic HD writer.

deank
26th January 2009, 18:52
Here's a small thought on the 'custom menu' issue...

Using avisynth and x264 for showing 10-40 lines of text is like using a bulldozer to dig a hole to plant a single flower.

Using Java TV and BD-J should make things far-far easier.

But before I start working on it - does anyone know if BD-J works if authored in AVCHD format written on a DVD or USB?

I've seen a lot of BD-J games in the past, but I can't make them work now.

deank
5th February 2009, 15:48
Is there an easy way to find the Palette Segment in a m2ts file?

I can change the color of the Interactive Graphics Stream, but I don't know what is in the color look-up table and the colors are randomly selected.

I see three values for color index + one for alpha (opacity).

For example I have these:

11101011 10000000 10000000 (EB 80 80 - WHITE)
00010000 10000000 10000000 (10 80 80 - BLACK)
10101101 00011010 00101010 (AD 1A 2A - GREEN)
00111111 11110000 01100110 (3F F0 66 - RED)

These represent the color and another byte for alpha.

I struggle to find how to use this 8 bit Index lookup table.

Thanks.

***

The first byte seems to be the luminosity strenght, the second and third define the color...
I'm not sure if it is in YCrCb format..

***

edit again..

It is YCrCb...

deank
5th February 2009, 17:05
I will implement custom color for IGS in multiAVCHD using RGB->YCrCb with the following settings

Y = CA*R + (1–CA–CB)*G + CB*B
R–Y = (1–CA)*R + (CA+CB–1)*G – CB*B
B–Y = –CA*R + (CA+CB–1)*G + (1–CB)*B

NTSC CA = 0.2568
NTSC CB = 0.0979

PAL CA = 0.1819
PAL CB = 0.0618

I decided to use NTSC and PAL CA/CB values as set by ITU 709 for full color range (0-255).

I will report after I test how it works.

deank
6th February 2009, 12:47
RGB to YCrCb conversion for IGS in multiAVCHD was taken from this page (http://www.fourcc.org/fccyvrgb.php)

Credits to the authors at www.fourcc.org.

wangzongjun
8th July 2010, 08:53
Can anybody help me?
I read a PES Packet from *****.m2ts file(TS packet's PID = 0x1400[Interactive Graphics Stream])and parse the PES header ,but i do not know the remain data.I think it hold the blu-ray menu information,such as palete,navigation command and so on.Can anyone give me some suggestion ?