Showing posts with label video. Show all posts
Showing posts with label video. Show all posts

Wednesday, May 15, 2024

An interview

Every so often I get asked to do a video interview. I almost always turn down these requests. Recently, I gave in and agreed to do one, because I highly valued the work of the organization that asked me.

It was a terrible experience that has restored my judgment to avoid such things. After initially stumbling (not a big deal), I started talking at length and pretty fluently. But what I was saying was stuff that I hadn’t thought out. It sounded pretty good to me, but it just wasn’t backed up with arguments. Instead of a pattern where first I think and refine what I am about to say, and then I speak, I just spoke, and spoke in a manner that suggested more knowledge than I consciously had. Ugh!

For all I know, all that I said was true, and could be backed up by arguments. But maybe it wasn’t.

Wednesday, July 19, 2023

Video splitter python script

I'm working on submitting my climbing record to Guinness. They require video--including slow motion video!--but they have a 1gb limit on uploads, and recommend splitting videos into 1gb portions with five second overlap. I made a little python script to do this using ffmpeg. You can specify the maximum size (default: 999999999 bytes) and the aimed-at overlap (default: 6 seconds, to be on the safe side for Guinness), and it will estimate how many parts you need, and split the file into approximately these many. If any of the resulting parts is too big, it will try again with more parts.

Wednesday, December 14, 2022

Web-based tool for adding timed text and a timer to a video

When making my Guinness application record video, I wanted to include a time display in the video and Guinness also required a running count display. I ended up writing a Python script using OpenCV2 to generate a video of the time and lap count, and overlaid it with the main video in Adobe Premiere Rush.

Since then, I wrote a web-based tool for generating a WebP animation of a timer and text synchronized to a set of times. The timer can be in seconds or tenths of a second, and you can specify a list of text messages and the times to display them (or to hide them). You can then overlay it on a video in Premiere Rush or Pro. There is alpha support, so you can have a transparent or translucent background if you like, and a bunch of fonts to choose from (including the geeky-looking Hershey font that I used in my Python script.)

The code uses webpxmux.js, though it was a little bit tricky because in-browser Javascript may not have enough memory to store all the uncompressed images that webpxmux.js needs to generate an animation. So instead I encode each frame to WebP using webpxmux.js, extract the compressed ALPH and VP8 chunks from the WebP file, and store only the compressed chunks, writing them all at the end. (It would be even better from the memory point of view to write the chunks one by one rather than storing them in memory, but a WebP file has a filesize in its header, and that’s not known until all the compressed chunks have been generated. One could get around this limitation by generating the video twice, but that would be twice as slow.)

Saturday, April 17, 2021

Regular Hyperreal and Qualitative Probabilities Invariant Under Symmetries

I just noticed that my talk "Regular Hyperreal and Qualitative Probabilities Invariant Under Symmetries" is up on YouTube. And the paper that this is based on (preprint here) has  just been accepted by Synthese.



Sunday, August 12, 2018

Fix aspect ratio of online videos

My wife and I were watching Mr. Palfrey of Westminster on Acorn, and the aspect ratio on s2e1 was 11% off. It was really annoying me (especially before I realized it was just that one episode that was bad). So I wrote a little bookmarklet to adjust the aspect ratio of all html5 videos in a web page.

Here it is: Stretch Video.

To use it, drag it from the above link to your browser’s bookmark bar (which you can show and hide in Chrome with shift-ctrl-b). Then when you have the video on your screen, click on the bookmark and enter the horizontal and vertical stretch ratios, or the correct aspect ratio.

For full-screen video, try first resizing and then switching to full-screen (on some websites, like YouTube, there will be a one second delay before the video stretches on full-screen toggle). (On Firefox, you can also pull up bookmarks in full-screen mode with shift-ctrl-b, which helps.)

To cancel the effect, just reload your video page.

And for fun, here is a Video Rate bookmarklet (we wouldn't want to treat space very differently from time, would we?).

Public domain source code is here.