Log in

View Full Version : Attempt to centralize info on BD reencoding, transcoding or muxing


G_M_C
23rd September 2008, 08:42
In another tread i tried to make a start to centralize all info we might need to make our own BD9's. I did that cause i've been browsing through this forum, and discussing about this subject for a few moths now. In that time i found 1 important thing; All information about this is fragmented and spreaded all over this forum. some parts contain the discussions about the VBV-rate, or GOP rate; Other parts contain all kinds of discussions about the muxing-programms etc.

What i allso see is that there are all kins of threads on BD-reencoding, transcoding or remuxing all over the place. And since i've been discussing this subject for a while now, I know that answers to many of those questions could have been found through :search: .

So in this tread/post i want to try to get al relevant links to all posts made up till now assembled. In a later stadium we could "assimilate" all info gathered into a more comprehensible form and/or guide or whatever. I'll start with posting all links i remember and can re-find here in htis thread. PM me if you have more that is relevant/interesting to put here, dont post to many loose questions in this thread, cause it will get confusing again (and thats exactly what we're trying to stop).

So here goes;
>> External (EMediaLive) << The Authoritative Blu-ray Disc (BD) FAQ (http://www.emedialive.com/Articles/ReadArticle.aspx?ArticleID=11392)
>> External (avchd-info) << Official AVCHD-specs (used as basis for some parameters in x264) (http://www.avchd-info.org/format/index.html)


>> Internal << Discussion about keyint / GOP-length (x 264 settings) (http://forum.doom9.org/showthread.php?p=1178034#post1178034)
>> Internal << More about --keyint (in discussion with jdobbs) (http://forum.doom9.org/showthread.php?p=1178480#post1178480)
>> Internal << Discussion about maximum bitrate and VBV buffersize (http://forum.doom9.org/showthread.php?p=1181884#post1181884)
>> Internal << New findings on maximum bitrate and VBV buffersize (http://forum.doom9.org/showthread.php?p=1222422#post1222422)
Also in that thread the final settings on Key-int en GOP-size;


- GOP must be at 1 sec if you use max bitrate > 15 Mbps and 2 sec for max bitrate < 15 Mbps (24 or 48 frames for 1080p24).

As example for the x264 settings, I give the short .BAT I use for encoding;


Edited on 15/12/2008
1) Use the new findings on maximum bitrate and VBV buffersize and new info on keyint / GOP size;

The correct settings for keyframe-interval depends on the max bitrate of your encode:
When the max bitrate < 15000 kbps, then keyint = 2 x framerate (rounded off) (You need to edit the .BAT if you use < 15 Mbps maxrate).
When the max bitrate > 15000 kBps, then keyint = framerate (ronded off)

min-keyint is always 1.


@SET IN_TITLE="........"
@SET IN_BITRATE= .....
@set IN_EXTRA= (Extra options, for instance --zones 0,128800,b=1/128801,140153,b=0.5, not between "")

@Echo off
Echo .
Echo .
Echo .
Echo .[ %IN_TITLE% ] [%TIME% ] Encoding Pass 1
Echo .
Echo .
Echo .

"path to x264.exe\x264.exe" --threads auto --thread-input --progress --no-psnr --no-ssim "%IN_TITLE%.AVS" --stats "%IN_TITLE%.stats" --output NUL --pass 1 --bitrate %IN_BITRATE% --vbv-bufsize 30000 --vbv-maxrate 24000 --level 4.1 --keyint set yourself --min-keyint 1 --nal-hrd --aud --sar 1:1 --bframes 3 --b-adapt 2 --b-pyramid --weightb --ref 3 --mixed-refs --no-fast-pskip --ipratio 1.2 --pbratio 1.2 --direct auto --subme 2 --trellis 2 --psy-rd 0.8:0.7 --partitions none --me dia --merange 24 --mvrange 511 --aq-strength 0.9 --cqmfile "path to eqm_avc_hr.cfg\eqm_avc_hr.cfg" %IN_EXTRA%


Echo .
Echo .
Echo .
Echo .[ %IN_TITLE% ] [%TIME% ] Encoding Pass 2
Echo .
Echo .
Echo .


"path to x264.exe\x264.exe" --threads auto --thread-input --progress --no-psnr --no-ssim "%IN_TITLE%.AVS" --stats "%IN_TITLE%.stats" --output "%IN_TITLE%.264" --pass 2 --bitrate %IN_BITRATE% --vbv-bufsize 30000 --vbv-maxrate 24000 --level 4.1 --keyint set yourself --min-keyint 1 --nal-hrd --aud --sar 1:1 --bframes 3 --b-adapt 2 --b-pyramid --weightb --ref 3 --mixed-refs --no-fast-pskip --ipratio 1.2 --pbratio 1.2 --direct auto --subme 9 --trellis 2 --psy-rd 0.8:0.7 --partitions all --8x8dct --me umh --merange 24 --mvrange 511 --aq-strength 0.9 --cqmfile "path to eqm_avc_hr.cfg\eqm_avc_hr.cfg" %IN_EXTRA%

Echo .
Echo .
Echo .
Echo .[ %IN_TITLE% ] [%TIME% ] Encoding Finished !

Pause


PS: Others speak only of keyframe-interval of 24, so try with a DVD-RW to see what works best.

>> Internal << Multiple HD-videos on one DVD - Hacking your own menu driven AVCHD (Mini-BD/BD5/BD9) (http://forum.doom9.org/showthread.php?p=1184425#post1184425)
>> Internal << Workaround for tsMuxeR to get fforward/reverse working (http://forum.doom9.org/showthread.php?p=1168293#post1168293)
>> Internal << Workaround for muxing TrueHD / DTSMA (http://forum.doom9.org/showthread.php?p=1170182#post1170182)
>> Internal << How to force a subtitle "on" by default after muxing with tsMuxeR (http://forum.doom9.org/showthread.php?p=1224266#post1224266)

>> Internal << thread containing kaid's progress to find out the exact specs and structure of the AVCHD/BD files (bdmv, .clpi, .mpls and .m2ts) (http://forum.doom9.org/showthread.php?p=1187136#post1187136)
>> Internal << thread containing jdobbs progress into BD-reencoding Blu-Ray~DVD Backup & Conversion (http://forum.doom9.org/showthread.php?t=135335)

shon3i
9th December 2008, 23:31
We should talk about possible bugs into SmartLabs TSMuxeR like is fforward/reverse and wrong chaprters which fixed by jdobbs fixcipi little tool. G_M_C what is you knowlege on this, and what options you ticked in TsMuxeR?

G_M_C
10th December 2008, 15:39
We should talk about possible bugs into SmartLabs TSMuxeR like is fforward/reverse and wrong chaprters which fixed by jdobbs fixcipi little tool. G_M_C what is you knowlege on this, and what options you ticked in TsMuxeR?

What were the problems fixclpi was supposed to fix by the way ? How can i notice these problems and/or test for them ?

I don't use fixclpi; I've seen 1 report that it creates new problems for the BD30 (which i have), and i dont have problems with the chapters (or simply havent noticed them yet).

The other thing is that i find it a bit bothersome in usage. When i have multiple m2ts'es and multiple .clpi's, i have to invoke fixclpi multiple times (in other words, it doesn't accept wildcards like ? or *, "fixcpli *.cpli" doesn't work) An you need to look at the clpi's in 2 directory's anyway. When jdobbs is back on the forum regularly i will ask him about this, but i think he is still hard at work on his job atm and i don't want to bother him yet.

Anyway, there are several reports on the tsMuxeR tread that a new version was coming in january. Might be that they fixed the problem. Anyway, they asked us to send in bug-reports by e-mail, so they can look at the problems and/or fix them.

PS: Hopefully they keep tsMuxeR a "free" software, especially after asking us for help .

rack04
10th December 2008, 17:08
You haven't experienced any issues on your standalone with b pyramid?

G_M_C
10th December 2008, 19:30
You haven't experienced any issues on your standalone with b pyramid?

Nope, i used the above commandline to make a back-up of Wall-E for instance (for the kids ... They tend to destroy discs, a backup on DVD+R DL is cheaper than buying a new BD :p )

shon3i
11th December 2008, 23:22
What were the problems fixclpi was supposed to fix by the way ? How can i notice these problems and/or test for them ?Because i use same idea as in DVDRebulder and probably in BDRebuilder, i split every movie in chapters, and encode all chapters seperatly, to make keyframes on beginig of chapter's because i want to be closest possible like in original. Without Fixcipi, chapters are showed wrong, i mean when i select chapter at position for example 00:02:00.00, i jump to near that, after fixing cipi i get right positions, just at time :)

jdobbs
12th December 2008, 13:24
What were the problems fixclpi was supposed to fix by the way ? How can i notice these problems and/or test for them ?A table in the CLPI is incorrectly formed by TSMUXER. FIXCLPI fixes it. Not maybe, not sometimes, not "but what if?" It is simple: wrong/fix. If your player somehow gets around the incorrectly formed table, then good for you. But it doesn't change the fact that it is wrong and may cause problems if played elsewhere. The problem is exibited by errors in seeking, chapter jumps, fast forward and/or rewinding.I've seen 1 report that it creates new problems for the BD30Frankly I don't care if you use it or not -- but somebody is talking B.S. -- how can a correctly formed table somehow work worse than an incorrectly formed table?

You find a problem. Tell people about it. Provide a free fix. And then still feel as if you have to defend it. People just crack me up.

gav1577
12th December 2008, 23:17
Thanks jdobbs for the fix it works great chapters now skip like they should :)

G_M_C
13th December 2008, 09:56
A table in the CLPI is incorrectly formed by TSMUXER. FIXCLPI fixes it. Not maybe, not sometimes, not "but what if?" It is simple: wrong/fix. If your player somehow gets around the incorrectly formed table, then good for you. But it doesn't change the fact that it is wrong and may cause problems if played elsewhere. The problem is exibited by errors in seeking, chapter jumps, fast forward and/or rewinding.Frankly I don't care if you use it or not -- but somebody is talking B.S. -- how can a correctly formed table somehow work worse than an incorrectly formed table?

You find a problem. Tell people about it. Provide a free fix. And then still feel as if you have to defend it. People just crack me up.

Pleas re-regard my post, it wasn't that hostile as you make it seem to be, or at least it wasnt intended that way !

jdobbs
13th December 2008, 11:52
No problem. It was a combination of your post with others that seem to imply that correcting the table wasn't needed or that somehow it is better to not run the fix. To me that's like saying "sometimes its better to leave the fly in your soup." Frankly I'm a little surprised that it hasn't been fixed within TSMUXER yet. There are lots of people creating BD discs right now that simply aren't right.

laserfan
13th December 2008, 17:54
Because I like Chapter Stops (markers) a lot, and re-encoding to x264 means that original locations gleaned from a commercial disc are no longer accurate, I use Avidemux to find the I-frames in the re-encoded video, and then tsMuxeR to BD format with an edited meta file (with new custom-chapter locs). The final step is to fixclpi the two files in the BDMV.

The Avidemux step is a PIA cuz it involves re-indexing the new video.x264, but of course fixclpi is fast & easy. Hope they fix it in tsMuxeR next update!?

MadMonkey57
14th December 2008, 12:47
My Panasonic BD35 (EU version) can play Blu-Ray content produced by tsmuxer on DVD. The same Blu Ray content patched with fixclpi on DVD is rejected by the BD35.

This (and my finding in this post (http://forum.doom9.org/showthread.php?p=1221560#post1221560)) drives me to the possibility that the BD35 doesn't like some types of compliant Blu Ray content burned on DVD.

Maybe a firmware update will fix that.

Capsbackup
14th December 2008, 23:55
I tried the Panasonic BD35 (NTSC) and it would not play any of my AVCHD discs made with tsMuxeR_1.8.8(b) and fixclpi, burned on Verbatim DVD+RW media. However my Sony BDPS-350 plays everyone of them perfectly, including chapter advance and FF/RW.

MadMonkey57
15th December 2008, 21:32
I tried the Panasonic BD35 (NTSC) and it would not play any of my AVCHD discs made with tsMuxeR_1.8.8(b) and fixclpi, burned on Verbatim DVD+RW media. However my Sony BDPS-350 plays everyone of them perfectly, including chapter advance and FF/RW.

There's a firmware upgrade to version 1.6 for US players.
Have you applied it ?

G_M_C
15th December 2008, 22:24
Added a link to an interesting discussion of --vbv-maxrate / --vbv-bufsize.

1) It looks more and more like the assumption of 3x DVD speed for max transferrate for BD9 is true.
2) Also more and better info on keyinterval / GOP size
3) Based on the discussion i've adapted my .BAT to --vbv-maxrate 24000 (kbps) --vbv-bufsize 30000 (kB) Also edited the info on keyint. See first post.

Link: http://forum.doom9.org/showthread.php?t=143317

PS: Not too many posts on the Firmware-upgrades of players in this thread please !

rack04
15th December 2008, 22:31
There's a firmware upgrade to version 1.6 for US players.
Have you applied it ?

I am very interested in this since I have a BD-35 sitting under the Christmas tree.

MadMonkey57
15th December 2008, 23:06
I've encoded / burned / watched 20 BD5 with a custom MEGui profile (Sharktooth's Standalone Blu Ray Profile a tiny bit altered with vbv-maxrate 15000, vbv-bufsize 15000, keyint left unchanged at 24).
So far so good on my standalone Panasonic BD35.

rack04
15th December 2008, 23:09
I've encoded / burned / watched 20 BD5 with a custom MEGui profile (Sharktooth's Standalone Blu Ray Profile a tiny bit altered with vbv-maxrate 15000, vbv-bufsize 15000, keyint left unchanged at 24).
So far so good on my standalone Panasonic BD35.

Have you tried with b pyramid enabled?

MadMonkey57
15th December 2008, 23:20
Have you tried with b pyramid enabled?

No, it is not enabled in Sharktooth's Blu Ray profile.

--pass 2 --bitrate #### --stats ".stats" --level 4.1 --keyint 24 --min-keyint 2 --ref 3 --mixed-refs --bframes 3
--weightb --direct auto --deblock -1:-1 --subme 7 --trellis 2 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct
--ipratio 1.1 --pbratio 1.1 --vbv-bufsize 15000 --vbv-maxrate 15000 --qcomp 0.5 --me umh --threads auto
--thread-input --progress --no-psnr --no-ssim --output "output" "input" --mvrange 511 --aud --nal-hrd --sar 1:1

I wasn't brave enough to give it a try...:o

rack04
15th December 2008, 23:27
Here is my .bat file.

@SET x264_PATH=
@SET INPUT_VIDEO=
@SET WORKING_DIRECTORY=
@SET OUTPUT_FILENAME=
@SET DESIRED_BITRATE=

"%x264_PATH%" --pass 1 --bitrate %DESIRED_BITRATE% --stats "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%.stats" --level 4.1
--keyint 24 --min-keyint 1 --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto --deblock -1:-1 --subme 2
--partitions none --vbv-bufsize 30000 --vbv-maxrate 24000 --qcomp 0.5 --me dia --merange 24 --threads auto --thread-input
--sar 1:1 --progress --no-psnr --no-ssim --output NUL "%INPUT_VIDEO%" --mvrange 511 --aud --nal-hrd

"%x264_PATH%" --pass 2 --bitrate %DESIRED_BITRATE% --stats "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%.stats" --level 4.1
--keyint 24 --min-keyint 1 --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-adapt 2 --b-pyramid --weightb
--direct auto --deblock -1:-1 --subme 7 --trellis 2 --partitions all --8x8dct --vbv-bufsize 30000 --vbv-maxrate 24000
--qcomp 0.5 --me umh --merange 24 --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim
--output "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%-output.h264" "%INPUT_VIDEO%" --mvrange 511 --aud --nal-hrd

Capsbackup
16th December 2008, 04:50
There's a firmware upgrade to version 1.6 for US players.
Have you applied it ?
Yes I did download the update, but still no playback with BD-35. Not sure why the Sony plays back but Panasonic does not. All discs were burned with IMGBurn and UDF 2.50.

MadMonkey57
16th December 2008, 10:09
Added a link to an interesting discussion of --vbv-maxrate / --vbv-bufsize.

1) It looks more and more like the assumption of 3x DVD speed for max transferrate for BD9 is true.
2) Also more and better info on keyinterval / GOP size
3) Based on the discussion i've adapted my .BAT to --vbv-maxrate 24000 (kbps) --vbv-bufsize 30000 (kB) Also edited the info on keyint. See first post.

Link: http://forum.doom9.org/showthread.php?t=143317

PS: Not too many posts on the Firmware-upgrades of players in this thread please !

Yes I did download the update, but still no playback with BD-35. Not sure why the Sony plays back but Panasonic does not. All discs were burned with IMGBurn and UDF 2.50.

@Capsbackup : G_M_C is right. This thread is not appropriate for this kind of talk. "Hardware Players" is a much better place for this. This thread (http://forum.doom9.org/showthread.php?t=143075) may be a good start.

:thanks:

G_M_C
16th December 2008, 10:29
@Capsbackup : G_M_C is right. This thread is not appropriate for this kind of talk. "Hardware Players" is a much better place for this. This thread (http://forum.doom9.org/showthread.php?t=143075) may be a good start.

:thanks:

Thx MadMonkey57 :)

And also thanx for you work on enabling subtitles by default. Added the link to your work in the first post.

One question though: What if i mux in multiple subtitles, and i want to enable for instance sub #2 ? My quess is that you then enter the bottom IMM field to 1 . I'm just guessing this though :p

(I know i can always switch the order i mux the subs in ;) ).

MadMonkey57
16th December 2008, 11:05
Well... No.

Enabling subtile #1 is done with SetStream 49153, 0 01]
Enabling subtile #2 is done with SetStream 49154, 0 10]
Enabling subtile #3 is done with SetStream 49155, 0 11]
...

Enabling audio stream #1 is done with SetStream 2147549184, 0 01 00000000 00000000]
Enabling audio stream #2 is done with SetStream 2147614720, 0 10 00000000 00000000]
Enabling audio stream #3 is done with SetStream 2147680256, 0 11 00000000 00000000]
...

Enabling both subtile #1 and audio stream #1 is done with SetStream 2147598337, 0 01 11000000 00000001]

In addition, I suggest you use the hexadecimal box (ie 8001C001) instead of the decimal box (ie 2147598337) because BDEdit seems to have problems with large decimals (http://forum.doom9.org/showthread.php?p=1224765#post1224765).

G_M_C
16th December 2008, 12:43
Well... No.

Enabling subtile #1 is done with SetStream 49153, 0 01]
Enabling subtile #2 is done with SetStream 49154, 0 10]
Enabling subtile #3 is done with SetStream 49155, 0 11]
...

Enabling audio stream #1 is done with SetStream 2147549184, 0 01 00000000 00000000]
Enabling audio stream #2 is done with SetStream 2147614720, 0 10 00000000 00000000]
Enabling audio stream #3 is done with SetStream 2147680256, 0 11 00000000 00000000]
...

Enabling both subtile #1 and audio stream #1 is done with SetStream 2147598337, 0 01 11000000 00000001]

In addition, I suggest you use the hexadecimal box (ie 8001C001) instead of the decimal box (ie 2147598337) because BDEdit seems to have problems with large decimals (http://forum.doom9.org/showthread.php?p=1224765#post1224765).

Thx, i'll try these settings on a project asap :)

MadMonkey57
20th December 2008, 13:53
@G_M_C and maybe some others,
I don't know if that could be of any help to some of you out there, but based on bits and pieces of information I gathered in a few threads a while ago (notably kaid's one), I managed to mimick for BD5's the "Replace VTST tiles" in pgcedit, that is, the possibility to replace a movie with another one in a BD file structure.

Basically, I author a BD file structure with Adobe Encore CS4, a main menu with several dummy videos. All the encoding and muxing is done with Adobe Encore CS4. In the same time, i use MEGui to encode the real movies. In the end, I patch the BD file structure with an HEX editor and replace the dummy movies with the real ones.

The advantage is I have full control over the quality, bitrates, ... of the movies, still having the advantage of Adobe Encore CS4 in terms of menu design, workflow, ...

Maybe this is already obvious for everybody so no guide needed. Otherwise, I can write a few lines about it...