POV-Ray : Newsgroups : povray.binaries.animations : animation test-- compression encoding schemes : animation test-- compression encoding schemes Server Time
20 Apr 2024 08:32:23 EDT (-0400)
  animation test-- compression encoding schemes  
From: Kenneth
Date: 19 Feb 2022 18:40:00
Message: <web.62117b30985662d24cef624e6e066e29@news.povray.org>
[Running v3.8.0 beta 1 in Windows 10]
This is my first uploaded animation from my Windows 10 computer that I purchased
in early 2021.

Scattering media plus two light_sources, using two warp{turbulences...} -- one
moves in y, the other is static.

This is really more of a test of my animation encoding scheme, to see if the
file plays back for everyone. (Of course, in the newsgroups' web-portal, there
is always an extra suffix appended to the end of an animation file name, which
causes problems for playback in certain apps).

I am certainly no expert on the subject of video compression, but I keep trying
to learn. There are so *many* so-called 'standards' that have accumulated over
the years.  It was all much simple in the days of AVI video-making!

I used an old but still-available app called 'VirtualDub2 MOD' to assemble this
animation from .png renders. On my system, the resulting animation plays in all
of the video apps I have: Windows Media Player, Irfanview, avidemux (another
*old* one), VirtualDub2 MOD, and VLC Media Player.

VirtualDub2 MOD has lots of compression/encoding choices-- many of which I don't
understand, so I leave them at their defaults. But I've been experimenting with
the simpler choices. This is how I encoded the file; the stats as seen in the
app itself are copied verbatim:

COMPRESSION:
x264 8 bit - H.264/MPEG-4 AVC codec
YUV 4:2:0
MPEG 'profile' and 'Level' on 'Auto'
pixel format: 4:2:0 planar YCbCr (YV12)
YCbCr properties:  color space: Rec 709 HD
component range: Limited (Y: 16 - 235)
Source: RGBA32
Actual output: YUV420-709

CONTAINER FORMAT:
MP4 (MPEG-4 Part 14) (*.mp4)

Yeah, a lot of this stuff looks like technical gibberish and is not easily
understood. But some research on Wikipedia about 'Rec 709' as well as 'chroma
subsampling' was quite useful-- regarding the 4:2:0 and YCbCr stuff in
particular.

4:2:0 is one of the standards used for chroma subsampling for compression; but
there are others, like 4:2:2. According to what I have read, that one should
also work with the Rec 709 standard (and at a higher quality)-- but such a test
animation does not play in Windows Media Player; I get
a black screen. And it *crashes* Irfanview, so badly that the app is broken for
my entire work session-- I have to reboot Windows to bring it back to working
status. Yet, other apps I have like VLC Media Player play it back OK. I have no
idea why, so far.

The most interesting statistic IMO is the 'component range' of Y: 16 - 235.
Y itself is the luminance of the colors -- think grayscale brightness levels.
(Actually it's not luminance but 'luma', which AFAIK is the gamma-corrected
version of luminance.)  It would *seem* that a 'full' range of 0-255 brightness
levels would the ideal choice-- and VirtualDub does allow that choice as 'Rec
709 HD FR' ("full range").  But in my encoding tests, the 'limited' 16-235 range
actually reproduces the POV-ray renders far more accurately.  0 - 255 produces
higher contrast and does not match the original render. That seems strange, but
I guess it involves some deeper technical stuff.

I'm still learning  ;-)


Post a reply to this message


Attachments:
Download 'media_smoke_2_18_22__4_2_0_rec709_16_to_235.mp4.dat' (2293 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.