(Half of it was actually solved a week ago and I didn't realize it 'cause my local data is old. Differences between mawk (default on trusty) and gawk (default on xenial) led to some trailing characters. The rest I finished Friday, and I plugged everything together today ^^)
Second breakthrough! Yay! If I can get video playback working, I'll be a happy kitty.