Logo by mauxuam - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. March 28, 2024, 02:14:16 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: what x264 preset should I use for deep zooms...  (Read 3345 times)
0 Members and 1 Guest are viewing this topic.
stardust4ever
Fractal Bachius
*
Posts: 513



« on: October 21, 2014, 11:28:09 AM »

I was thinking about how the x264 vfw plugin has a bunch of different presets. I started doing CQ (constant quantizer) but quickly came to the conclusion that the best single pass render method is crf (constant rate factor).

But additionally, there are some optimization presets:

Quote
    film - optimized for most non-animated video content (not only feature films).
    animation - optimized for animation. Note that most 3D animation behaves more like film and not like hand-drawn animation, so only use this for hand-drawn animation (anime, classic Disney, etc.).
    grain - optimized for film with high levels of grain.
    psnr - uses "peak signal-to-noise ratio" to optimize video quality.
    ssim - uses "structural similarity" to optimize video quality.
https://app.zencoder.com/docs/api/encoding/h264/tuning

Up until now, I've been using "none" "slower" and "crf", high profile. Typically I have found the crf setting to work best around 20-23, sometimes I have to bump it up to 26 or so if the video goes over 2Gb. Thank you, AVI format...
head batting

ssim - uses "structural similarity" to optimize video quality. Fractals are self similar. So I'm wondering what the SSIM preset does and if it would be better for rendering deep zoom fractal animations. I googled H246, SSIM, and fractal. Didn't find very much. 2D fractal vids are such an alien format compared to anything like traditional film or animation, and the complexity can vary dramatically. Typically if youtube chews the video, I'll upload the original to Mega and provide a link. Regardless, fractal zooms are notoriously intensive to encode. I routinely get file sizes for a few minutes @1280x720 (30fps) comparable to a freaking 2-hour long feature length DVD rip @854x480 (23.97fps) using similar encode settings.

Just wondering what x/h 264 encode settings you people use, or other codec if something better exists that's widely supported. Feedback would be appreciated, thanks... wink
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: October 21, 2014, 11:38:34 AM »

hmm, i can not help with the settings, but how about trying out the ssim, for testing purposes you could do a small test video set up and encode it using all of the settings

as far as i know is h264 capable of recognizing zooming/translating/rotating parts of an image, so the ssim sounds very suitable setting for fractal zooms
Logged

---

divide and conquer - iterate and rule - chaos is No random!
stardust4ever
Fractal Bachius
*
Posts: 513



« Reply #2 on: October 21, 2014, 11:57:24 AM »

I'm rendering a Kalles Fraktaler Zoom right now with the new setting. My laptop is about 3x slower than my desktop but it's newer and I think it's got a more recent version of x264 on it. I probably never noticed the SSIM option before because it may not have existed when I installed the plugin on my desktop (2012ish).
« Last Edit: October 21, 2014, 11:59:53 AM by stardust4ever » Logged
youhn
Fractal Molossus
**
Posts: 696


Shapes only exists in our heads.


« Reply #3 on: October 22, 2014, 09:25:40 PM »

I use x264 in the following way from the linux command line:

mencoder -idx -vf scale -zoom -xy 1920 -ovc x264 -x264encopts subq=5:frameref=3:threads=auto:me=hex:partitions=all:bitrate=15000 f*.avi -o output.avi

The source files for mencoder are the uncompressed videos from Kalles, running under Wine in Linux. Frames per movie is set to something around 60 or 180, depending on resolution (setting this too high results in corrupt videos).
Logged
stardust4ever
Fractal Bachius
*
Posts: 513



« Reply #4 on: October 23, 2014, 12:20:37 AM »

I use x264 in the following way from the linux command line:

mencoder -idx -vf scale -zoom -xy 1920 -ovc x264 -x264encopts subq=5:frameref=3:threads=auto:me=hex:partitions=all:bitrate=15000 f*.avi -o output.avi

The source files for mencoder are the uncompressed videos from Kalles, running under Wine in Linux. Frames per movie is set to something around 60 or 180, depending on resolution (setting this too high results in corrupt videos).
Is there a decent codec that uses lossless compression? If the codec compressed the info to 4.2.0 color space (because all modern codecs use 4.2.0 by default) and used a lossless algorithm to compress the data, the file size would be significantly less.

Huffyuv would be ideal for rejoining files, but since it's not actively supported as of years ago, there might be issues using it. I found a forum post where someone couldn't get it to work with Windows 7. I might a lossless codec someday to join in AVIdemux if I should ever decide to make a 720p 60Hz BluRay movie out of my fractal zooms (BluRay limits 1080p to 24fps or 1080i @29.97fps - 720p @60fps would look butter smooth in comparison). I'd need to get a BD burner first though.

I don't trust piecewise joining of H264 video files using AVIdemux or VurtualDub because for inexplicable reasons the H264 occasionally trims a few frames off the end of the video, possibly due to the way it generates B frames or something. If I join them, it will leave gaps. It doesn't matter for Kalles Fraktaler because it leaves a few seconds of black at the end of the video. Fractal Extreme, I just make sure there's at least two black frames at the end of the zoom movie. Now that Kalles Fraktaler has imported most of my fractal formulas, I really don't have a need for FX anymore...

Honestly, since Kalles Fraktaler generates uncompressed frame data which already takes up several Gb of space per zoom movie, I can tweak the color palette and rerender the AVI as many times as I want.
« Last Edit: October 23, 2014, 12:22:51 AM by stardust4ever » Logged
youhn
Fractal Molossus
**
Posts: 696


Shapes only exists in our heads.


« Reply #5 on: October 23, 2014, 01:09:43 PM »

Gaps indeed. The last celtic zoom video I created was suppose to be good quality, so I used 3840 pixels to render the movie. This combined with uncompressed videos was asking to much diskspace. So the joining of the x264 videos turned out to be a bad way. And I expect the clearing of diskspace while Kalles was still rendering the video, did not really work well either. I think I need to repartition the disk or buy a new one for decent quality/decent length videos.

I usually try to tune the colors on a few julia structures while zooming my way down to the mini. I just copy-paste the settings to the Key Frame Movie maker.

I never tried it, but there is a lossless scheme in x264:

Code:
Example usage:

      Constant quality mode:
            x264 --crf 24 -o <output> <input>

      Two-pass with a bitrate of 1000kbps:
            x264 --pass 1 --bitrate 1000 -o <output> <input>
            x264 --pass 2 --bitrate 1000 -o <output> <input>

      Lossless:
            x264 --qp 0 -o <output> <input>

      Maximum PSNR at the cost of speed and visual quality:
            x264 --preset placebo --tune psnr -o <output> <input>

      Constant bitrate at 1000kbps with a 2 second-buffer:
            x264 --vbv-bufsize 2000 --bitrate 1000 -o <output> <input>

http://trac.ffmpeg.org/wiki/Encode/H.264
Logged
stardust4ever
Fractal Bachius
*
Posts: 513



« Reply #6 on: October 23, 2014, 02:58:10 PM »

Gaps indeed. The last celtic zoom video I created was suppose to be good quality, so I used 3840 pixels to render the movie. This combined with uncompressed videos was asking to much diskspace. So the joining of the x264 videos turned out to be a bad way. And I expect the clearing of diskspace while Kalles was still rendering the video, did not really work well either. I think I need to repartition the disk or buy a new one for decent quality/decent length videos.

I usually try to tune the colors on a few julia structures while zooming my way down to the mini. I just copy-paste the settings to the Key Frame Movie maker.

I never tried it, but there is a lossless scheme in x264:

Code:
Example usage:

      Constant quality mode:
            x264 --crf 24 -o <output> <input>

      Two-pass with a bitrate of 1000kbps:
            x264 --pass 1 --bitrate 1000 -o <output> <input>
            x264 --pass 2 --bitrate 1000 -o <output> <input>

      Lossless:
            x264 --qp 0 -o <output> <input>

      Maximum PSNR at the cost of speed and visual quality:
            x264 --preset placebo --tune psnr -o <output> <input>

      Constant bitrate at 1000kbps with a 2 second-buffer:
            x264 --vbv-bufsize 2000 --bitrate 1000 -o <output> <input>

http://trac.ffmpeg.org/wiki/Encode/H.264
You could try zero frame latency option. I haven't used it and it will reduce codec efficiency but it essentially prevents the need to look ahead for reference frames. One theory is the encoder may be trying to set up reference frames beyond the end of the video. I'm thinking when the render stops, so does the encoder and whatever unfinished frames it has.

I've had issues with the X264 vfw codec cutting off a few frames at the end and I believe I watched your Celtic video a while back. There was a jump shortly before the middle between some dense area and skipped to some sparcer material. And another skip shortly before the end. Fractal Extreme has also cut off endings when the final frame was all black. Kalles Fraktaler gives you extra frames at the end though.

Another thing to keep in mind, you've got the source frames and can always keep those. You don't have to use uncompressed video. Assuming that we can get X264 to work without deleting frames, encode to extraordinary quality settings like Constant Quantizer in the single digits or even "1", then piece together with Vdub or AVIdemux and reencode. Yes you lose quality with each conversion but if you encode at a far higher quality than the target, the loss will be imperceptible. Such schemes can backfire though. Jpeg 100% is not lossless and often results in larger filesize compared to lossless PNG.

I just want a good codec with 4.2.0 colorspace and a good lossless or near lossless compression rate. I don't have the space to store uncompressed video. I've got a few 100s or so of Gigabytes left but it won't last long that way. Kalles Fraktaler folders are huge enough. Since the frames are uncompressed I may try zipping the directories to z7 format when I'm done with them. 7z is far more efficient than zip.
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #7 on: October 24, 2014, 07:57:56 PM »

h264/x264 does not throw away/delete/lose frames.  it's either kalles that's off or it's possibly a symptom of putting h264 in an avi container, which is not just infrequently done, but entirely incorrect.

http://forum.doom9.org/archive/index.php/t-143613.html

for an example discussion on why h264 in avi is incorrect.  the first response is by dark shikari, one of the main devs of x264.  and yeah, x264 with qp 0 or crf 0 will encode losslessly, and is of course the best option for lossless encoding.  smiley

that mencoder line for encoding with x264 is kinda eww  grin  i personally prefer to use a fifo and use x264 directly, e.g.

mkfifo foo.y4m
nice -n +19 mpv mf://animationdir/*.png -o foo.y4m --no-sub --no-audio --oautofps --oneverdrop
nice -n +19 x264 --opencl --videoformat ntsc --no-fast-pskip --no-dct-decimate --sar 1:1 --fps 30 --crf 16 -b 8 --b-adapt 2 -r 8 --rc-lookahead 80 --aq-mode 1 --aq-strength 0.5 --psy-rd 1.0:0.2 --deadzone-inter 6 --deadzone-intra 6 --deblock -2:-2 --ipratio 1.1 --pbratio 1.1 --qcomp 0.8 -A all --direct auto --me tesa --merange 24 -m 11 -t 2 -o foo.h264 foo.y4m
mkvmerge -o foo.mkv --default-duration 0:30fps foo.h264 foo.ogg

with mpv (or mplayer or whatever) and x264 running in different terms.  just an example command line, with mpv playing back the frames to an animation sequence in animationdir/ to the fifo, with x264 settings tuned for grain, and with an example mkvmerge line muxing foo.h264 with a foo.ogg audio track.  mpv --no-sub --no-audio not necessary for playing back stills of course, just my copy+paste line for dumping video from anything that might contain audio or subs.

also worth noting that x264 supports up to 4:4:4 if you are looking to losslessly store a video made from stills.
« Last Edit: October 24, 2014, 08:41:10 PM by quaz0r » Logged
youhn
Fractal Molossus
**
Posts: 696


Shapes only exists in our heads.


« Reply #8 on: October 24, 2014, 08:26:46 PM »

If you are talking about the jumps in my celtic video, it was probably the way Kalles Fraktaler works under Wine on Linux, while running out of disk space and going into a temporarily freeze mode. Until the diskspace was cleared, and it automatically continued. I had a few of these moments, while the total movie was created out of about 100 small videos.

For my latest video (not uploaded yet) I converted all the uncompressed avi videos to lossless x264, which are indeed much smaller by a (varying) factor of about 10. This way I can clear diskspace by deleting the original avi videos during the rendering process, while keeping the quality. After rendering is done, I encode all the lossless 90-frame mkv videos to 1 big x264/avi video (this is easier with mencoder/mplayer. Still have to figure out how to create mkv container). This latest video had no jumps, missing or extra frames. If I don't forget, I'll upload the result to youtube this night.
Logged
stardust4ever
Fractal Bachius
*
Posts: 513



« Reply #9 on: October 25, 2014, 12:36:42 AM »

h264/x264 does not throw away/delete/lose frames.  it's either kalles that's off or it's possibly a symptom of putting h264 in an avi container, which is not just infrequently done, but entirely incorrect.

http://forum.doom9.org/archive/index.php/t-143613.html

[...]

also worth noting that x264 supports up to 4:4:4 if you are looking to losslessly store a video made from stills.
The doom link wasn't much help honestly. Just a bunch of fanboys ranting about some sites offering (possibly illegal) downloads using the AVI format. 0 CQ Sounds like a good option for lossless video. I will be using 4.2.0 to compress it though. I'll try the "zero latency" option and see if that clears up the dropped frames at the end of segment issue. I can open the file in AVIdemux and know instantly whether or not there are lost frames at the end, by viewing the frame count. I've used AVIdemux in the past to add in audio tracks although popular music is off limits due to copyright, plus one person's favorite track may make another person click for the mute button or worse the red [X] in the upper right.

As far as AVI file format goes, I'm stuck with it for now until Fractal Extreme and Kalles Fraktaler decide to add in mp4 support. I'm currently rendering one of my most ambitious projects yet, not in terms of depth but in terms of video quality. I'm rendering the frames at 4k (3840x2160) plan on encoding to 1920x1080p with variable zoom speed and color cycling and also doing some audio dubs. The title will be "Simply Awesome Revisited" and it will be a reworking of my first Mandelbrot video from Fractal Extreme 2.0, rendered in 2009 on a 32-bit laptop. I am fairly certain that 2Gb will not be enough to render quality video at 1080p, especially since I plan on doing a high quality downloadable version from MEGA at 60fps.
Logged
stardust4ever
Fractal Bachius
*
Posts: 513



« Reply #10 on: October 25, 2014, 12:40:30 AM »

If you are talking about the jumps in my celtic video, it was probably the way Kalles Fraktaler works under Wine on Linux, while running out of disk space and going into a temporarily freeze mode. Until the diskspace was cleared, and it automatically continued. I had a few of these moments, while the total movie was created out of about 100 small videos.

For my latest video (not uploaded yet) I converted all the uncompressed avi videos to lossless x264, which are indeed much smaller by a (varying) factor of about 10. This way I can clear diskspace by deleting the original avi videos during the rendering process, while keeping the quality. After rendering is done, I encode all the lossless 90-frame mkv videos to 1 big x264/avi video (this is easier with mencoder/mplayer. Still have to figure out how to create mkv container). This latest video had no jumps, missing or extra frames. If I don't forget, I'll upload the result to youtube this night.
That sounds awesome. I've got a 1.5TB hard drive in my PC with a lot of junk on it already so I don't have room to store multiple 100s of GB of uncompressed video, even temporarily.

As for software, AVIdemux and VirtualDub are both excellent for joining AVIs without reencoding. I prefer AVIdemux because I loathe anything involving command line interface. Creating batch files for common settings is a PITA. Handbrake is probably the best free software for high quality H264 MP4 encoding, although it's primarily used for ripping movies. It's not an editor though so you still need something else to join the files and add audio tracks.
« Last Edit: October 25, 2014, 12:45:37 AM by stardust4ever » Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Mandelbrot Set very deep Zooms Movies Showcase (Rate My Movie) fractalwizz 6 3985 Last post July 06, 2008, 08:01:12 PM
by HPDZ
Deep zooms Help & Support « 1 2 3 » Dinkydau 39 4806 Last post August 30, 2010, 05:02:58 AM
by Dinkydau
Auto Preset Randomiser, random preset combiner 3D Fractal Generation ant123 0 1911 Last post February 05, 2012, 09:36:06 PM
by ant123
Two deep Mandelbrot zooms Movies Showcase (Rate My Movie) Kalles Fraktaler 6 1839 Last post October 11, 2013, 09:59:08 AM
by Nahee_Enterprises
Memory aid for deep zooms Kalles Fraktaler jwm-art 1 1406 Last post February 28, 2017, 07:49:33 AM
by youhn

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.83 seconds with 25 queries. (Pretty URLs adds 0.085s, 2q)