Category All posts

Add text to a video with FFmpeg

If you want to add text to multiple video files in a bulk operation, FFmpeg is the way to go. You don’t want to manually edit a bunch of videos just to add the same stuff each time. Automation for the win! In this FFmpeg example, we will add some text to this video clip. As you can see, no text yet. We want to add “hard coded” text (that cannot be removed after it is added). We are not talking subtitles/captions. Here is the command, but hold on for a sec… The following command has been made simpler to read by breaking the long command into multiple lines. If you use this command you should remove all ^-symbols, so that everything is displayed in one line. Also don’t miss the spaces in there. This command is made for a Windows environment so it might look a little different if you are on another OS. You can also make the text with a little better position and padding like this: This is the result: Sources: https://superuser.com/questions/939357/ffmpeg-watermark-on-bottom-right-corner

Restore deleted files from SharePoint Online

The easiest way to restore files in SharePoint Online is obviously just to restore the deleted files using the web interface as Microsoft recommends. However, that won’t work if you need to restore 1000-plus files. Basically, the restore process will just get stuck, and you will probably die of age before anything happens. 💀 PowerShell to the rescue! 🦸‍♂️ Install the SharePoint Patterns and Practices (PnP) cmdlet Connect to the SharePoint site Notice the sites/rooms in the URL. You need to connect to an actual site on your SharePoint, not just the root of the site. In other words, you need to know from which site the files were deleted from. List all deleted items in the site “rooms” List all items deleted by a specific user Restore all files deleted by a specific user The restore process will take a while. In my case, I restored about 1000 files in about 20 minutes. Note that you will not get a restore log, but you can of course use the above command to check if files disappear from the recycle bin. If files exist on the server you will get error messages, which is fine. This just means that the deleted file already exists, or a newer file exists. Sources: Restore Recycle bin SharePoint Online with PowerShell

Make MPC-BC more like MPC-HC

I have been a long time user of MPC-HC which was recently abandoned by its developers. It’s a shame, because the media player was not only versatile and minimal. It was blazing fast, very user friendly, and supported all media formats I could think of. So I started to use MPC-BC instead, as recommended by many. Its a great alternative, though it honestly looks like a cheap and tacky version of MPC-HC. For me though, some of the default settings are a bit odd. Player window does not adjust to resolution First of all, the player window does not adjust to the video resolution. This means that if you open a video in UHD resolution, for example, the video player might be super small. Here is how you can fix it: Just turn on “Auto-zoom” to 100% in Options -> Playback. Blurry subtitles Another strange default setting in MPC-BC is that subtitles look very blurry. Almost as if they are burned in the video, even if they are external subtitles. You can fix this by going to Options -> Subtitles -> Rendering and set the “maximum texture resolution” to “Desktop”. Turn off dark theme You can also turn off the “dark theme”. Not sure why everyone is so obsessed with that these days. Options -> Player -> Interface -> Uncheck “Use dark theme”. Remove the logo The startup MPC-BC logo is not really too good looking either. Why not just remove it? Options -> Player -> Logo -> Skip with right arrow until the picture is gone.

Record microphone with FFmpeg in Windows

It’s easy to record your computer microphone with FFmpeg. The only tricky part (although not that tricky) is you just have to know the name of your microphone input. Before you begin make sure you have FFmpeg added to PATH. Let’s start by listing your recording devices. Amongst other things this will give you something like: The only thing you need to note is your device name. In this case it is Line (3- Steinberg UR44). To start the recording you just run the following code: To stop the recording hit CTRL+C. -f dshow means “DirectShow” and lets FFmpeg capture audio and video devices, video capture devices, analog tv tuner devices. -i audio="name_of_your_microphone" is the audio device you wish to record from. Replace name_of_your_microphone with the name of your input device. -c:a libmp3lame means FFmpeg will encode the audio with LAME MPEG Audio Layer III, also known as the MP3 format. -ar 44100 tels FFmpeg to record at a sample rate of 44,100 Hz. That is the standard for most audio nowadays unless you intend to use the audio for a video in which case you would use 48,000 Hz. -b:a 320k is the audio bit rate. The highest support for MP3 is 320 kbit/s. -ac 1 means the audio will be in mono as opposed to stereo streams. This makes sense as most microphones record in mono only. If you haven’t changed the directory in your command line you can always specify where to save the file. For example C:\output.mp3.

Super simple Windows 10 and Windows 11 automated installation

Update 11 October 2021: This autounattend.xml script also works for Windows 11 version 21H2. There are a lot of ways you can automate a Windows installation. The most obvious and simple way is using an answer file. So what’s an answer file? A Windows answer file is basically just an XML file that gives Windows instructions on how and what to install. So you don’t have to sit and click next, next, next… 😉 When installing Windows you just place the answer file at the root of the installation media and name it autounattend.xml. Of course, the file has to be a valid XML answer file for it to work. You can’t just put anything in it. Here is an example of an automated installation of Windows 10 using an answer file. Here is an example of the same script installing Windows 11. Making an answer file can be a little complicated and involves using Microsoft System Image Manager. If you want you can create one from scratch, but in this post, I am just going to share my go-to script. The following code is a simple file that will: Make a local Administrator called “User” without any password. Set the keyboard and regional settings to Norwegian. There is no activation, no license, no nothing. Just save the file as autounattend.xml and place it at the root of your Windows installation media. The only thing that is not automated is which disk Windows should be installed on. I intentionally skipped that step because of the risk of accidentally deleting a drive/partition.

Modding Nintendo Wii U with Homebrew and Haxchi

This is an explanation of all the steps I had to go through to make a modded Wii U in November 2018. I am not sure if it still applies, but I assume that if you have the same firmware, it should work. Basically all the info here is from wiiu.hacks.guide. The documentation can also be found on Github or as an archive per 2018.11.25. The type of Wii U used here is: Wii U with firmware 5.5.3 E. WUP-101(03) 32 GB version Reset your Wii U This whole process could take a couple of hours so make sure you have the time and patience. 🕓… Start with resetting your Wii U to factory settings. Note that you will lose all data on the Wii U if you do this. Turn on your Wii U Go to “System Settings” Go to the right until you see “Delete All Content and Settings”. Press the icon, click next, and “Delete everything”. After the formatting is complete the Wii U will shut down. Turn it back on and go through the whole “first-time-setup”. While you are at it, it is a good idea to logon with a Nintendo account, because we will need to download a game from the Wii U Store later on. You should connect to the WiFi, but try not to update the console if you are asked. Prepare the SD card and download files This information is from https://wiiu.hacks.guide/get-started Find a large SD card of at least 8 GB. Format the SD card as FAT32 and make sure it is in MBR (Master Boot Record) format. If the SD card is large, say 128 GB Windows will not format it as FAT32, but you can use the “Fat 32 Format” software tool to format it. Download the following files: […]

How to delete Steam cloud saves

Ever needed to clean up cloud saves in Steam? Unfortunately, that is not possible… However, you can intentionally corrupt the cloud save files to pretend they do not exist… 🤓 1. Get the ID of the game by finding the game on Steam store. For example the URL: http://store.steampowered.com/app/255710/Cities_Skylines/ indicates that the ID of Cities Skylines is 255710 2. Navigate to the Steam folder (not the game install folder) on your hard drive Usually under C:\. For example: C:\Program Files (x86)\Steam\userdata\YOUR_USER_ID\ 3. Use the game ID to find the folder that matches. For example C:\Program Files (x86)\Steam\userdata\106530865\255710 4. Run this PowerShell command in the “remote” folder: Note the asterisk at the end! As we cannot simply remove the files we will have to “corrupt” them, making them empty, but still present. Although there are some more steps, this did the trick for me. If it doesn’t work you might have to follow the additional steps here: https://www.youtube.com/watch?v=JADsIv2RUSw

Convert subtitles from the command line with SubtitleEdit

We can use SubtitleEdit from the command line in Windows to do batch operations on subtitle files. Just install SubtitleEdit first. If you are using the portable version, make sure you put the exe in PATH. Example: Convert TTML to SRT: It’s even easier in a Directory Opus button. Just make sure it is set to run as MS-DOS Batch function: Output: Becomes this: