Log in

View Full Version : How to Get 1080 or 720p MKV files bluray compliant..


Pages : [1] 2

jamos
12th March 2008, 22:59
Ok we all know that mkv2vob is a great program and does many things but it uses a trick just to remux the video to get it to stream to a ps3 which does save time when it works and keeps the original quality. The trick uses TSmuxer to set the AVC lvl in the header to 4.1 which SOMETIMES works with the ps3. Problem is that most 1080p mkvs are encoded with more than 4 frames per reference which bluray hardware and ps3's cannot handle. Also sometimes even 720p mkvs have stuttering or playback issues while just being remuxed. Now mkv2vob does allow you to reencode but it is mpeg2 format which increases the size normally and causes very bad streaming due to the lack of compression. So one use of the following would be to get your video streams bluray complant if your having issues with mkv2vob.

Another use for doing this is of course is to make a AVCHD disk which will play off of a DVD-9 or even a DVD-5 on a bluray AVCHD compatable playback device such as the PS3 and many standalone BD players out there. A big advantage of using AVCHD opposed to just playing a file is the ability for DTS (possibly LPCM 5.1 when TSmuxer supports it) as well as AC3. Also on a AVCHD at least on the PS3 you can have toggible subtitles.

So the optimal solution will be to reencode the video stream from the MKV using x264 encoder into a Blu-ray compliant stream. I will show doing this by using MEGUI front end, you could expireement with other programs that are simular such as Ripbot.

Let us begin our discussion..

1. Extract streams with TSMuxer
Use TSMuxer to extract Video, Audio, and optionally .srt subtitle streams from your .mkv file, We will just concentrate on the video stream here. use TSMuxer to create a .m2ts output file for the video and use the demux option for the audio stream you want.

2. Determine MKV video size with mediainfo
You want to use medioinfo to look at your .mkv now and determine the size of the video (this is critically important). If the size is anything other than 1280x720 or 1920x1080 then you will have to resize the video to one of the above resolutions. Many MKVs are cropped horizontally to save space if they are letterbox, so you must look at the resolution with mediainfo to see what the 2nd number is. if its 1280x528 for example that means that 96 borders need to be added to the top and bottom to make it compliant:
720-528=192 192/2=96 (formula using 720 or 1080 as the left number depending on your resolution, subtracting the actual height as the second number then dividing by 2 to get your border sizes). remember this number as you will have to add a addborders statement to your avs script you will be creating later.

Also if you are burining this to a dvd-5 or dvd-9 then look at the movie time length and make a note of it.



[3]Ok heres where I am going off on a tangent but if your using a dvd-5 or dvd-9 to burn with. I strongly recommend you use 720p resolution even if your source is 1080p. this is due to the limited bitrate you have to use to shrink the size down to get it to fit on a dvd-9 or dvd-5, 720p at the same bitrate as 1080p will look better. You can resize the video down to 720p in your avs script also.:)


4. Create a .AVS Script to use with MEGUI
once you have your remuxed .m2ts file you can begin with your x264 frontend which I will show using megui. the first thing you need to do is create a .avs script. A .avs script is nothing more that a text file with a .avs extension that avisynth uses to do things (avisynth should be installed when you install megui). To create a .avs script you just open notepad and type in commands. The ones I use mainly are used below and should be all you need to resize and/or add borders.

first line should look like below subtituting video.m2ts with the name of your remuxed m2ts file in step 3 above. The 23.96 framerate is standard for bluray if your video is a different framerate you may get by with using a different framerate but it will not be 100% bluray compliant.
DirectShowSource("C:\video.m2ts",fps=23.9759856527702,audio=false)
if you are just loading the video and not resizing it or adding borders then the above line is all you need. save the file as whatever name you want to give it with a .avs extension.

If you need to resize you should add the following 2nd line (again I strongly recommend you resize 1080p sources to AVCHD down to 720p).

the following is to resize a 1920x1080 video down to 720p for your 2nd line of code.
Lanczos4Resize(1280,720)

If the source is cropped and you just want to restore the borders to make it compliant then use the following code as your 2nd line. Note: The border numbers were calculated using step 2 fomula.
addborders(0,96,0,96)

If the source is cropped and you want to resize it down to 720p from lets say 1080p then you would use the following for line 2. Note: that the 528 was the original size determined by looking at the mkv with mediainfo in step 2. and the borders were calculated using step 2 fomula.
Lanczos4Resize(1280,528).addborders(0,96,0,96)

Save your file with a .avs extension.

example of a completed AVS script ready to be processed and converted to 720p adding 96 borders to top and bottom:
DirectShowSource("C:\video.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,528).addborders(0,96,0,96)

5. Encode file with MEGUI

Open MEGUI and next to the avisynth script entry field click on the ... button and browse for the .avs script you created in step 4 above. there should be a delay and a preview of the video should be displayed on a window. Close the preview window leaving megui still open. note: If you do not see this preview then you have done something wrong with the .avs file or there is something not right with your source. If you have issues loading a m2ts or mkv file then get CCCP codec pack (http://www.cccp-project.net/) and install it.

Choose RAWAVC in the file format dropdown on the main MEGUI window.

Choose AVCHD profile from the video profile dropdown on the main MEGUI window (if you do not see it then look at note above to put the profile in the correct area).

Now we need to determine what bitrate we are going to need to fit the video on either a dvd-5 or dvd-9 (if you are just going to stream this file or copy it to the ps3 then you can skip this step).
I use Bincsofts Bitrate calculator (http://www.bincsoft.com/?page=download) (seems more accurate then MEGUI's built in one) to determine what maximum bitrate I can use to fit on a dvd-5 or dvd-9. open the calculator and change the output size to either dvd-5 or dvd-9 then enter in the length of the movie that you determined in step 2 using mediainfo. Add at least 9 minutes to the length of the movie to account for the slightly bigger m2ts output (add additional 1 minute if also having subtitles). ie movie length is 1:30:00 so enter 1:40:00 minutes for a movie with subtitles. Now determine the sound quality by using custom and enter in the bitrate (use 630 kbits per sec. for AC3, or 1536 kbits per sec. for DTS for example). the resulting encode at XXXX (Kilobits per sec.) bitrate displayed is what you need from this take note of that number.
Now in MEGUI click the config button next to the bluray video profile and look at the bitrate entry field on the first tab. Enter the number that bincsoft calculated (most likely it will be lower than the default 8000 if using a dvd-5 or could be higher if using a dvd-9). Click ok to close the config. If it asks for you to update you can if you want.

Note: If you use MEGUI to calculate bitrate make sure to add 12 minutes to video length to get appropriate bitrate.

Then click the enqueue button next to the video profile. This will add the job to the second tab of the main MEGUI window.

Now click on the Queue tab on the main MEGUI window and click start to start the encode. This may take a while depending the speed of your computer and how much you are compressing (generally for a 2 hour movie it takes my 3ghz. core2 duo about 3 hours).

6. BD compliant video stream
You now have a .264 raw bluray compliant video stream and can use TSmuxer (with audio stream and optionally a .sup/.srt file) to either create a .ts/.m2ts file that plays on the ps3 (have to rename the .m2ts to .mpg or somthing that the ps3 likes though)

or most importantly you can use TSmuxer to create a BD structure. My tutorial here (http://forum.doom9.org/showthread.php?t=134348) shows how to do that.





Enjoy,
Jamos

to do: add links to program downloads.

bibikul
13th March 2008, 09:25
thank you for the tutorial.

cliffa
13th March 2008, 09:48
Hi, Yes thanks for this Jamos, it clears up the process, which I have dabbled with before.

One related question I have, which I didn't want to post in the tsmux thread is...

Why won't the PS3 play back an m2ts file (via UPnP streaming) containing the original unmodified 1080p Video in VC1 format from a BluRay discs that have been tsmuxed to remove the extra Audio tracks and retain just one AC3 Audio track?

The Video format is obviously OK when it is on a BluRay disc as it works on the original and on a burned BD-RE with BluRay structure.

I have another HD UPnP Media Client (Netgem 7600) that does stream the m2ts files containing the original unmodified VC-1 Video and DTS audio. I hope the PS3 gets updated to support this too.

jamos
13th March 2008, 13:40
Hi, Yes thanks for this Jamos, it clears up the process, which I have dabbled with before.

One related question I have, which I didn't want to post in the tsmux thread is...

Why won't the PS3 play back an m2ts file (via UPnP streaming) containing the original unmodified 1080p Video in VC1 format from a BluRay discs that have been tsmuxed to remove the extra Audio tracks and retain just one AC3 Audio track?

The Video format is obviously OK when it is on a BluRay disc as it works on the original and on a burned BD-RE with BluRay structure.

I have another HD UPnP Media Client (Netgem 7600) that does stream the m2ts files containing the original unmodified VC-1 Video and DTS audio. I hope the PS3 gets updated to support this too.


structure of a m2ts container is different in a bluray disk than a standalone m2ts file due to the BD popup menu interaction etc. so it must be created with BD format selected if it is to be burned onto a AVCHD.

but the ps3 should play back a m2ts file if you rename the extension to .mpg or .vob unless the bd disk it was ripped from has 5.1 avc then it still must be converted to 4.1 using x264. I have done this with serveral 1080p movies though they were all 4.1.

Glorioso
14th March 2008, 15:03
Jamos, i'm working on a two audio project, how can i make the bitrate calculation? double the bitrate in the calculator or subtract the two file size to the desired project size? 478mb each?

Thanks for this tutorial, i'll try it this weekend in my Laptop, this PC is too slow for that....:-(

jamos
14th March 2008, 16:47
Jamos, i'm working on a two audio project, how can i make the bitrate calculation? double the bitrate in the calculator or subtract the two file size to the desired project size? 478mb each?

Thanks for this tutorial, i'll try it this weekend in my Laptop, this PC is too slow for that....:-(


I would just double the bitrate in the audio portion.

Glorioso
14th March 2008, 18:23
I would just double the bitrate in the audio portion.

TSremux will accept multiple audio and subtitles, correct?

crazyfool30
14th March 2008, 18:32
Jamos, does demuxing the mkv to produce a .264 file and remuxing it into a .m2ts file make the encoding process quicker than using the .mkv in the .avs? I'm currently encoding a 2.5 hour movie from 1080p to 720p at about 6000kbs to fit on a dvd9 and the total time is going to be 27 hours! (I've got a 2.2ghz single core amd athlon processer so that might be why.)

Also, if you go to tools in megui there's a bitrate calculator that will automatically update the profile to the required bit-rate. Thought that might be useful.

crayonman
14th March 2008, 20:37
I created AVCHD disk with 1080P video using the bluray profile, but playback stutters on ps3. If reducing the quality can avoid stuttering, any recommendation?

Thanks

pelle412
15th March 2008, 11:44
Hmm, I tried create a BluRay disc following the process you laid out. When I play the disc in PowerDVD I get sound but no video. The video when played in a directshow type player plays just fine. Even PowerDVD plays the movie file itself, just not when burned to a BluRay format. I used ImgBurn to create a BluRay disc (on a DVD-R).

I have not tried to play the disc in a PS3 yet.

Atak_Snajpera
15th March 2008, 12:05
@Jamos
Here is updated formula for TSMuxer.

if audiobitrate=196608 then multiplier:=1/(size*0.008267196)/100 else
if audiobitrate=229376 then multiplier:=1/(size*0.013130252)/100 else
if audiobitrate=262144 then multiplier:=1/(size*0.010629252)/100 else
if audiobitrate=393216 then multiplier:=1/(size*0.009704969)/100 else
if audiobitrate=458752 then multiplier:=1/(size*0.013130252)/100 else
if audiobitrate=655360 then multiplier:=1/(size*0.008267196)/100 else
if audiobitrate=786432 then multiplier:=1/(size*0.009704969)/100 else
if audiobitrate=1572864 then multiplier:=1/(size*0.009704969)/100;

overhead:=1+(duration*multiplier+4.34)/100;


if copyaudiostream=0 then tempcalc:=( (size*1048576/overhead-SubtitleFileSize) /duration*8-audiobitrate)/1000;
if copyaudiostream=1 then tempcalc:=(size*1048576/overhead-AudioFileSize*1.024-SubtitleFileSize)/duration*8/1000;

Glorioso
16th March 2008, 11:35
Jamos, since SUPread cant make 720p files, how can i "burn" the subs in the video stream in the AVS script?

Atak_Snajpera
16th March 2008, 11:43
Use RipBot264

B4tm4n
16th March 2008, 12:00
Jamos, since SUPread cant make 720p files, how can i "burn" the subs in the video stream in the AVS script?


LoadPlugin(x:\path\vsfilter.dll)

textsub(x:"\path\file.ext")

Vsfilter Download (http://www.divshare.com/download/4037479-541)

http://forum.doom9.org/showthread.php?p=487989#post487989

Glorioso
16th March 2008, 12:30
LoadPlugin(x:\path\vsfilter.dll)

textsub(x:"\path\file.ext")

Vsfilter Download (http://www.divshare.com/download/4037479-541)

http://forum.doom9.org/showthread.php?p=487989#post487989

How can i have control over the size? Cann't i use fddshow?

Atak_Snajpera
16th March 2008, 12:36
Read AviSynth help

jamos
17th March 2008, 02:46
Hmm, I tried create a BluRay disc following the process you laid out. When I play the disc in PowerDVD I get sound but no video. The video when played in a directshow type player plays just fine. Even PowerDVD plays the movie file itself, just not when burned to a BluRay format. I used ImgBurn to create a BluRay disc (on a DVD-R).

I have not tried to play the disc in a PS3 yet.

I had that issue with powerdvd 7.2 and had to patch it.

jamos
17th March 2008, 02:52
Jamos, does demuxing the mkv to produce a .264 file and remuxing it into a .m2ts file make the encoding process quicker than using the .mkv in the .avs? I'm currently encoding a 2.5 hour movie from 1080p to 720p at about 6000kbs to fit on a dvd9 and the total time is going to be 27 hours! (I've got a 2.2ghz single core amd athlon processer so that might be why.)

Also, if you go to tools in megui there's a bitrate calculator that will automatically update the profile to the required bit-rate. Thought that might be useful.

You can always try to use the mkv directly if its encoded correctly then it should work and is faster. The way I have shown is my foolproof way to do it for troublesome mkv files.

I know that megui has a bitrate calculator but have always found its a bit on the high side for file sizes (they always seem to not fit as they are supposed to on a dvd selected size).

Glorioso
22nd March 2008, 11:50
Jamos, i have this file:
Video #0
Codec : AVC
Codec/Family : AVC
Codec/Info : Advanced Video Codec
Codec profile : High@L5.1
Codec settings, CABAC : Yes
PlayTime : 48s
Width : 852 pixels
Height : 720 pixels
Display Aspect ratio : 16/9
Frame rate : 23.976 fps
Chroma : 4:2:0
Interlacement : Progressive

Can i use this ratio or how can i resize it?

scissors
23rd March 2008, 08:30
Nice one jamos!

And well done the author of tsmuxer. RAw streams straight to blu ray! brilliant.

scissors
23rd March 2008, 08:32
You can always try to use the mkv directly if its encoded correctly then it should work and is faster. The way I have shown is my foolproof way to do it for troublesome mkv files.

I know that megui has a bitrate calculator but have always found its a bit on the high side for file sizes (they always seem to not fit as they are supposed to on a dvd selected size).

I wish word would get around and encodes of x264 streams in mkv were blu ray compliant, then there'd be no re-encode. That'd save me 30 hours!!!

bibikul
25th March 2008, 13:38
Jamos, how do I get a 1440/1080 mpeg2 hdv file blu-ray compliant?
1440/1080 is PAR 1:1,33 anamorphic.
A 1440/1080 stream is allready blu-ray compliant because is the AVCHD native resolution?
I would like to encode the mpg2 stream with x264 and get a small filesize and I don't know how I resized the source.

Glorioso
25th March 2008, 14:48
Jamos, i have this file:
Video #0
Codec : AVC
Codec/Family : AVC
Codec/Info : Advanced Video Codec
Codec profile : High@L5.1
Codec settings, CABAC : Yes
PlayTime : 48s
Width : 852 pixels
Height : 720 pixels
Display Aspect ratio : 16/9
Frame rate : 23.976 fps
Chroma : 4:2:0
Interlacement : Progressive

Can i use this ratio or how can i resize it?

Jamos, did u see this message?

jamos
25th March 2008, 20:24
Jamos, did u see this message?

Looks like a 4:3 video even though it says 16:9. you can add black borders to the left and right to make it 1280.

1280-852=428/2=214 borders on left and right

so your avs synth file should just have this in it


DirectShowSource("G:\movie.m2ts",fps=23.9759856527702,audio=false)
addborders(214,0,214,0)

is the play time just 48 seconds, is this just a title of some sort?

if you want to stretch it then just use the code below, it will look stretched just like watching 4:3 480i tv signal through a wide screen tv.



DirectShowSource("G:\movie.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,720)

jamos
25th March 2008, 20:38
Jamos, how do I get a 1440/1080 mpeg2 hdv file blu-ray compliant?
1440/1080 is PAR 1:1,33 anamorphic.
A 1440/1080 stream is allready blu-ray compliant because is the AVCHD native resolution?
I would like to encode the mpg2 stream with x264 and get a small filesize and I don't know how I resized the source.

If you want to keep the same resolution just put this in

DirectShowSource("G:\movie.mpeg2",fps=23.9759856527702,audio=false)

and use the correct AVCHD compliant fps.

jamos
25th March 2008, 20:41
I wish word would get around and encodes of x264 streams in mkv were blu ray compliant, then there'd be no re-encode. That'd save me 30 hours!!!

Yes the persons making most of the mkvs have no thought on making them compliant they just care about computer playback it seems.

Glorioso
25th March 2008, 22:50
Looks like a 4:3 video even though it says 16:9. you can add black borders to the left and right to make it 1280.

1280-852=428/2=214 borders on left and right

so your avs synth file should just have this in it


DirectShowSource("G:\movie.m2ts",fps=23.9759856527702,audio=false)
addborders(214,0,214,0)

is the play time just 48 seconds, is this just a title of some sort?

if you want to stretch it then just use the code below, it will look stretched just like watching 4:3 480i tv signal through a wide screen tv.



DirectShowSource("G:\movie.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,720)


Jamos, this is the Sample file that is just 48seconds, but when i play the file the format is 16:9...

luthan
27th March 2008, 17:23
i tried this method on a dual quad core processor server and it seemed like only 2 cores were being used.
anything out there that would utilize all cores available?

framura
1st April 2008, 14:45
Hi,

anyone tried this one?

http://www.itheater.info/jointops/guides/bd/

Seems very easy for compliant streams with only resolution difference (no need to reencode).

TIA

B4tm4n
1st April 2008, 17:03
Hi,

anyone tried this one?

http://www.itheater.info/jointops/guides/bd/

Seems very easy for compliant streams with only resolution difference (no need to reencode).

TIA

I tried this and you still get the green bar at the bottom of the screen on my PS3.
Maybe I did something wrong, well I await futher test results.

veggav
6th April 2008, 00:50
Hi all, this is my first post on this forum but i've been following all the discution about blu-ray on dvd-r single layer or double layer.

I'm here to ask if that is really correct, i've been doing all that your tutorial says James and I have a single core athlon xp 3200 and it is taking something like 25 hours for a 4GB 720p movie.

Megui shows 2 pass to complete it, here are the two commands it do:

Log for job job1

Job commandline: "C:\Program Files\megui\tools\x264\x264.exe" --pass 1 --bitrate 3414 --stats "C:\Blu-Ray\test.stats" --level 4.1 --keyint 24 --min-keyint 1 --bframes 3 --direct auto --subme 1 --partitions none --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 30000 --vbv-maxrate 38000 --qcomp 0.5 --me dia --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim --output NUL "C:\Blu-Ray\test.avs" --mvrange 511 --aud --nal-hrd --sar 1:1
C:\Program Files\megui\tools\x264\x264.exe: unknown option -- nal-hrd

this one takes something like 4 hours

them this one takes a lot

Job commandline: "C:\Program Files\megui\tools\x264\x264.exe" --pass 2 --bitrate 3414 --stats "C:\Blu-Ray\test.stats" --level 4.1 --keyint 24 --min-keyint 1 --ref 3 --mixed-refs --bframes 3 --b-rdo --bime --weightb --direct auto --subme 6 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 30000 --vbv-maxrate 38000 --qcomp 0.5 --me umh --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim --output "D:\Cars\cars.264" "C:\Blu-Ray\test.avs" --mvrange 511 --aud --nal-hrd --sar 1:1

How can the first one have any effect if it does not have an output ?

Is that correct, it will take 25 hours for a 720p movie ? And 2-3 days for a 1080p movie ?

Thanks for your atention to my questions

Vitor

jamos
7th April 2008, 02:04
I tried this and you still get the green bar at the bottom of the screen on my PS3.
Maybe I did something wrong, well I await futher test results.

Yes it doesnt work with all bd players (ie PS3). also the resolution is just one thing to make the video BD compliant. Best to reencode even if you do not need to change the resolution.

jamos
7th April 2008, 02:05
Jamos, this is the Sample file that is just 48seconds, but when i play the file the format is 16:9...

your player is probably stretching the video for you. best just to use the 1080x720 script and stretch it to that.

DirectShowSource("G:\movie.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,720)

jamos
7th April 2008, 02:43
Hi all, this is my first post on this forum but i've been following all the discution about blu-ray on dvd-r single layer or double layer.

I'm here to ask if that is really correct, i've been doing all that your tutorial says James and I have a single core athlon xp 3200 and it is taking something like 25 hours for a 4GB 720p movie.

Megui shows 2 pass to complete it, here are the two commands it do:

Log for job job1

Job commandline: "C:\Program Files\megui\tools\x264\x264.exe" --pass 1 --bitrate 3414 --stats "C:\Blu-Ray\test.stats" --level 4.1 --keyint 24 --min-keyint 1 --bframes 3 --direct auto --subme 1 --partitions none --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 30000 --vbv-maxrate 38000 --qcomp 0.5 --me dia --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim --output NUL "C:\Blu-Ray\test.avs" --mvrange 511 --aud --nal-hrd --sar 1:1
C:\Program Files\megui\tools\x264\x264.exe: unknown option -- nal-hrd

this one takes something like 4 hours

them this one takes a lot

Job commandline: "C:\Program Files\megui\tools\x264\x264.exe" --pass 2 --bitrate 3414 --stats "C:\Blu-Ray\test.stats" --level 4.1 --keyint 24 --min-keyint 1 --ref 3 --mixed-refs --bframes 3 --b-rdo --bime --weightb --direct auto --subme 6 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 30000 --vbv-maxrate 38000 --qcomp 0.5 --me umh --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim --output "D:\Cars\cars.264" "C:\Blu-Ray\test.avs" --mvrange 511 --aud --nal-hrd --sar 1:1

How can the first one have any effect if it does not have an output ?

Is that correct, it will take 25 hours for a 720p movie ? And 2-3 days for a 1080p movie ?

Thanks for your atention to my questions

Vitor

the first pass saves stats in the .stats file, the second pass uses the stats to reencode.

Time sounds about right with your processor, reencoding is really cpu and memory intensive. 1080p should not take much more time than 720p. this is where the dual cores really help you as x264 uses them (either amd or intel). for me the first pass takes about 1.5 hours and the second about 3 hours for a 2 hour video with a dual core intel 6850 and 4 gigs of ram.

nick101181
9th April 2008, 01:18
I can't wait until there is a ps3 firmware that will read mkv's. I got a quick question I have some mkv's that are exactly 4.37 gigs. If I use the mkv to blu-ray with tsremuxer method all of my .m2ts files come out 4.6 gigs which is too big for a dvd-r. What's a solution to this to keep from re-encoding. also how much time would need to be cut from the credits to get it down to dvd-r size? If I only had to trim say the last 30 seconds of the credit to drop to the correct size, then I'd have no problem with that.

chiefj1254
13th April 2008, 07:28
Nick,

There's not much you can do with a 4.37GB mkv that you want to convert to bluray. The problem is that muxing to .m2ts will add extra reference data to the stream that bumps the size up a bit. If your video size on those files is not either exactly 1280x720 or 1920x1080 however, you have to add borders to the stream to make it blu-ray compliant (see janos' posts for the how-to). Since you probably have to go through this trouble anyhow, you can specify a bitrate during the conversion in meGui that will give you an output file that'll fit into that 4.37GB size when you're done. If you've already got a compliant video size, then you may still have to re-encode it through meGui, but just knock the bitrate down a little bit (be sure not to add borders). It'll take a while, but not nearly as long as when you're adding borders. And the result will fit right onto a DVD5.

chiefj1254
15th April 2008, 18:19
Actually, I have to correct myself. If your file is already 4.1 compliant, and it's DVD5 or DVD9 size AND already in a standard resolution (1920x1080 or 1280x720) then you can feed the file into tsmuxer and uncheck the "Continually insert SPS/PPS" box on the h264 video and mux video and audio directly into the Blu-Ray disk option and it should stay the same size. Give it a shot and you may get lucky. It's probably always safer to re-encode anyhow, but you may be able to avoid it on some videos.

frank
22nd April 2008, 17:09
Check the "Continually insert SPS/PPS" box
or you don't get a picture on Sony BDP S300!

This stretches the length of the stream only some 100 kByte.

nick101181
23rd April 2008, 23:39
Hello,
Whenever I load up my avs file into megui it crashes without any explanation but when I view the error report I see:

Error Signature
AppName: megui.exe AppVer: 0.2.6.1046 ModName: ivih264.dll
ModVer: 2.2.4.2 Offset: 0001e2d3

Does anyone know why megui is crashing ?

thanks

iSkywalker
29th April 2008, 08:16
Hi Jamo, Thanks for your wonderful guide. I can successfully get my mkv video with correct size playable on my PS3. I chose the default "2 pass" and took me 4 hours to encode for 2 hours movie. What did you choose for taking only 2 hours to encode?

Pyth0n
4th May 2008, 00:47
Hi Jamos, I followed your guide and I'm using latest megui version with all the updates.

I just can't get it to work right. Don't know if it's megui or if it's x264.

Here's what happening.

http://forum.doom9.org/showthread.php?p=113390

Pyth0n
5th May 2008, 20:56
How do I get those 25fps videos working?

They don't play on PS3 when I mux a 25fps to bluray structure.
How do I convert them to 24/1001fps and still keeping audio sync?

Atak_Snajpera
5th May 2008, 20:58
What did you choose for taking only 2 hours to encode?
Probably Quad Core :)

rotatorkuf
16th May 2008, 03:04
great thread

got everything working

just wondering

what is one supposed to do with pal (25fps) audio?

i can convert the video fine, but using the same audio results in desynching....is there a way to convert 25fps ac3o to 23.976 (ntsc) ac3?

some other questions

1. what's the difference between 'sa blu ray' and 'sa blu ray fast'

2. if you place different videos in the queue, with different profile configs, will they all follow their own bitrate or the last one you set?

3. how exactly do you create an avs script to account for resizing from 1080 to 720 and adding borders...e.g. a video with 1920x800 resolution

astragalos
19th May 2008, 11:43
great thread
what is one supposed to do with pal (25fps) audio?

i can convert the video fine, but using the same audio results in desynching....is there a way to convert 25fps ac3o to 23.976 (ntsc) ac3?



Nowadays is very simple to do it with eac3to . If you find, you will probably find a nice guide here or in any other video forum.

:)

grew
28th May 2008, 23:07
Just wanted to say thanks for this guide.. Just finished a couple of encodes... My comp is a bit slower than your though and it took almost 10 hours each for the encoding.... thanks again

lithiumus
23rd June 2008, 02:12
@Jamos
Here is updated formula for TSMuxer.

if audiobitrate=196608 then multiplier:=1/(size*0.008267196)/100 else
if audiobitrate=229376 then multiplier:=1/(size*0.013130252)/100 else
if audiobitrate=262144 then multiplier:=1/(size*0.010629252)/100 else
if audiobitrate=393216 then multiplier:=1/(size*0.009704969)/100 else
if audiobitrate=458752 then multiplier:=1/(size*0.013130252)/100 else
if audiobitrate=655360 then multiplier:=1/(size*0.008267196)/100 else
if audiobitrate=786432 then multiplier:=1/(size*0.009704969)/100 else
if audiobitrate=1572864 then multiplier:=1/(size*0.009704969)/100;

overhead:=1+(duration*multiplier+4.34)/100;


if copyaudiostream=0 then tempcalc:=( (size*1048576/overhead-SubtitleFileSize) /duration*8-audiobitrate)/1000;
if copyaudiostream=1 then tempcalc:=(size*1048576/overhead-AudioFileSize*1.024-SubtitleFileSize)/duration*8/1000;

Hey Atak,

I just wanted to confirm what this formula was... does it calculate the overhead that tsmuxer places on a video stream?

Atak_Snajpera
24th June 2008, 00:30
if audiobitrate=196608 then multiplier:=1/(size*0.008267196)/100 else
if audiobitrate=229376 then multiplier:=1/(size*0.013130252)/100 else
if audiobitrate=262144 then multiplier:=1/(size*0.010629252)/100 else
if audiobitrate=393216 then multiplier:=1/(size*0.009704969)/100 else
if audiobitrate=458752 then multiplier:=1/(size*0.013130252)/100 else
if audiobitrate=655360 then multiplier:=1/(size*0.008267196)/100 else
if audiobitrate=786432 then multiplier:=1/(size*0.0067640693)/100 else // FIX: Becaude REAL DTS bitrate is 737kbps instead of 768kbps
if audiobitrate=1572864 then multiplier:=1/(size*0.009704969)/100; // <- Broken

overhead:=1+(duration*multiplier+4.34)/100;


if copyaudiostream=0 then tempcalc:=( (size*1048576/overhead-SubtitleFileSize) /duration*8-audiobitrate)/1000;
if copyaudiostream=1 then tempcalc:=(size*1048576/overhead-AudioFileSize*1.024-SubtitleFileSize)/duration*8/1000;

does it calculate the overhead that tsmuxer places on a video stream?
Yes it does.

1ellis2345
24th June 2008, 13:31
Hi,

Thanks for the tutorial, i followed it to the letter but i'm still getting the green bar at the bottom of the screen. I used the calculations as described in the tutorial and when i checked the resulting video on my pc the borders have been added, but when i burn it to disc and put it in the ps3 no luck, green bar.

Can anyone help, please?

Atak_Snajpera
24th June 2008, 18:56
Use RipBot264 and make sure you set 1920x... or 1280x... resolution.