Easy way to create Blu-ray/AVCHD using the X264 encoder at DVinfo.net
DV Info Net

Go Back   DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...
Register FAQ Today's Posts Buyer's Guides

What Happens in Vegas...
...stays in Vegas! This PC-based editing app is a safe bet with these tips.

Reply
 
Thread Tools Search this Thread
Old December 17th, 2011, 02:04 PM   #1
Major Player
 
Join Date: Feb 2010
Location: London
Posts: 302
Easy way to create Blu-ray/AVCHD using the X264 encoder

Hi

Please check the pre-requisites below as it will not work without a couple of other programs (all free).

I've now uploaded for anyone who would like it an easy application that uses the very good x264 encoder to create Blu-ray/AVCHD compliant video from Sony Vegas (my main use but can be used with any editor that can output to the Lagarith codec). This isn't a commercial application, and no advertising, no nag screens, just an application I did for myself that other's may benefit from.

Download from my SkyDrive here Download

Please note I haven't gone to the trouble or expense of digitally signing the install file, so on Windows Vista/7 you will get an "are you sure" alert when installing. Feel free to pre-scan with a virus scanner if you wish. The application uses .NET 3.5.

What it does?
  • Takes Lagarith uncompressed HD video AVI's and an AC3 audio file and encodes to H264 with the audio mux'd in.
  • Optionally converts 1920x1080/50p/60p to: 1280x720/50p/60p using a good resizer, or to 1920x1080/50i/60i interlacing the footage, or to 1920x1080/25p/30p by using every other frame.
  • Enforces a valid output to AVCHD/AVCHD 2.0 and Blu-ray.
  • Supports 64bit encoding for compatible set-ups for a bit of extra speed on 64bit computers (see below).
  • Does RGB studio/computer level conversions as required and encodes using the correct colour matrix (BT709).

Pre-requisites:
  1. Lagarith lossless codec required, download link http://lags.leetcode.net/LagarithSetup_1327.exe
  2. AVISynth needs to be installed, the 32bit version is here Avisynth rev. 2
  3. For 64bit encoding the 64bit version of Avisynth needs installing alongside the 32bit, instructions here
    The 64bit port of everyone's favorite script based video editor


To use from Vegas:
  1. Choose to output your project as Windows AVI file type, then click Custom, select the frame size of your source, all these are supported by the encoder 1920x1080, 1440x1080, 1280x720
  2. Frame rate: set the same as the source, 60p, 50p, 30p, 25p, 60i, 50i are supported by the encoder.
  3. Field order: set as appropriate to your footage (interlaced HD is usually upper field).
  4. Pixel aspect ratio: should be 1.000 or 1.33333 for 1440x1080 HD.
  5. Video format: select Lagarith Lossless Codec then click Configure, make sure mode is RGB (Default), out of the other check box options, have 'Use Multithreading' as the only option ticked, click OK
  6. Leave other video settings at the default.
  7. Audio tab: don't include audio, we'll render out AC3 separately.
  8. Project tab: Video rendering quality select Best
  9. Recommend to save this as template for next time.
  10. ...Render your Video
  11. Create the audio AC3 by rendering to Dolby Digital AC-3 by selecting that in the Save as type

Note: if you play the Lagarith file back it may look washed out, don't worry, after encoding all will be okay

Encoding
  • Start Easy Blu-ray encoder program, if encoding is going to be using the 64bit X264 encoder it will say in the title of the form.
  • Browse to the AVI file, the file details and a confirmation it is a supported input file type is shown.
  • Browse to the AC3 audio file.
  • The Lagarith codec doesn't know if it holds interlaced or progressive footage, so check/uncheck the Interlaced Video option as appropriate as this setting can't be set automatically.
  • If your timeline is at studio level, usually the default, leave "Video is 0-255 RGB" unchecked. If the timeline is at computer levels, then check this box. This will ensure the encoding is made with the levels correct.
  • Under Output settings, decide your resolution, not all will be supported, for example you can't output 720p if the input is interlaced. If the output resolution isn't supported, it will flick you back to a supported one.
  • Select the frame or field rate, again not all will be supported by all inputs, for example you can't input 50i and select 50p as an output.
  • Select the destination format, again you will only be able to select options that the format supports, for example you can't select AVCHD if you are outputting 1080/60p/50p, you must select AVCHD 2.0.
H264 Output settings
  • Browse to a location and enter a file name for the finished output.
  • Select the encoding quality. I recommend always using 'excellent', but feel free to try the other options.
  • Select the bit-rate, you will only be able to use a bit-rate upto the maximum supported by the format type, for example AVCHD will only allow a maximum of 24,000.
  • Select to use or not use 2 pass encoding. For better compliance and better quality output, use 2 pass. Note that the second pass is slower than the first pass, this is normal.
  • Click Start to start the encoding and wait for it to finish. Once finished you will have an .mts file with your video and audio mux'd into it.

Let me know of any problems, hope it is of use to someone.

Credit to: This application uses the free libraries from MediaInfo and TSMuxer, and of course the open-source X264 encoder, these are included in the installation. The x264 encoder is the latest version as of todays date.

Regards

Phil
Attached Thumbnails
Easy way to create Blu-ray/AVCHD using the X264 encoder-untitled.gif  
Phil Lee is offline   Reply With Quote
Old December 22nd, 2011, 12:34 PM   #2
Trustee
 
Join Date: Jun 2004
Location: Denver, Colorado
Posts: 1,891
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Great work Phil. Let's bump this thread up.
Tom Roper is offline   Reply With Quote
Old December 22nd, 2011, 02:15 PM   #3
Inner Circle
 
Join Date: May 2005
Location: Windsor, ON Canada
Posts: 2,770
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Phil, you really should put this in the Sony Vegas Tutorials sticky so it doesn't get buried in a few days.
Mike Kujbida is offline   Reply With Quote
Old December 22nd, 2011, 05:43 PM   #4
Major Player
 
Join Date: Dec 2007
Location: London, UK
Posts: 277
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

I would also put it as a sticky in the Non-Linear Editing on the PC forum, as it will be really helpful for all users on Windows, not just Vegas.

Great work, thanks for sharing!

As this is something you created for yourself, I assume there's not much point in making "feature requests", but for what it's worth:

- A no-installer version would be great
- With CineForm and DNxHD both available for free, what is the reason you prefer to still use Lagarith? (I know CF and DNxHD aren't lossless, but do you actually notice a difference that justifies the monstrous file sizes?)
Jon Shohet is offline   Reply With Quote
Old December 23rd, 2011, 02:09 AM   #5
Major Player
 
Join Date: Feb 2010
Location: London
Posts: 302
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Hi

Preference for Lagarith is just that it's free and lossless, other methods are frame serving from Vegas but I've found that a bit of a hassle and not always reliable. Given most of us have huge hard-disks with tons of space working with big files isn't too much of an issue hopefully.

Also using Lagarith it will accept and store the video in the RGB colour space, which is what Vegas works in on the timeline, so it's avoiding colour space conversions, leaving AVISynth to sort that out with the correct colour matrix for Blu-ray/AVCHD, and that seems to keep things very true to the original. My main goal was not to introduce any extra conversions or losses just because encoding was happening by x264 outside of Vegas, so Lagarith is essentially the raw output from Sony Vegas.

I can look at supporting other inputs, I'll have a go with Cineform, in theory any codec supported by the PC should work via AVISynth, just the application doesn't let it as some of the AVISynth colour conversions might not be correct.

A no installer version I can put together easily, I'll upload this as an option shortly.

Regards

Phil
Phil Lee is offline   Reply With Quote
Old December 28th, 2011, 02:46 AM   #6
New Boot
 
Join Date: Nov 2006
Location: Redmond, WA
Posts: 14
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Hi Phil,
May I ask you, why your "Easy Blu-ray encoder" doesn't support 23.976 frame rate for blu-ray encoding (1920x1080)?
Attached Thumbnails
Easy way to create Blu-ray/AVCHD using the X264 encoder-pic_1.jpg  
__________________
Canon XH A1, Sony PMW-EX3/2, LUMIX GH2, Sony Vegas 11.
www.HDVideoProduction.TV
Slava Alekseev is offline   Reply With Quote
Old December 28th, 2011, 03:01 AM   #7
Major Player
 
Join Date: Feb 2010
Location: London
Posts: 302
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Hi

An oversight on my part, I'll add support in the next update, which also includes the ability to use CineForm files as well.

Regards

Phil
Phil Lee is offline   Reply With Quote
Old December 28th, 2011, 06:42 AM   #8
Major Player
 
Join Date: Feb 2010
Location: London
Posts: 302
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Hi

A new version is here:

Windows Installer or Download Files only

Please see first post for pre-requisites and usage.

Changes:

Added support for CineForm AVI files
Added support for 24fps AVI files
Added option to set the tuning for x264 (film/video, grain, animation, still images)
Added Maximum Quality option for x264
Added support for Lagarith YUV, it is recommended to output to Lagarith using RGB but it will now encode Lagarith YUV.

Regards

Phil
Phil Lee is offline   Reply With Quote
Old December 28th, 2011, 09:41 AM   #9
Major Player
 
Join Date: Dec 2007
Location: London, UK
Posts: 277
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Thanks again for all the effort!
Jon Shohet is offline   Reply With Quote
Old December 28th, 2011, 10:08 AM   #10
New Boot
 
Join Date: Nov 2006
Location: Redmond, WA
Posts: 14
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Nice! Thank you very much, Phil! We appreciate your hard work Well done!
__________________
Canon XH A1, Sony PMW-EX3/2, LUMIX GH2, Sony Vegas 11.
www.HDVideoProduction.TV
Slava Alekseev is offline   Reply With Quote
Old December 28th, 2011, 01:12 PM   #11
New Boot
 
Join Date: Nov 2006
Location: Redmond, WA
Posts: 14
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Hi Phil,
It's me again. I am sorry, but I have another question: why is output color space YUV? I rendered from Vegas 11 to LAG with RGB color space. After encoding in "Easy Blu-ray Encoder" the color space now is YUV. Take a look at this pictures, please. First pic is input info, second is output info and last pic is interface of "Easy Blu-ray Encoder". Anyway, thanks again.
Attached Thumbnails
Easy way to create Blu-ray/AVCHD using the X264 encoder-input.gif   Easy way to create Blu-ray/AVCHD using the X264 encoder-output.gif  

Easy way to create Blu-ray/AVCHD using the X264 encoder-easybluray.gif  
__________________
Canon XH A1, Sony PMW-EX3/2, LUMIX GH2, Sony Vegas 11.
www.HDVideoProduction.TV
Slava Alekseev is offline   Reply With Quote
Old December 28th, 2011, 03:56 PM   #12
Major Player
 
Join Date: Feb 2010
Location: London
Posts: 302
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Hi

H264 for Blu-ray/AVCHD files are always YUV, so it is correct the final encoding is YUV 4.2.0.

The output from Sony Vegas being RGB to Lagarith is a convenient way of avoiding any extra colour space conversions and so stops any small rounding errors that might be introduce with multiple colour space changes. Sony Vegas works internally with RGB, so outputting as RGB to Lagarith is essentially the raw output from Sony Vegas. AVISynth is then used by the Easy encoder to convert RGB into YUV 4.2.0 for the x264 encoder. This method seems to provide the most accurate final output with no shifts in colours due to colour space conversions.

I don't think H264 supports RGB colour space, it has to be YUV regardless.

Hope that helps explain.

Regards

Phil
Phil Lee is offline   Reply With Quote
Old December 28th, 2011, 04:24 PM   #13
New Boot
 
Join Date: Nov 2006
Location: Redmond, WA
Posts: 14
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Thanks a lot, Phil! :-)
__________________
Canon XH A1, Sony PMW-EX3/2, LUMIX GH2, Sony Vegas 11.
www.HDVideoProduction.TV
Slava Alekseev is offline   Reply With Quote
Old July 30th, 2012, 05:54 PM   #14
Major Player
 
Join Date: Apr 2008
Location: OC, CA
Posts: 344
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

Question answered. Thank you Phil for this tutorial.

Last edited by Norris Combs; July 31st, 2012 at 12:37 PM.
Norris Combs is offline   Reply With Quote
Old July 31st, 2012, 05:57 PM   #15
Major Player
 
Join Date: Apr 2008
Location: OC, CA
Posts: 344
Re: Easy way to create Blu-ray/AVCHD using the X264 encoder

I've encountered a little problem, when encoding with x264, I selected the bit rate at the maximum value allowable for bluray, which is 40,000. Now I'm trying to have DVD Architect author it, and it can't. There's an error message stating that the overall bitrate is above 28,000. So apparently, DVD Architect cannot author anything that has a bit rate above 28,000. Am I misunderstanding what DVD Architect is telling me? FYI, I'm trying to have DVD Architect author this 5.5 GB .m2ts file as a BD, to a 8.5 GB double-layer DVD+R.

I've been able to author a BD this way before, but have never used a bitrate this high.
Thanks for any help,
Norris Combs is offline   Reply
Reply

DV Info Net refers all where-to-buy and where-to-rent questions exclusively to these trusted full line dealers and rental houses...

B&H Photo Video
(866) 521-7381
New York, NY USA

Scan Computers Int. Ltd.
+44 0871-472-4747
Bolton, Lancashire UK


DV Info Net also encourages you to support local businesses and buy from an authorized dealer in your neighborhood.
  You are here: DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...


 



All times are GMT -6. The time now is 06:07 AM.


DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network