x265 – a multithreaded hevc encoder

x265logo

A new HEVC encoder has been released by MulticoreWare – the x265 encoder.

This tool is not being directly developed by the x264 developers, but they have tentatively thrown their support behind it as it should remain open source software.  Discussion about its release and development can be found on the Doom9 forums.

Tom’s Hardware has also done an early evaluation of the speed/psnr of this release.  They claim it encodes at 4 fps on a Core i5 processor – quite a bit faster than the reference encoder.  However it doesn’t offer near as many options for encoding as the reference encoder and only uses a simple GoP with 4 reference frames using P-frames – I would guess this is just the standard encoder_lowdelay_main.cfg we’ve tested with before.  It does produce good results, but it kind of stinks to be locked into it without the ability to tinker.

I haven’t done a full encode with this alpha yet but I have uploaded a copy of the program along with the release notes: x265 alpha release.

Some things to note are that it seems x265.exe automatically sets IDR to output a closed GoP – so seeking will work fine in these files.  It also has an option to set ‘–gops’ whereby you can set the number of GoPs to encode concurrently, which is essentially the exact same thing we did previously with the reference encoder by cutting our source into individual GoPs.  It’s just much more convenient here!

The Steam Summer Sale is under way!

steamsummersale

www.steampowered.com

www.steampowered.com

Time to buy* games that I’ll never even play just because they’re cheap!  Not much going on now…but it’ll be a fun week of watching flash deals and buying up anything I’ve missed.  In particular I’d really like to pick up Dark Souls.  Of course I need to finish Bioshock Infinite, Tomb Raider, Far Cry 3, Crysis 3, and Darksiders 2 before I’d get into it…. and continue doing my weekly LFR’s on WoW, working on getting into Nightmares in TSW, and trying to finally beat Touhou 13 – Ten Desires on Lunatic.  These are the problems that plague me.

 

 

 

 

 

*And by ‘buy games’ I of course mean ‘purchase a license to use the product through Steam’….but such is the price of convenience.

HEVC in .avi – why not?

So after playing around with the lentoid HEVC encoder and finding it results in watermarked pictures it looks like the HM 11.0 reference codec is still the way to go to make test videos right now, but we’re still very limited in how we can play those files back if we want to create a video with sound.  We have a good directshow decoder available – the Lentoid HEVC decoder – but it’s not generally exposed to files we create because regular mp4/mkv splitters can’t interpret the video streams.

To recap, as of right now we can mux and hevc video and audio track into the .mp4 file format but we can only play these files back with the GPAC Osmo4 player.  This isn’t a decoder limitation, it’s because we don’t have a readily available .mp4 splitter to read the video stream from the container.  Osmo4 uses its own .mp4 splitter that supports this, but it’s not available to other media players.

We can mux into the matroska container but again we have no way to play back the video stream with most players because no available matroska splitters understand HEVC video in matroska.  The Divx Plus Player with the HEVC plugins can read these files because it uses its own custom matroska splitter, but it comes with a lot of bloatware.

With the Lentoid HEVC Encoder we can mux HEVC video into the .flv container – video and audio only.  This is a good solution and it is compatible with any hevc videos you create using the Hm10.1 or Hm11.0 reference encoders but with the limitation that it always assumes the Reference Encoder files are 25 frames per second – I don’t know of a way to tinker with the frame rate of .flv files so as far as I know you’re stuck with that.

A solution is to instead mux our HM11.0 Reference Encoder streams into the .avi container which will expose the fourcc to the lentoid directshow decoder and then set the correct framerate in VirtualDubMod.

In order to do so you’ll need to run GraphStudioNext – an update to GraphStudio that I had recommended in the previous post.  It works pretty much the same but has active development.  Get the 32-bit version, the lentoid codecs will not be available with the 64-bit version.

Go to your .hevc file and rename it to “whatever.hm10″ – if you recall the Lentoid HEVC decoder originally only supported the fourcc hm10 and it seems the Lentoid HEVC Source filter still has this limitation.

In GraphStudioNext add the filters Lentoid HEVC Source with your file, AVI Mux, and FileWriter with”your_output.avi”.  Connect them as seems obvious.

Lentoidavi

This will give you an .avi file with your HEVC stream.  Why does this work when .avi most certainly has no idea what an HEVC stream is?  Heck if I know!  But it will play in any directshow media player with access to the Lentoid HEVC Decoder so you can now enjoy your video in MPC-HC and the like.

But we’re not done yet – when you play the file you’ll quickly notice that there is a problem.  It’s stuck at 25 frames per second.  For whatever reason all muxing tools – mp4box, mkvtoolnix, Monogram flv muxer, and AVI mux – seem to assume that any hevc video is always 25 fps.  But that’s not a problem in this case – go back to trusty VirtualDubMod and load up your video.  Only DirectStreamCopy is available for video processing, but we still have access to the .avi framerate property.  Set it to the proper value and re-save the file.

virtualdubhm10virtualdubframeratevirtualdubframerate2

With that done, we now have a proper framerate HEVC .avi.  You can mux in an .mp3 sound file to go with it and it will play back with the lentoid decoder with no fuss.

kaibahevc

Here’s an example file if you’re interested, a 1920×1080 snippet from the first episode of Kaiba, no sound.  QP18 using encoder_lowdelay_main.cfg. (as this is a 24 second clip with no sound it is of course used entirely for educational purposes – though I recommend the anime)

HEVC in .avi – the past meets the future.

Little Witch Academia 2 Kickstarter – fund an expansion to Trigger’s next project

71a71d7853d4ea88c3227f2dcd812de8_large

The anime studio Trigger has started a kickstarter to expand the sequel animation to Little Witch Academia.  It was a great one shot animation project and I for one am happy to support its continuation.

If you haven’t seen it you can check it out on YouTube.

They’ve already reached their goal but any extra will go to improving the project or for further materials – so go donate!

Strongene Lentoid HEVC Encoder – fun with Graphedit

Strongene has released a new HEVC directshow encoder as well as an updated version of their HEVC decoder and tools to mux hevc/audio into flv files for playback through any directshow media player.  You can find their latest releases here:

http://strongene.com/en/downloads/downloadCenter.jsp

The updated decoder filter has support for additional fourcc codes and will now natively decode hm10, HM10, hevc, and HEVC files which makes it much  more convenient for viewing raw hevc video streams that you may have created with the HM11.0 reference encoder.

But the really interesting product they’ve now released is their HEVC encoder.  I haven’t done any deep testing with it yet but here are the options it gives you right now:

lentoidenc01lentoidenc02

 

Not much in the way of options – with the Lentoid HEVC encoder you won’t have to set up GOPs or anything like that.  What we do have access to is the IDR period which defines a GOP.  Seeking works flawlessly with the output files so we can assume this is using a closed GOP.  You have two options for rate control:  ABR or constant QP.  ABR tries to hit a specific data rate while cQP simply encodes each frame with a static QP, much as my previous testing with the reference encoder has done.  The Lentoid Encoder is multithreaded and its speed is much greater than the HM10.1 and HM11.0 reference encoders, but still far from speedy.  I haven’t done any full tests yet but I’d hazard to guess it is 2-4 times faster than TAppEncoder right now.  I’ll be testing for quality differences in the future.

We can’t see any of the other options that the encoder is using – the number of reference frames, whether it’s using P frames or B frames, what search range it uses for ME.  It would be preferable to have these options to play with, but the encoder does seem to do a fair job with whatever presets it uses.  However, it is a directshow filter so how do we go about encoding with it?

Graphedit, of course!  Here’s a brief walkthrough:

To use the Lentoid HEVC encoder you’ll want to go and grab a copy of GraphStudio.  Grab the Lentoid HEVC Encoder filter from the link above if you haven’t already.

From the main screen select ‘Graph’ and then ‘Insert Filter’.  A list of available Directshow filters will pop up.  First we need to open a source file so select ‘ File Source (async)’ and find the file you’d like to work with.  I’d recommend it be a file format that can be easily played back by ffdshow or lavfilters.

lentoidenc03

 

Once you’ve added your source we first need to decode it.  For myself, I like using LAV filters on my home system so first I selectLAV Splitter.  Click on the ‘out’ pin from your source file and drag an arrow to the ‘input’ pin of LAV Splitter.  If it worked correctly you’ll now see pins representing all of the media in your source file which LAV Splitter can recognize.  Next add LAV Video Decoder.  Click on the ‘video’ pin of LAV Splitter and drag the arrow to the ‘input’ pin of LAV Video Decoder.  Next add Lentoid HEVC Encoder.  Drag an arrow from the ‘output’ pin on LAV Video Decoder to the ‘XForm In’ pin of the Lentoid HEVC Encoder.

To set options for the encoder either double click on the Lentoid HEVC Encoder box or right click on it and select ‘properties’.  Here is where you can set your intra period, bitrate/QP, and the number of threads you’d like to encode with

.  Once that’s done we can set the output file and Graphedit will automatically fill in the muxer.  So add ‘File writer’ with whatever output name you’d like as an .flv file.  Click and drag the arrow from the ‘XForm Out’ pin of the Lentoid HEVC Encoder to the ‘in’ pin of your output file.  The FLV muxer will automatically be added.  Now go back to the LAV Splitter, click on the ‘audio’ pin and drag it to the ‘in 1’ pin of the Monogram FLV muxer.

That’s it!  You’re ready to encode now.  Your graph should look something like this:

lentoidenc04

 

To begin the encode click the green ‘play’ arrow along the top bar.  The timecode will progress rapidly, but it isn’t accurate to show what percentage of the encode has actually been completed and will show the encode at 100% complete almost immediately.  Nonetheless your computer will keep chugging along and in time it will give you a completed file.

Only one problem….

_sigh_watermarked

Watermarked 🙁

What a shame – this would have been a much easier workflow to use compared to the HM11.0 reference encoder and Strongene could have gained some traction with their solution before the big players enter the field, but with watermarking there’s no practical use for the software aside from testing.  So as interesting as this new software is it still leaves me wanting something more robust.  I’m itching to do some archiving.

Happy Encoding!

 

DivX HEVC Decoder released

DivX Labs has released their HEVC Decoder for testing.  It allows you to playback hevc streams using DivX Labs experimental matroska support – so you can indeed create fully featured video/audio/subtitle files this way.  The only problem is that the DivX decoder only works with the DivX Plus Player – which won’t let you play back nice subtitle files anyway.

I haven’t used the DivX Plus Player to any great degree but my initial impressions of it are that it’s not a good player – it throws massive errors on most normal anime encodes I tend to watch, it installs 5 separate pieces of software to clutter up your start menu, it tries to get you to install search bars, and it is loaded with ads trying to get you to buy video content through DivX.  This is not the kind of software I would choose to use unless it had exemplary HEVC support.  And it doesn’t – currently it doesn’t allow seeking in video files.  So for the moment it’s usefulness is really only in testing hevc.mkv’s that you may have created.

That, in and of itself, is a good first step, I guess.  But only as a proof of concept to play back hevc from matroska right now. Do be aware that matroska support for hevc is still not finalized and any content you make now may not work when the final implementation is released.

It’s something you may want to play with, but I’d mark it as a pass for now.