Random thoughts, trials & tribulations: rendering speed
Posted: Thu Oct 24, 2013 5:38 am
This initially started as a question about how the benchmark stats are calculated..
But I expanded on it just by sharing my own experiences and there may be a question or two scattered amongst the wall of text this post turned into...
I'm not necessarily complaining or anything, as I'm just kind of curious.
But I have noticed somewhat larger than expected differences in benchmark vs real world results. I'm not expecting the same numbers, as real-world usage is never so easy to quantify, but still.
Running the optimizer gives me benchmarks of around 22 FPS with GPU + 4 cores @ 1920x1080 (radius 1 or disabled, I don't recall atm)
Although in the real world I've always maxed out at around 10fps. I've done what tweaking I could to try and improve it, but nothing seems to work towards improving speed.
Based on some quick math I average around 6 - 7 fps piping straight through to x264 (fed by Avisynth) with real-time filtering in the chain. Which is not at all that bad (when working on Anime at least, and compared to CPU heavy AVS scripts that crawl at fractions of a frame per second).
I have noticed some (in appearance) differences by using different source filters, (DirectShow vs FFmpeg Input drivers for Virtualdub), possibly even with x64 being slightly slower (but that is somewhat anecdotal).
I think for whatever reason, I saw the best performance when using the DirectShow input plugin for Virtualdub (x32 at the time) and saving out to a lossless UT Codec intermediate to be encoded later. I think I may have tested it fed directly to x264 but I can't remember.. But under Dshow I think I saw performance as high as 12 - 13 fps.
But I got paranoid about colorspace conversions (Dshow input flags as the colorspace as of BluRay source files RGB888, incidentally so does opening a yuv420 ULH0 AVI directly - no idea why) and seeking is possible but may or may not be frame accurate ( which also makes me paranoid). FFinput is supposed to be better with frame accuracy, but seeking is a nightmare (you can go forward but if you jump it will lock-up Vdub). But it DOES correctly import YV12 AVC streams...
So I made a trade off of rendering to lossless and then encoding. But given the amount of time it takes for both steps (minus profiling) I did a test and even at a lower sustained FPS, its easier to just load NV with an Avisynth script, with the appropriate profiles and encode directly with x264..
So interestingly enough, you can't always assume that rendering to a lossless file, will get you the fastest encoding times even though you would think freeing up more of the CPU would help with the end-of-chain encoder!
So now I have a brand new work flow it would seem!
Using Virtualdub x64 with ffinput driver, I open up the transport streams previously saved to my HDD. ->
Then I render them out to an AVI with UT Codec yuv420/bt.709 - which become insignificant for the time spent because I do it in batches. It's super fast at around 60 - 70 fps anyway so a whole season (12 - 15 episodes) only takes less than 2 hours. ->
Open those files and build profiles for them with Neatvideo, since Vdub can freely seek without issues (primary reason for the intermediate at this step) ->
Create & Queue up an Avisynth script in MeGUI, modify them to add stuff and send it off to the encoding queue to feed the intermediate AVI through Avisynth -> Neatvideo -> x264. Wait a little while & Prosper with nice clean video.
But I expanded on it just by sharing my own experiences and there may be a question or two scattered amongst the wall of text this post turned into...
I'm not necessarily complaining or anything, as I'm just kind of curious.
But I have noticed somewhat larger than expected differences in benchmark vs real world results. I'm not expecting the same numbers, as real-world usage is never so easy to quantify, but still.
Running the optimizer gives me benchmarks of around 22 FPS with GPU + 4 cores @ 1920x1080 (radius 1 or disabled, I don't recall atm)
Although in the real world I've always maxed out at around 10fps. I've done what tweaking I could to try and improve it, but nothing seems to work towards improving speed.
Based on some quick math I average around 6 - 7 fps piping straight through to x264 (fed by Avisynth) with real-time filtering in the chain. Which is not at all that bad (when working on Anime at least, and compared to CPU heavy AVS scripts that crawl at fractions of a frame per second).
I have noticed some (in appearance) differences by using different source filters, (DirectShow vs FFmpeg Input drivers for Virtualdub), possibly even with x64 being slightly slower (but that is somewhat anecdotal).
I think for whatever reason, I saw the best performance when using the DirectShow input plugin for Virtualdub (x32 at the time) and saving out to a lossless UT Codec intermediate to be encoded later. I think I may have tested it fed directly to x264 but I can't remember.. But under Dshow I think I saw performance as high as 12 - 13 fps.
But I got paranoid about colorspace conversions (Dshow input flags as the colorspace as of BluRay source files RGB888, incidentally so does opening a yuv420 ULH0 AVI directly - no idea why) and seeking is possible but may or may not be frame accurate ( which also makes me paranoid). FFinput is supposed to be better with frame accuracy, but seeking is a nightmare (you can go forward but if you jump it will lock-up Vdub). But it DOES correctly import YV12 AVC streams...
So I made a trade off of rendering to lossless and then encoding. But given the amount of time it takes for both steps (minus profiling) I did a test and even at a lower sustained FPS, its easier to just load NV with an Avisynth script, with the appropriate profiles and encode directly with x264..
So interestingly enough, you can't always assume that rendering to a lossless file, will get you the fastest encoding times even though you would think freeing up more of the CPU would help with the end-of-chain encoder!
So now I have a brand new work flow it would seem!
Using Virtualdub x64 with ffinput driver, I open up the transport streams previously saved to my HDD. ->
Then I render them out to an AVI with UT Codec yuv420/bt.709 - which become insignificant for the time spent because I do it in batches. It's super fast at around 60 - 70 fps anyway so a whole season (12 - 15 episodes) only takes less than 2 hours. ->
Open those files and build profiles for them with Neatvideo, since Vdub can freely seek without issues (primary reason for the intermediate at this step) ->
Create & Queue up an Avisynth script in MeGUI, modify them to add stuff and send it off to the encoding queue to feed the intermediate AVI through Avisynth -> Neatvideo -> x264. Wait a little while & Prosper with nice clean video.