Saturday, 3 June 2023

How with OpenAI Whisper do I transcribe all mp4s in a folder?

Problem:

I'd like to transcribe all mp4 files in a folder on both Mac and Windows using Whisper.

I am familiar with scripting and command-line, and have already set up Whisper to work on my machine.


Windows example solution:

The following is an example solution for Windows. Save this in a .bat file and run it in the folder you'd like to process all mp4 files. Modify the script as you need to.

This example transcribes in English with Whisper set up to use CUDA. It skips over any already transcribed mp4 files. It is not recursive.


e.g. transcribe_all_mp4.bat:
for %%f in (*.mp4) do (
	echo %%~nf
	if not exist "%%~nf.txt" (
		echo will process %%~nf.mp4
		whisper "%%~nf.mp4" --language English --device cuda
	) else (
		echo will NOT process %%~nf.mp4
	)
)

Mac example solution:

The following example is a single Terminal command you can use in MacOS with Whisper already set up.

Note that this example command does not check for existing transcriptions. It does however specify Whisper to use the medium model. It is not recursive. Modify the command as you need to.

In Terminal in the folder where you want to transcribe your .mp4 files:

for f in *.mp4 ; do whisper $f --model medium ; done

Notes:

The above solutions in Windows and Mac were verified to work between February 2023 to June 2023 (for real-life conference and film work). As of this time the good folks over at Whisper haven't yet implemented batch processing of files.

Hope these examples helped you start to get past where you too got stuck :)


References:

Thursday, 20 April 2023

Unity WebGL publishing Color Space incompatibility error

Problem:

I'm a beginner in Unity and when completing the first WebGL publishing tutorial in Essentials of real-time 3D, I get the following error:
"In order to build a player, go to 'Player Settings...' to resolve the incompatibility between the Color Space and the current settings."

How do I get past this error in order to continue the tutorial?


Solution:

One solution is as follows. First, go to Player Settings, just as the error hints.
Go to "Player". You'll see another error about color spaces and a hint about what to do about it.
Unselect Auto Graphics API.
Congratulations, you're now ready to continue your Unity beginner's tutorial and build a WebGL game.

Notes:

This how-to is meant for beginners who are starting from scratch, and is intentionally without details. If you'd like to learn more about Unity color spaces, start by having a look in the following documentation link and then read up on the related articles: https://docs.unity3d.com/Manual/LinearLighting.html.

This how-to was verified to work in April 2023 using Unity Editor 2021.3.22f1. Your results may vary.


References:

Thursday, 13 April 2023

Unpublish Unity WebGL Game

Problem:

On Unity Play (play.unity.com) I've published a game as part of a tutorial and now I want to remove it.

Warning:

Following these instructions will remove your game from Unity Play, including all saved stats, challenge submissions, etc. It doesn't look like this can be undone, so continue at your own risk.

One solution:

The following shows one way to delete your game from Unity Play. Please note that this likely cannot be undone. You'll lose all achievements, data, etc., associated with the published game, even if you republish (confirmed as of April 2023).

  1. If not already logged in, login to your Unity account
  2. Navigate to the page displaying all of your games. As of April 2023 this is at https://play.unity.com/discover/mygames
  3. Open the game you'd like to edit or delete/unpublish, then look for the 3 dots "..." indicating a menu
  4. Select "delete" or "edit", depending on if you'd like to delete or edit.
  5. Read the confirmation carefully as there's no turning back. If you agree to deleting your game and losing any data related to it, then go for it.
  6. Congratulations, you've deleted your game!

Notes:

The above instructions were verified to work in April 2023. Your mileage may vary as the Unity team is constantly busy upgrading your favorite game engine and services.

References: