Quantcast
Channel: PS3Hax Network - Playstation 3 and Playstation 4 Hacks and Mods
Viewing all articles
Browse latest Browse all 19236

Recode mkv files to Full Hd+work with ps3 and all

$
0
0
How to Get 1080 or 720p MKV files compliant. and play full surround


this guide work for ps3, but also all other devices that handle mkv files.

This guide is in two sections.

section 1 explanation.

section 2 graph tutorial.









first time you do this it can be an little confusing but second time its a pease of pie :)


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. Problem is that most 1080p mkvs are encoded with more than 4 frames per reference which bluray hardware and ps3's(dream) 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(mkv file) 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.
(for this case we make an mkv complient file :) )


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 , Audio, and optionally .srt subtitle streams from your .mkv file, We will just concentrate on the audio stream here. use TSMuxer to create a .dts and srt output file for the video and sub and use the demux option for the audio stream you want.

(the output wil be *.dts file)

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
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.mkv 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.mkv",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 720p).

the following is to resize a 1920x1080 video down to 720p for your 2nd line of code.
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.
Code:

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.
Code:

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:

(you can use this standard script and change values works for me)

avs script here
URL="http://www.mediafire.com/?tlspjpjxyqpxwbl"]http://www.mediafire.com/?tlspjpjxyqpxwbl[/URL]

Code:

DirectShowSource("C:\video.mkv",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 mkv file then get CCCP codec pack (Combined Community Codec Pack) and install it.

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

Choose x264 scratchback 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 (Bincsoft) (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).
(my case an small hour)


(note)
6.some time when i used the *.dts file that we extracktet from tsmuxer the sound wont play on db but after new dreambox drivers with dts support i havent got problem.
But to be sure to not have any problems with dream box you can convert the *.dts file (audio) to *.ac3 file.(simple)

to do this open meguide again
under audio press add and select *.dts file

encoder settings select Aften AC-3 scratchback

extension select AC3

press enqueue

and go to top of screen press Queue and start job output file is *.ac3





7. BD compliant video stream
You now have a .264 raw bluray compliant video stream(mkv) and can use
MKVtoolnix
open mkvtoolnix and add both the reencoded *.mkv file and either *.dts or *.ac3 and *srt sub file if wantet then press add job to queue and press start muxing

thats it copy mkv file to box and get full hd and sound. :)

enjoy


LINKS
tsmuxer
http://www.videohelp.com/download/tsMuxeR_1.10.6.zip
meguide
Browse meGUI Files on SourceForge.net
mkv toolnix
http://www.bunkus.org/videotools/mkvtoolnix/









Section 2







Here is small guide with screens read toturial to understand screens

screen examples made with movie Crank 2


1)

open tsmuxer add movie



select demux



press start demux output file will be dts file.

2)


rightclick mkv file this case crank2.mkv select mediainfo

and get info




3)
open windows calculater

in this case the original pixxels are
1280x688

so we do this 720-688=32
32/2 =16



4)

open syntax avs file put info in and save




5)

open Meguide

and open avs syntax script





select output mkv file

6)open bitrate calculater



select output



7)

press queue

and start queue





8)

start mkvtoolnix guide

add mkv output file from Meguide output
and dts output file from tsmuxer



selexkt name for output and press start muxing


THATS IT :)

copy to dream movie folder and watch[/QUOTE]

Viewing all articles
Browse latest Browse all 19236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>