# MagicYUV, VfW, and lossless recording performance



## AlexFolland (Jan 31, 2017)

MagicYUV is an unfortunately proprietary video codec that can encode lossless RGB HD content extremely quickly.  In my loose testing, MagicYUV was more than double the speed of the UT Video codec.  The bottom line for me right now is that I am unable to record lossless 1920×1200 RGB at 60 Hz in real time without dropping frames with OBS Studio in any way on my computer right now.  I am only able to do it with proprietary tools: DxTory using the MagicYUV codec.

I posted about this in the MagicYUV thread at Doom9, in hopes that the author might be interested in open-sourcing it for inclusion in ffmpeg, but I don't think there's any hope of that, considering the progression of the MagicYUV usage terms (originally freeware, later pay-what-you-want, currently trialware/payware).  Here are the relevant posts: https://forum.doom9.org/showthread.php?p=1795311#post1795311

OBS is my favorite tool for streaming since it lets me add webcam, stream to web streaming services, and other such things, plus it is FOSS and provides access to the awesomeness of ffmpeg.  DxTory doesn't have that.  However, DxTory does have a VfW ("Video for Windows"; aka "Media Foundation" I think?) encoding interface, allowing me to use MagicYUV with it.

Regarding performance, I would use NVENC, but it doesn't seem to have lossless RGB encoding, or at least it returns an error when I try to start recording with OBS with lossless RGB settings.  I'm using a GTX 690 video card from 2012, so the NVENC support might just be outdated.  My CPU (i7-2600k) supposedly supports QuickSync, but my motherboard doesn't let me use it, as it doesn't have video out (wish I had known this limitation when buying it).

I've tried UT Video, libx264rgb, and Lagarith in OBS, all with the fastest settings available (preset=ultrafast for libx264rgb for example).  None of them could keep up.  My hard drive is definitely keeping up, as the DxTory/MagicYUV versions of the same videos are almost the same size.  I tested this by transcoding a few MagicYUV lossless RGB dumps to those formats with ffmpeg like this: ffmpeg -i "justtheclip.avs" -c:v libx264rgb -qp 0 -preset ultrafast -threads 12 -c:a flac -compression_level 12 -y "ffmpegconvertedfile.mkv"

Anyway, count me as another person interested in any way to use MagicYUV or any sort of higher-performance lossless RGB recording technology than UT Video.  Whether it's via DirectShow or "VfW"/"Media Foundation", this would make DxTory finally replaceable.


----------



## Skretzo (Jul 28, 2017)

Support. 
Many people think that VfW is outdated or not useful anymore, but I use it a lot.

You said you have tried Lagarith in OBS. As far as I know, Lagarith is not included in FFmpeg, so how did you do that? Maybe you tried HuffYUV and not Lagarith? If not, you should try HuffYUV or ffvhuff (FFmpeg's version) as they both gave me better performance than UTVideo.

If possible, I would also like to see support for multichannel audio when using Custom Output (FFmpeg).


----------



## Elusion (Oct 10, 2017)

Same, i would like to encode with MagicYUV in OBS. 
It's more easy to work with.
It's lighter for the CPU in encode or reading. 
Hope OBS coud record with custom codec soon.


----------



## RytoEX (Nov 3, 2017)

Apparently, a MagicYUV encoder was added to FFmpeg sometime near the end of October 2017, for what it's worth.  The commit is dated July 8, 2017, but it wasn't merged into FFmpeg git master until recently.


----------



## DrunkMonk74 (Jun 4, 2018)

Resurecting an old thread here, but does the last post by RytoEX mean that you can now use MagicYUV with OBS? I haven't used OBS in some time, but am considering it right now. The lack of this codec and the lack of any overlay when recording, (which I believe is still the case), were my main reasons for not using it. But if one of those factors has now been addressed........


----------



## RytoEX (Jun 5, 2018)

At present, the only way to do so would probably be to compile OBS Studio yourself with FFmpeg 4.0 or newer and then use "Custom Output (FFmpeg)".  Whenever the official OBS releases update FFmpeg, you would still have to use the Custom Output.

As I understand it, inserting overlays into games is a non-trivial thing, and I don't know that any OBS contributors are currently working on or researching such a thing.  Given that the project is open source, anyone is welcome to submit a patch, of course.


----------



## computerquip (Jun 20, 2018)

For what it's worth, it looks like UTVideo as a codec has had some improvements over the years: http://umezawa.dyndns.info/wordpress/?p=6934#more-6934


----------

