Previous topicNext topic

Best Video Format for Magic

Questions, comments, feedback, etc.
Post Reply
Fractal Grinder
Posts: 109
Joined: Tue Jun 23, 2015 7:42 pm

Best Video Format for Magic

Post by Fractal Grinder »

Hey I was just wondering what the most stable codec or format or whatever for video playback in Magic is.

MOV?
MP4?

Please let me know some of my fractal videos ive rendered are playing choppy.
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

afaik the container (mov/mp4/mkv/etc) doesnt matter, but the codec and bitrate does. h264 for example, kinda standard, compresses a clip quite a bit. which is good generally, because the file is smaller. however the decoding, which happens on the fly at playback is more resource intensive. you kinda trade filesize with cpu stress at playback. this os why old computers cant play modern encoded videos well.

so in magic you may want to try a less efficient codec like mpeg2 (or other? i dont really know), which results in bigger files but more ease at playback.

so you could try that. or you could lower the bitrate, or yoz could increase the read speed of your video files by putting them on an ssd or even a ram disk.
dj0le
Posts: 53
Joined: Sun Jan 31, 2016 9:46 am
Location: Tuzla, Bosnia & Herzegovina

Re: Best Video Format for Magic

Post by dj0le »

I would say h.264 in an MP4 container is your best bet for most videos. I only use MOV if I need to preserve an alpha transparency (or if I need it to be Resolume native DXV).

What encoding settings are you using on these choppy videos, and what program are you using to render them? Maybe the issue is with how you are recording them and not Magic.
Fractal Grinder
Posts: 109
Joined: Tue Jun 23, 2015 7:42 pm

Re: Best Video Format for Magic

Post by Fractal Grinder »

In the manual it says the "Hap" format is the best so thats what im converting all my stuff too. Thanks guys.
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

Fractal Grinder wrote:In the manual it says the "Hap" format is the best so thats what im converting all my stuff too. Thanks guys.
hm i didnt even know about hap (or have forgotten about it). need to look into it as well
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Best Video Format for Magic

Post by Magic »

The real-time performance of Hap is excellent because all the decoding happens on the GPU. It can also jump around and play backwards efficiently because every frame is a keyframe.

The downside is that the files are very big!
Fractal Grinder
Posts: 109
Joined: Tue Jun 23, 2015 7:42 pm

Re: Best Video Format for Magic

Post by Fractal Grinder »

The way im doing my fractal videos its actually not too bad of a file size and the playback is excellent in Magic.
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

according to this: http://www.vidvox.net/forums/viewtopic. ... ap#p115472 HAP is only using the mov container and apparently on windows that's not multlithreaded, so we're again limited to only a few parallel playbacks.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Best Video Format for Magic

Post by Magic »

according to this: http://www.vidvox.net/forums/viewtopic. ... ap#p115472 HAP is only using the mov container and apparently on windows that's not multlithreaded, so we're again limited to only a few parallel playbacks.
Don't worry about those things :). I developed a special custom method to play Hap which is very efficient and doesn't use QuickTime at all (either on Windows or OS X).

The only limitations for how many Hap videos you can play in parallel are the speed of your hardware (especially disk and GPU) and the complexity of your Magic project.

On my main Windows PC, which is somewhat high-end, but not too high-end, I have a Core i7 CPU, GTX 970 GPU, and SSD disk. I can easily play 8 1080p Hap videos at the same time with no dropped frames (and maintaining 60fps).
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

so hap isnt limited by mov even if it comes as a mov file?

you're the best, eric :D
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Best Video Format for Magic

Post by Magic »

so hap isnt limited by mov even if it comes as a mov file?
Nope, because there is a difference between the QuickTime format (.mov) and the QuickTime engine (https://support.apple.com/kb/DL837?locale=en_US).

The QuickTime format just specifies how the encoded/compressed video data is stored in the file, so an application like Magic can decode/decompress the file however it wants. It's also why VLC can play .mov files without QuickTime being installed, for example.

On the other hand, the QuickTime engine is provided by Apple to make it easier for app developers who aren't video experts. But the QuickTime engine controls the decoding/decompressing process entirely, and it's not open-source, so it has certain limitations. For example, it doesn't support 64-bit applications on Windows, and it doesn't fully support Windows 8.1 or 10, which would be major problems for Magic.

But luckily I figured out how to get Hap to work without the QuickTime engine, so I can control (and optimize) the playback process myself, including supporting full GPU decoding.

To my knowledge, Magic is currently the best Windows-based Hap playback solution, and the only 64-bit one :).
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

Eric wrote:To my knowledge, Magic is currently the best Windows-based Hap playback solution, and the only 64-bit one :).
nice, seems we bet on the right horse ;).
TheLaughingBuddha
Posts: 39
Joined: Tue Feb 02, 2016 10:55 am
Location: Newbury, UK.

Re: Best Video Format for Magic

Post by TheLaughingBuddha »

OK...this all sounds good.
I just googled HAP and downloaded and installed the codec but being a n00b in such matters how do I use it?...I can only see how to export .mp4 from MMV.
Regards
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

TheLaughingBuddha wrote:OK...this all sounds good.
I just googled HAP and downloaded and installed the codec but being a n00b in such matters how do I use it?...I can only see how to export .mp4 from MMV.
Regards
the way to go would be this in my opinion: render out png images from magic. then import this png sequence into the video editing software / encoding software of your choice (and one where HAP shows up), then encode it with the hap codec and a mov container. unfortunately the only video editing software / encoding software i saw HAP appear is adobe premiere. unfortunately neither in blender nor handbrake. there are other software like these around though.

btw: you want to render out stuff from magic, then save this as a HAP and then play it again with magic?
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

also: wow. i just tried out HAP videos. i turned off double buffering so i could actually see how many frames my gpu was able to make. when i let magic play back 5 different non-hap videos, i got about 800 fps and a gpu load of about 15%. with the same videos converted to hap (each one about 300mb's), i have about the same cpu load (according to the task manager), but i have about 2200 fps at a gpu load of about 35%. so that means even though the gpu is used more, it produces more frames. no idea how that works, but that's awesome :D.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Best Video Format for Magic

Post by Magic »

I just googled HAP and downloaded and installed the codec but being a n00b in such matters how do I use it?...I can only see how to export .mp4 from MMV.
Hap is a codec that you would use for playback of videos (in the VideoFile module). But you really only need to worry about it if you are using Magic in a live situation, because Hap is designed for real-time performance. If you are just making videos for YouTube, real-time performance doesn't matter as much, so you can use whatever format your videos are already in (.mp4, .avi, etc.).

If you do want to convert your existing videos to Hap, you can re-encode them with any program that supports the QuickTime engine. Or my recommendation is to use ffmpeg, which is command-line so it's harder to use at first, but much more powerful. Hap support was added in the last year or so I think.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Best Video Format for Magic

Post by Magic »

even though the gpu is used more, it produces more frames. no idea how that works,
The GPU load isn't necessarily inverse to the frame rate. For example, if you had something running that wasn't GPU-accelerated, the GPU load would be low, but the frame rate would also be low because all the work would be done by the CPU, which is usually less efficient for graphics and video.

A high GPU load is good -- it means that you are using as much GPU acceleration as possible, which is why your frame rate is higher.
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: Best Video Format for Magic

Post by blackdot »

nice, thanks for the clarification :)
Fractal Grinder
Posts: 109
Joined: Tue Jun 23, 2015 7:42 pm

Re: Best Video Format for Magic

Post by Fractal Grinder »

I was having some choppiness with HaP still with some of my Fractal renders. I could take a video of this to show what I mean.

Let me explain what is going on,

I render a fractal out of Mandelbulb3D, which makes Image Sequences to render its output out. I complie my image sequences going on advice from a profressional fractal artist, using Adobe After Effects, which lets me complie image sequences directly to HaP, or whatever format I like, which to me is tons better then compiling, and then converting. But when I put some of these in Magic, the playback is choppy at times still..... So last night to test to see if it was the codec, I rendered the same exact image sequence into After Effects and rendered it out as an Lossless AVI instead of the HaP MOV... And to my suprise, the AVI actually played smoother and nicer with some of my effects in the core project I work on....

I'm just curious why this is? If there is something I can do to make HaP play better, if anybody else has had similar experiances? this is REALLY gonna bug me until I get it all figured out, I want the smoothest, most profressional looking visuals I can make, and video playback is very important to me.

I even upgraded my graphics from a 2gb to 4gb hoping that this would help my playback, no dice.

Heres my specs tho:

GPU: Geforce GTX 960

CPU: Intel Corei7 3770

8GB RAM

Windows 10

The last thing I can think of which Eric, you have mentioned, is upgrading my HD to SSD.... But I'm going to take my buddies advice and save up to get a TB or something big, instead of just buying a 240GB for 60 bucks, so thats gonna take me a little while to save up for.... I would really prefer to get some more stable playback with the current set up though, I think it should be do-able.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Best Video Format for Magic

Post by Magic »

It is possible that even a lossless .AVI could have a smaller file size than the same video encoded with Hap. If you have a slower hard drive, the .AVI might play back more smoothly, because it's less data to read.

It's always a variety of factors that determine video playback performance. If the .AVI plays back better on your system, great! :)

For most users, the performance difference between video formats isn't noticeable when just playing one video. But, for example, when playing multiple videos simultaneously, Hap usually emerges as the best (as long as your hard drive can keep up) -- see blackdot's post above for a measurement that demonstrates this.
I want the smoothest, most profressional looking visuals I can make, and video playback is very important to me.
In that case you should definitely upgrade your hard drive, because it seems like the weakest link in your system. All professional-quality video playback machines, like the ones used in entertainment (broadcasting, theater, etc.), have high-performance hard drives.

Keep in mind that you can always add another drive as a secondary drive to your computer. In other words, you don't need to re-install your OS or anything like that. So, if you wanted, you could add a small SSD now, and add another bigger one later. You could get an external USB 3.0 SSD, which would make it very portable.
Fractal Grinder
Posts: 109
Joined: Tue Jun 23, 2015 7:42 pm

Re: Best Video Format for Magic

Post by Fractal Grinder »

Eric wrote:It is possible that even a lossless .AVI could have a smaller file size than the same video encoded with Hap. If you have a slower hard drive, the .AVI might play back more smoothly, because it's less data to read.

For most users, the performance difference between video formats isn't noticeable when just playing one video. But, for example, when playing multiple videos simultaneously, Hap usually emerges as the best (as long as your hard drive can keep up) -- see blackdot's post above for a measurement that demonstrates this.
This made me wonder, because my lossless AVI files were ending up considerably larger than my HaP files, and I only need to have one playing at any given time. So I deceided to run some more tests and try some different things. Instead of encoding them at 30fps, I did them as 60fps(what I try to keep my Magics frame rate at anyway), which for some of my videos is too fast, but the playback was much smoother, and on those ones that I felt where too fast, Magic does a great job with slowing them down.

Problem solved, I think.
Post Reply