View Full Version : How to Get 1080 or 720p MKV files bluray compliant..
lithiumus
27th June 2008, 03:34
Yes it does.
Thanks this is really helpful! BTW, what do you mean by "broken"? Is that number inaccurate for DTS 1536bit streams? To verify these numbers could I mux the streams and use the resulting sizes to plug into the equation? I assume yes? Thanks again.
robbyrob
5th July 2008, 06:24
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.
for the PS3 to play the m2ts file via stream for example with Tversity you have to rename the extension and take of the s. so for example instead of yourmovie.m2ts it would be yourmovie.m2t
if you are just going to burn to disk or make bluray structure you dont have to rename..
BTW thanks for this!! i needed this bad!!
u the man!
robbyrob
5th July 2008, 23:59
ok i have one small question on this...
1. i used the formula to calculate the addborders script thing is when the conversion was complete i used mediainfo and it said it was compliant. 1280x720. now when I put it on the Ps3 it worked perfect. no green lines but it was not full screen. does it have to be full screen? just wondering because I thought we were adding the border to make the video full screen but i could be wrong..
2. second question is that after I made the .avs script and loaded into Medgui everything went good. i entered the bitrate with the calculations, beautiful. i noticed once i clicked on Enqueue it gave me 2 jobs to do. I clicked start and was pretty happy when I saw that it would only take 1.5 hours. After the first job went through it told me that the file already existed do i want to overwrite? I said yes and then it encoded for another 2 hours. is this normal? to get 2 jobs after pressing enqueue? It was a video that had to be resized so I am not sure if that had to do with it?
other than that man once again thanks for this because regardless of anything it played and didnt have the green line like my previous attempt!!
Atak_Snajpera
6th July 2008, 00:11
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.0044642857)/100; // <- Fixed
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;
.....
robbyrob
6th July 2008, 01:41
ok i was reading and now i understand that the 2 jobs are the 2 passes.. pretty much just wanted to know about the full screen deal with the adding borders.
robbyrob
6th July 2008, 01:55
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.
i REALLY would love for PS3 to let us use MKV files. :) that would make our lives much easier, but then again I did read somewhere were Sony was trying to be one of the leaders in trying to stop Piracy so I doubt they give that feature. Hopefully but i am not holding my breath. I did read somewhere were u could install Linux on the PS3 and use I believe is VLC to play Mkv.
Mordred
28th July 2008, 18:14
Just wanted to say thanks to Jamos because this guide is great.
I am however having a strange problem. I'm getting some odd stuttering on my output files. The stuttering occurs about once a second or so and is noticeable on my PS3 and when I play the files on my PC.
I did a lot of investigation and followed the procedure in this thread to the letter and I now know where it's going wrong, but I don't know why, or how to fix it.
I'm starting with an MKV, I demux to .264 using tsMuxerGUI. I then remux the .264 to .m2ts using tsMuxerGUI so that MeGUI can properly tell the length of the file. I then reencode to AVC and get stuttering.
However, if I don't do the intermediary remux from .264 to .m2ts MeGUI can reencode to AVC without any stuttering at all. The problem is that MeGUI can't tell what the playtime of the file is so the output is some random length either too short or too long. The video that is there, plays back perfectly however.
Any suggestions? Is there something else I can remux the .264 to that MeGUI can properly tell the length of? I think it might be a bug in the .m2ts muxing that tsMuxerGUI has, but I don't know.
Mordred
29th July 2008, 05:19
Playing with this a little more on my 1 minute sample files I got the re-encode to work perfectly if instead of demuxing first I just used the original .mkv in the .avs I passed to MeGUI. The resultant .264 file played perfectly fine. I'm currently trying a re-encode of a full length movie to make sure it still works perfectly.
In looking at this guide it says the reason to demux to the elemental streams is that DirectShow sometimes has problems with .mkv files. What problems are those?
Mordred
29th July 2008, 22:01
Playing with this a little more on my 1 minute sample files I got the re-encode to work perfectly if instead of demuxing first I just used the original .mkv in the .avs I passed to MeGUI. The resultant .264 file played perfectly fine. I'm currently trying a re-encode of a full length movie to make sure it still works perfectly.
In looking at this guide it says the reason to demux to the elemental streams is that DirectShow sometimes has problems with .mkv files. What problems are those?Well my computer crashed about an hour into the encode, so apparently that's the problem it has with MKVs. Hopefully someone has some ideas/suggestions for me.
alc0re
5th December 2008, 10:59
I have a question about overhead when muxing an audio file (dts or ac3) and an h264 video file to Bluray structure (m2ts) using TSMuxer. There's a formula posted in this thread but I have no idea how to use it.
All I'm looking to do is figure out what bitrate my video needs to be re-encoded at to fit on a DVD9 after transcoding and resizing to 720p. Jamos said in that post to just add 6 minutes to total length of movie in the bitrate calc, but I want to be more exact than that.
Are there any programs/bitrate calcs out there that use that formula posted by Atak that I can input some numbers in and it will tell me the bitrate needed? None of the bitrate calcs I saw support M2TS container. If not, can someone tell me what I need to do to use Atak's formula?
Thanks...
laserfan
5th December 2008, 16:53
...can someone tell me what I need to do to use Atak's formula?Use RipBot264 instead of MeGUI?
alc0re
5th December 2008, 20:20
I have grown fond of MeGUI. Not that RipBot isn't a great program. After I posted I installed RipBot and found that I can use it to calculate the bitrate for me and drop that bitrate into MeGUI.
jamos
1st January 2009, 16:22
I have grown fond of MeGUI. Not that RipBot isn't a great program. After I posted I installed RipBot and found that I can use it to calculate the bitrate for me and drop that bitrate into MeGUI.
megui can calculate bitrate also but is not as accurate.
jamos
1st January 2009, 16:22
Probably Quad Core :)
quad core i7 now:devil:
deank
25th March 2009, 11:40
Take a look here (http://forum.doom9.org/showthread.php?p=1265246#post1265246). I posted this small tool as I'm using it from time to time to create compliant output to use with multiAVCHD.
And if you resize 1920x800 to 1280x720 the aspect ratio will be wrong. You need this:
1) resize 1920x800 -> 1280x534
2) addborders(0,93,0,93) to make 1280x534 -> 1280x720 with top and bottom borders of 93 pixels each.
Dean
deank
25th March 2009, 14:40
You need to keep the original aspect.
Your input file is 1920x800 and you need to convert it to width of 1280.
1920/1280 = 1.5
800 / 1.5 = 533.3(3) and rounding up to next = 534
Then to make equal borders: 720 - 534 = 186 and each border will be 186/2 = 93 pixels... so you'll get
534 + 93 + 93 = 720 for you new 1280x720 resolution.
If your clip is: orgWIDTH x orgHEIGHT and your desired one has newWIDTH
then the new file will be:
newWIDTH x ( orgHEIGHT / (orgWIDTH / newWIDTH) )
or in your case:
1280 x ( 800 / ( 1920 / 1280) ) -> 1280 x ( 800 / 1.5 ) -> 1280 x 534
Sometime ago I posted a simple avs script to get this done if your input file has horisontal resolution of 1920 or 1280:
filename="D:\Movie.mkv"
resizeTO = 1280
directshowsource(filename,audio=false)
myheight = (width()==1920) ? 1080 : 720
bordersize=int( (myheight-height() )/2 )
AddBorders(0, bordersize, 0, bordersize)
x=last
x= (resizeTO==1920) ? x.LanczosResize( 1920, 1080) : x.LanczosResize( 1280, 720)
return x
It will be faster if resizing is done before adding borders, but it is just a sample.
Dean
rapscallion
25th March 2009, 15:17
Thanks for clarifying dean ! Any idea why the long encode times ~20hrs+ ?
deank
25th March 2009, 15:48
I have no idea what options/profiles you use.
I'm currently trying my uncropMKV (http://forum.doom9.org/showthread.php?t=145905) tool to reencode 1920x1080 full-frame video back to 1920x1080 but with lower Profile/Level and different frame-ref-cound and my x264 says 4hrs for 120 000 frames.
When reencoding 1280x... it usually takes just 2 hours. And I do one pass only.
It also depends on your CPU/OS.
rapscallion
25th March 2009, 16:42
All options/profiles are as in Jamos post #1. (and in my first post above)
WinXP SP3, Intel Core duo 2.44, 2 gb ram.
deank
25th March 2009, 16:54
I'm using 32bit Vista on a Dell Inspiron 1720 laptop with Intel Core2 Duo T8300@2.4GHz with 2GB of RAM.
Currently x264 is encoding and I'm doing tenths of other things on the same machine and I'll never get such times as 20hrs.
deank
25th March 2009, 17:53
It is because of missing parameter in x264 command line... where do you get this? MeGUI? Or your avs script has some unnecessary cropping.
You need to have something like:
--partitions p8x8,b8x8,i4x4,i8x8
rapscallion
25th March 2009, 18:29
Yes, from the Megui error log, after processing the "stats" file.
Here's my avs script, per Jamos instructions (and your change) :
DirectShowSource("d:\encodes\file.x264\file.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,534).addborders(0,93,0,93)
deank
25th March 2009, 18:32
It seems that I wrote all these posts in vain... or you didn't take time to read carefully.
If your file is 1280x528 - did you try to calculate border sizes?!
720 - 528 = 192 / 2 = 96
So you need to change your addborders to
addborders(0,96,0,96)
And I don't understand you would you use Lanczos4Resize(1280,528) if your file is already 1280x528.
deank
25th March 2009, 18:45
You're not bothering me but your wasting your time with reencoding.
Yes, you asked about 1920x800 and it will be 1280x534 NOT 1280x528.
I don't know where did you get this 528 and why is this Resize in your avisynth script.
Check your cropping/resize settings in megui avisynth script creator.
Just use:
DirectShowSource("d:\download_current\file.x264\file.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,534)
addborders(0,93,0,93)
or you can use this:
filename="d:\download_current\file.x264\file.m2ts"
resizeTOx = 1280
resizeTOy = 720
directshowsource(filename,audio=false)
newHEIGHT= int( height() / (width() / resizeTOx) )
LanczosResize( resizeTOx, newHEIGHT)
bordersize=int( (resizeTOy - newHEIGHT ) / 2 )
AddBorders(0, bordersize, 0, bordersize)
You may also want to disable ALL pre/post processing settings in you ffdshow (if you use it).
rapscallion
25th March 2009, 21:14
Dean...you're going way beyond my capability, but I do thank you for the effort.
This is my first venture into AVCHD, MKS conversion.
I was following ALL the steps in Jamos' post #1, at the start of this thread., and using the same programs.
I'm re encoding because he stated it was necessary when:
1. The original file is a 1080p. mkv
2. and I want to convert to a AVCHD , 720p
3. The original file is over 9gb and I want it to fit on a DVD9.
My first post above, #65, was prompted by the change in the interface description of MEGUI since his post. Some things didn't match so I was looking for clarification.
deank
26th March 2009, 13:36
Firstly Jamos, a great tutorial...Thanks.
I do have a few questions re a 1hr46m, 9.1gb, mkv movie :
1. Am I correct to assume that to resize a video from 1920x800 to 1280x720 that no borders are necessary (can't do negative borders) ??
My avs file :
"DirectShowSource("d:\video.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,720)"
No. We discussed it already.
My first post above, #65, was prompted by the change in the interface description of MEGUI since his post. Some things didn't match so I was looking for clarification.
The ONLY change you need is with the AVS script you posted - nothing else.
you said it is
DirectShowSource("d:\video.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,720)
Replace it with:
DirectShowSource("d:\video.m2ts",fps=23.9759856527702,audio=false)
Lanczos4Resize(1280,534)
addborders(0,93,0,93)
HOW hard that can be?
rapscallion
26th March 2009, 15:45
Dean,
No, it's not hard and I did make the change to the avs script, the first time you posted it. I did a typo by accident with the 528, because that happenned to be the number in jamos' post example.
When I corrected it, AND downloaded newer presets/profiles >Here< (http://forum.doom9.org/showthread.php?t=139765) I was able to choose "x264:standalone-avc-hd" which is the correct profile, not the "standalone blu-ray" profile I mentioned I my first post.
Running Megui in "normal" or "below normal" priority, job1 (stats file) took 3.5 hrs, job2 (264 file) took 7 hrs .
Thus, total time=10.5 hrs. Better than the original estimate, under a different profile, which was ~20hrs.
Still seems quite long, but as long as it works. (I still have to remuxe to a avchd structure w/the audio, of course.) Whew !
rapscallion
6th May 2009, 17:04
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)
I have a mkv source movie that has a framerate of 24fps , that I'm muxing to a avchd dvd9.
My question is- do I change the 23.97xx in the avisynth script to exactly 24 or leave it as Jamos' example above ? (my understanding in doing a search is that 24fps is also blu-ray compliant so I'm a little confused here)
:p me again :)
Yes, you shoud use the exact framerate - as in your case: 24.000, otherwise you may have some audio sync problems at the end of the video (about 7 seconds in 2hr video).
rapscallion
6th May 2009, 17:34
Thanks Dean !! (aka me again :))
mike26
14th September 2009, 11:57
got this file i wanna convert to 1280x720 in meguide
what line do i put in the avs script
Format profile : High@L4.0
Muxing mode : Container profile=Unknown@4.0
Duration : 1h 34mn
Bit rate : 5 861 Kbps
Nominal bit rate : 5 991 Kbps
Width : 1 920 pixels
Height : 816 pixels
G_M_C
14th September 2009, 12:58
got this file i wanna convert to 1280x720 in meguide
what line do i put in the avs script
Format profile : High@L4.0
Muxing mode : Container profile=Unknown@4.0
Duration : 1h 34mn
Bit rate : 5 861 Kbps
Nominal bit rate : 5 991 Kbps
Width : 1 920 pixels
Height : 816 pixels
Damn,
1) Look for the AviSynth part of this forum.
2) Install avisynth (or if allready installed) look for Avisynth in the start-menu
3) Switch on the installed manual
4) Use brain for some calculations
5) set appropriate commands
6) Launch script in Vdub to see if it works.
7) If not try again, if it does -> encode.
In short learn to do these very very basic things yourself, and show some effort, as opposed to none.
And last: Where did you get those MKV's from exactly ?
Psst deank:
[B]DirectShowSource(blablah, fps=23.9759856527702,blahblah)
[...]
Why not set fps=24000/1001 ? Much simpler ;)
mike26
14th September 2009, 14:28
Damn,
1) Look for the AviSynth part of this forum.
2) Install avisynth (or if allready installed) look for Avisynth in the start-menu
3) Switch on the installed manual
4) Use brain for some calculations
5) set appropriate commands
6) Launch script in Vdub to see if it works.
7) If not try again, if it does -> encode.
In short learn to do these very very basic things yourself, and show some affort, as opposed to none.
And last: Where did you get those MKV's from exactly ?
Psst deank:
Why not set fps=24000/1001 ? Much simpler ;)
the mkv files are recordings from my sat box
i know how to resize up to 720p when example it look like this
Lanczos4Resize(1280,528).addborders(0,96,0,96)
but how do i resize down:confused:
rapscallion
14th September 2009, 14:38
See post #66 on the previous pg
Guest
14th September 2009, 14:40
the mkv files are recordings from my sat box What sat box produces MKV files?
deank
14th September 2009, 14:46
Psst deank:
Why not set fps=24000/1001 ? Much simpler ;)
Well, it was in raspcallion's post and avisynth setting, that's why I quoted/used the floating number and not 24000/1001 :)
rapscallion
14th September 2009, 15:35
Psst deank:
Why not set fps=24000/1001 ? Much simpler ;)
...and, of course, I used it because it was in post #1/tutorial of this thread, started by Jamos.
deank
14th September 2009, 16:02
[hidden]
G_M_C
14th September 2009, 16:36
What sat box produces MKV files?
The same sat box that produces cropped images @ 1920 x 816 apparently ;)
@ mike26
The reason why I responded the way I did, is because it is very useful to learn how to script basic things in AviSynth. If you want to do more than this one time encode, I really really can recommend to try this simple thing for yourself. If you get to know these basic things, you'll be better off in the end, count on it.
Guest
14th September 2009, 22:59
@mike26
You need to clarify your answer on the source of the files or a strike can follow.
@all
No further discussion until the rule 6 concern is clarified.
mike26
15th September 2009, 10:01
as i sayd. is my satbox
Dreambox to be exactly that save it to mkv file, dreambox is like an linux pc but for television.but i have filled my hdd and wanna make it bluray complient.!
G_M_C
15th September 2009, 10:50
as i sayd. is my satbox
Dreambox to be exactly that save it to mkv file, dreambox is like an linux pc but for television.but i have filled my hdd and wanna make it bluray complient.!
Dont let the box crop. LEt it just save to a compliant resolution (1280 x 720, 1920 x 1440 or 1920 x 1080). Streams like that can be muxed into BD (AVCHD) directly. No reencoding required.
Now you need to reeencode. If your HDD is full, you'd better learn how to script avisynth and use x264 asap. There is a lot to be found around this board about this subject. There have been many people that have done stuff exactly like you want to do now (me included) And i for one am quite shure i've posted x264 commandlines and explinations how to get to bd compliant settings/streams, and how it works. So basically .... :search: .
mike26
15th September 2009, 11:01
Dont let the box crop. LEt it just save to a compliant resolution (1280 x 721, 1920 x 1440 or 1920 x 1080). Streams like that can be muxed into BD (AVCHD) directly. No reencoding required.
Now you need to reeencode. If your HDD is full, you'd better learn how to script avisynth and use x264 asap. There is a lot to be found around this board about this subject. There have been many people that have done stuff exactly like you want to do now (me included) And i for one am quite shure i've posted x264 commandlines and explinations how to get to bd compliant settings/streams, and how it works. So basically .... :search: .
thx for the answer ill try to make it work
rapscallion
15th September 2009, 15:31
Uh, I hate to point out the obvious, but that's what the 1st post in this thread ia all about.:rolleyes:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.