Log in

View Full Version : How to convert 16:9 to 2:40


dzirkelb
20th January 2011, 19:40
I am in the process of merging multiple mkv files (movie file, intro file, trailer files) into one file for a more theater experience. It will include roughly this:

Intro to theater
movie trailer
movie trailer
sit down and shut up type video
actual movie

I am starting to use mkvmerge to do this, but am running into problems out of the gate. I believe they are because many of the files I am trying to merge have different resolution and format (along with audio tracks, which I posted seperate about).

So, is there a way to convert my movie intros from 16:9 to 2:40? And, I'm guessing the resolution would need to be the same. Is there a way to convert my, say, 720p trailer to 1080p? Or, trick mkvmerge into thinking they both are 1080p?

weasel_
20th January 2011, 20:43
U cant trick mkvmerge
And only way to convert 16:9 to 2.40 is crop/resize

dzirkelb
20th January 2011, 20:57
I'm ok with doing that. Is there a walkthrough somewhere already written up I can use, or, is there an easy program that will do this for me?

RunningSkittle
20th January 2011, 21:10
avisynth+x264 or one of the gui's here:
http://forum.doom9.org/forumdisplay.php?f=78
or Handbrake

dzirkelb
20th January 2011, 21:30
I downloaded Handbrake as I hear a lot about it. I see a crop section, do I have to just play around until I get the right amount of cropping to fit on my screen?

Or, is there a program or an option on Handbrake to automatically resize it, without cropping it, so it will fit on a 2:40 screen (with adding black bars wherever necessary)?

J_Darnley
20th January 2011, 22:24
A simpler suggestion is to use a playlist, that way you don't need the videos to be the same size.

dzirkelb
20th January 2011, 22:26
I am merging them into one file because I use WMC as my media device, and I am not aware of any program that interfaces with that to create a playlist. I also use mediabrowser extension within WMC as I really like the interface. WMC with mediabrowser is the only software I have found that will give me a graphical interface, and output HD audio (I liked boxee, but it didnt' output HD audio).

If there is something else out there that I can create playlists with, and still give me a graphical interface, and output HD audio, then that would most definately be ideal. I hear a lot of people use itunes to make a playlist, but I don't think it gives the cover art of each movie, synopsis, tile viewing, etc...if it does, then correct me please and I'll go that way in a heart beat.

As to converting to 2:35, I may be using the incorrect terminology. So, I'll give a brief background of what I have and what I want.

I have a cinescope format Stewart screen, and I have a Panasonic ae4000 projecting onto it. The panny has the auto zoom for 16:9, and it works great. However, it takes a little time to adjust, says "adjusting" or whatever while it does the adjustments, and isn't ideal for quick 30 second intro videos.

So, I would want to play a media file that will display everything on the screen, without projecting off the screen, without having to tell my projector to zoom in / out to fit to the screen.

So, in a sense, I want to shrink the 16:9 videos so they will fit on a cinescope screen without having to change the zoom on the projector.

I will not be doing this on 16:9 movies, I will just leave the intros in their native 16:9 format, and let the projector do the work.

Does that make a little more sense on what I am trying to accomplish?

zapco
21st January 2011, 04:14
Ah, 2.4:1 screen...that changes things a bit.

So, the Panny is actually projecting 1920x800 active at full (2.4) zoom. Therefore, you'll need to resize your 16:9 material to 1424x800 and add 140 pixels of black top and bottom and 218 pixels of black on each side to make it 1920x1080 (which I'm assuming is the native rez of your movies, unless you've reencoded them) in order for it to center properly on the 2.4 screen, just like the 2.4 movie will.

As for tools to do this...it sounds like you're not comfortable with the command line and batch files (as has been recommended, AviSynth+x264 would be the most direct way to do this), so yeah, Handbrake is probably your next best option. It's been awhile since I've messed around with it, and I've never played around with its cropping/resizing stuff.

Does it look like the aforementioned resolution and cropping/border info could be applied in Handbrake?

Edit: So I do still have Handbrake installed on my work PC...it appears that it can do cropping, but can't add borders, so you're kinda SOL there. VirtualDub is the only other encoding GUI I've ever used (and even then, only for previewing AviSynth scripts), so I can't offer any more help as far as what to use.

dzirkelb
23rd January 2011, 17:50
Thanks for all your help. I am comfortable using command line interface, I program for a living and have played with Dos back in the mid 90's to today. However, I would much like a link to a walkthrough on how to install, configure, and use it. Or, if you could just list the commands step by step in this chain, that would be awesome also :)

And, what you are suggesting is exactly what I am looking for I believe.

zapco
24th January 2011, 01:22
Sure thing - download and install these three programs:

- Avisynth (http://avisynth.org/mediawiki/Main_Page) (pick a download link at the top of the page depending on whether you're running 32-bit or 64-bit)
- Haali's Media Splitter (http://haali.su/mkv/)
- ffdshow (http://sourceforge.net/projects/ffdshow-tryout/files/SVN%20builds%20by%20clsid/icl10%20builds/)

...and of course, x264 (http://x264.nl). :)

Defaults for everything should work fine. Create a .txt document in whatever folder you dropped x264.exe into, and put this in it:


DirectShowSource("input file with path here")
LanczosResize(1424,800)
AddBorders(218,140,218,140)


This assumes 16:9 input material. Also note that DirectShowSource is generally frowned upon because it's not frame-accurate, but if you're not doing any editing, it works fine. If you're paranoid, move avss.dll from the Haali Media Splitter folder into the AviSynth plugins folder, and use DSS2("input file here") instead of DirectShowSource. DSS2() uses Haali's splitter for seeking, and therefore is frame accurate, but I've never had a problem with the stock filter when just doing a one-shot encode.

Name that file whatever you want, but change the extension to .avs, which indicates an AviSynth script.

Then create a batch file, or fire up a command prompt and navigate to your x264.exe folder, and drop this in it:


x264.exe --crf 18 -o output.mkv input.avs

This will give you a 1920x1080 H264 mkv that should be playable by pretty much anything (that can actually handle 1080p, of course). The only caveat here is that while the default x264 settings will produce a file with an H264 level no higher than 4.1 (the max Blu-ray spec) - assuming 23.976 fps - I'm not sure if the number of ref and b-frames have to be the same among the joined files. If so, you'll need to check your main movie file with something like MediaInfo or Avinaptic to find out those parameters and then add them to your x264 command line ("--b-frames # --ref #"). Basically, just see if everything works first, and if doesn't, come back to this...or wait for someone to correct me. ;)

Lather, rinse, repeat for all your files, join everything in MkvMerge, and off you go.

Note that while the Matroska spec allows for varying frame rates within the same mkv, you're probably better off making sure everything is at 23.976 fps, just like your movie, and AviSynth has several filters that can make sure that happens if needed.

dzirkelb
24th January 2011, 21:37
Thanks for all of this info! I did run across a program that does ths and allows the adding of the borders called Staxrip. Combining what you have told me here, and the gui information of that program, I was able to successfully shrink the size of the output to fit on my 2:40 screen with adding black borders on top and bottom (top borders project off the screen), so, now, I just have to do this with all of my intro videos.

Thanks again!