Wednesday, January 8, 2025

Sons of God, Table of Nations, Michael Heiser

 I've recently discovered Michael Heiser videos on YT. His approach to biblical history and theology was fascinating. He certainly tends towards the types of explanations I've long found convincing regarding Genesis 1-4, for example. But despite how much I've watched there's a hole that seems to exist in his teachings on the Tower of Babel and what he refers to as God's divorce from the nations.

"When the Most High gave the nations their inheritance, when he divided all mankind, he set up boundaries for the peoples according to the number of the sons of Israel."(Deuteronomy 32:8)

    He uses Deuteronomy 32:8 and fact that what is written as "sons of Israel" should be "sons of God" to show that its referring to spiritual beings, not people. He gives a strong argument on the wording itself. He also makes it clear that this references the tower of Babel incident. I can only agree with that. But I've yet to see him go back and fully compare the text in Genesis 10/11 to fully defend his point. Reading that text(at least the English), the only point where there is room for spiritual beings to be present is when God says "let us go down" in the plural. Yet there is no mention of dividing the nations by that plurality. What does exist is a full description of the descendants of Noah and the nations that arose from them. The assertion being that the sons began their own tribes, which became their own nations with their own tongues after the Tower of Babel incident.

    Watching another video from Heiser on the Trinity in the Old Testament, he mentioned something that brought me back to Babel. While explaining the use of the term Elohim to sometimes mean God, and sometimes mean things other than God, he talks about the term "sons of God" or "son of God" in the Old Testament. It has at times referred to spiritual beings, Israel, and kings. It's this latter that makes me question Heiser's take on Deuteronomy 32:8. Elsewhere, Heiser makes much hay over the use of the King and Prince motif, and uses this to argue that Deuteronomy 32:8 is in fact describing Principalities given to spiritual beings. But it looks like it could more directly describe the fact the descendants of Noah became kings over their people: i.e, using the same kings-as-"son of God" references found elsewhere in the OT to refer to the leaders of the tribes that became the scattered nations. "Sons of God" would indeed be the right wording for Deuteronomy 32:8, but in reference to earthly kings.

    If this is true, then his take on God's divorce from the nations reads a bit odd, though not necessarily wrong. The fact that God would refer to their leaders as "sons of God" at the same time he's saying, "go away, I'm gonna create a new People for myself through Abram and Sarai", sounds like God wants it both ways. It may be that this was a reference to the fact that while these nations are no longer following God, he's not using the term to mark them as his loyal servants but rather he's explicitly putting his stamp on his act of their creation. They didn't flee from God and call themselves kings, he called them kings and sent them off.

    Psalm 82's influence on reading both Genesis 10/11 and Deuteronomy 32:8 is unclear, but I do get where Heiser is coming from(at least from English): 

"I said, 'You are gods, sons of the Most High, all of you; nevertheless, like men you shall die, and fall like any prince.' Arise, O God, judge the earth; for you shall inherit all the nations!"(Psalm 82:6-9)

You don't describe earthly kings dying like earthly kings as if it were news. Nor can I recall any OT king thinking he will literally live forever on earth. Every one of them expected to die like their fathers before them. The rest of Psalm 82, lacking knowledge of another possible context, certainly parallels the wording used in Deuteronomy 32:8, "When the Most High gave the nations their inheritance [...] But the Lord's portion is his people, Jacob his allotted heritage." Taken together it definitely looks as though God is taking back the nations from failed leaders. Even if he describes earthly leaders as "sons of God" elsewhere, what are learning from  the idea that they will die and fall like earthly leaders? Earlier in Psalm 82: "God has taken his place in the divine council; in the midst of the gods he holds judgment:" He seems to be addressing *these* gods, of course. But that tells us nothing. Are they earthly gods, or spiritual beings. And is this divine council the gods being judged? That's what Heiser seems to say. I think this is odd wording for such a case. God takes his place in the divine council, and judges the divine council? Or are the gods assembled before the divine council for judgement, then God walks in: "All Rise for the Honorable Judge Yahweh..."? I think Heiser gives references to the Divine council elsewhere, though those references escape me at the moment. I will have to continue this later. 

To this point though, Genesis lacks the explicit language of Deuteronomy 32:8 regarding dividing the nations by "sons of God", but *does* explicitly create the nations through the descendants of Noah. Deuteronomy uses "sons of God", but without enough context to say whether these refer to earthly kings or spiritual beings. Psalms 82 ups the ante by leaning towards non-earthly-kings being treated as earthly kings, along with God reclaiming the nations from those kings. So Psalms informs on Deuteronomy which informs on Genesis. 

Also, I do struggle with the proper way to read Psalm 82 and similar accounts. Is it a factual account of a vision or simply a poetic imagining? Elsewhere in the OT  we're given direct narration that "and <x> had a vision of...", and explicitly told the divine nature of the vision. Here, we have some vision of what occurred, then some commentary on it. We may take the vision as we would any other explicit revelation, but do we also accept Asaph's commentary and plea regarding that vision as divine messaging as well, or historical poetry? 

    The Bible is half historic and half divine. People talk and do as people talked and did. Intermixed are the divine truths. There's definitely a difference between what a character in the bible says, what the narrator says, and the direct words from God. If the narrator says, "and this happened", it happened: the word is inspired. If the narrator says, "<x>  said 'this happened', <x> definitely said "this happened", but did it happen? Context matters. Sometimes that context reveals a lie, sometimes it backs the assertion. Here, we're given a vision from a character, not backed by explicit narration, then we're given the character's assertion on the vision, not backed by context. No-one would claim there's a lie here, but is this a story of revealed truth or hopeful, poetic imaginings of justice with a more symbolic purpose? Being that the whole of the Bible is inspired, we know it has purpose. But as Heiser points out, the bible must be read from within the frame of reference for whom and when it was written. Is there any more context to apply here than, "it is inspired text, so presented without context it must be literal and that means there is a divine council that is judging non-human gods that failed?"

    Reading this again, it seems it could be read as Asaph himself mocking them as "you are gods. Sons of the Most High [...] nevertheless, like men you shall die..." May Asaph be having fun with the language used in Deuteronomy? He knows they're men, but he's mocking the fact they've forgot it themselves. After all, how many kings have imagined themselves actual deities?

Monday, January 6, 2025

AV1 Adventures

I've been trying to use AV1 for recompressing home videos and blurays, to keep them available on the network. My Home Videos are taken with a Moto G7 Potato, which requires a 4k 40MB HEVC source to look decent at all. After a light denoise filter, they look ok enough. My goal is to save these as ~3MB 1080p and ~1.5MB 480p for live use and archive the originals offline.  This is my first attempt at understanding AV1 quality. I had hoped to just jump in with suggested settings and get good results, but this was not the case.

Considering everything I've read, these were the assumptions I started out with:

  1. Most use-cases need an RF between 25-35. Start at 35 and work from there.
  2. Lower Resolutions need lower RF(higher quality settings), as there's less source data to work with to keep a good picture.
  3. AV1 is a slower codec overall, but at the same speed as x264/x265 it will still give better results. AV1 will improve even more against x264/x265 if you encode with slower settings. Ergo, lacking another concern, AV1 should be used.
  4. Constant Quality(RF) settings give better results than average bitrate, but source material will drastically impact final bitrate.
  5. Mixed Messaging on 10bit. Some say use it in all cases; it has little overhead but helps reduce banding due to less rounding. Others say it's a waste on 8 bit source.

To this point, here are my experiences with those assumptions

1. Most use-cases need an RF between 25-35

    This remains to be seen. The Blu-ray source I'm using certainly does not bear this out. Using SVT-AVC Preset 5 RF25 only got to 1.5mbps, and had terrible issues with dark sections/shadows. This included flat blocks/banding across dark zones, and dancing blockiness in shadowed areas. Yet this used the highest quality in the normal range? I eventually used RF21 to get decent(but not really great), quality near 3mbps. A 720p encode at RF21 Preset 4 handled the dark sections better than the 1080p version, using almost half the bitrate(1.7mbps).

    I then tried starting with a far better source, a never compressed 10 second 1080p yuv 4:4:4 clip, encoded with 1080p RF21 Preset 5. It resulted in 60mbps video...wth. This does verify another assumption though: Constant Quality(RF) settings give better results than average bitrate, but source material will drastically impact final bitrate. Unfortunately, this seems like AV1 will be a rather finicky codec to use. In the past, using crf settings on x264, most would be around the same bitrate but some content would use as much as twice as expected. Going from 1.5mb to 60mb is a whole other story. I could use the maximum bitrate option, but that would end up with the highest quality sources always maxing out their bitrate(when in fact they should need the least, as they don't have prior artifacts to reencode against). It seems there's just no good encoding options that can be used  blindly against a set of videos.

2. Lower Resolutions need lower RF(higher quality settings)
 
    480p definitely needs lower RF than 720p and 1080p. I ended up using RF9 to get ~1.7mbps out of 480p, yet it still isn't as good as x264 abr at 1.7mbps on the dark areas(the rest of the frame beats x264 though). 
    720p needed RF21 to hit 1.7mb using 10bit with Preset 4. This looked better than the 480p 8 bit RF9 at ~1.7mb, and fully beat x264. It seems without preset 4, AV1 cannot handle dark zones as well as x264. This is a problem on 1080p as the encoding time for preset 4 is way too much on my antiquated system.
    1080p needed RF21 to hit 3.2mbps, using 10 bit with Preset 5. This video looked worse than the 720p version which used Preset 4 but half the bitrate. Once again, the brighter sections of the frame killed x264, but many dark sections contained distracting artifacts. It's sad that the RF setting does not result in any consistent output across other settings. It is apparently required for good results yet offers zero predictive power of actual results across inputs or other settings. Presenting this as a "Constant Quality" mode, we might understand that quality will differ with inputs and resolutions, while expecting the same quality output at differing sizes when changing only encoding speed through presets. Instead we get differing sizes *and* quality. 
    Clearly, this means any encode must be a cycle of encode, change settings, encode, change settings...until you find the quality/size tradeoff you're looking for. I don't yet understand why using bitrate alone for this can't do the same. Complexity does indeed spike for some scenes, requiring higher bitrates; a constant quality metric would handle that while an average bitrate over a short span may not. But isn't that just a matter of tuning the min/max bitrate range wider and doing better analysis with a first pass? Or perhaps selectively turning on slower encoder features during complex scenes?

    
3. AV1 is a slower codec overall, 
but at the same speed as x264/x265 it
 will still give better results. 
    This may in fact be the case if we don't include the dark scene problems. I have yet to have dark scenes and shadows exceed x264 without Preset 4 and RF mode, while using x264 in an abr mode with a similar encode time. This is also comparing 10bit AV1 vs 8 bit x264. These dark regions are such a nuisance that it ruins what really is a far crisper video overall. It might just be that AV1 without P4 or better is just not worth it; yet that is the opposite of every source I've read.

4. Constant Quality(RF) settings give
 better results than average bitrate...
     This has been the story of the day, so I won't belabor it here. It is true, but it is weird that it's true.

5. Mixed Messaging on 10bit. 
    I've seen cases where 10 bit did not help with banding or blockiness at all. I've seen cases where it definitely seemed to help, but resulted in a somewhat low detailed smooth region. It was less jarring than the banding, but not good. There is a limit to what can be done at low bitrates though, so tradeoffs must occur. So far the penalty for 10bit seems around 10% encoder speed, and insignificant on the output size. I do believe I'll use 10 bit for everything.