How to Unlfip Mirrored Videos using VirtualDub

Not long ago I covered on how to unflip videos using various Windows video players. That was however only a temporary measure as the players merely flip horizontally the decoded video. A permanent solution requires the video to be encoded (converted) with an appropriate video setting applied to unflip the image.

Most run of the mill free video converters out there however don't usually support such a setting save for clipping, cropping and some simple video effects to adjust brightness and contrast.

As a result, you may be forced to use a commercial alternative or full blown video editor suites such as Sony Vegas for this simple task. This is however unnecessary as you can use the free open source VirtualDub (VDub) with its filters to do this in a couple of minutes. Let me show you how.


Step 1: Install VirtualDub

1. Download the latest version of VirtualDub from the homepage. If you're on Linux, you may be able to run VDub in your distribution using Wine.

2. To install it just extract the package to a folder somewhere in your computer.



Step 2: Install VirtualDub FFMpeg Input Plugin

VDub doesn't support some modern video file formats such as MP4, MOV and WebM. The only common format it supports out of the box is AVI however you may also run into problems with this format if it's using some unsupported codecs such H.264/AVC, VP8/VP9 etc.

To get past this limitation we need to install a plugin such as the FFMpeg Input Plugin which allow you to open most if not all common video formats out there. To do that:

1. Download the latest FFMpeg Input plugin from the SourceForge.

2. Run the setup file to install the plugin. When prompted to choose the folder where to install, select the folder where you extracted VirtualDub.


Step 3: Unflip Video with Flip Horizontally Filter

1. Run the program by running VirtualDub.exe.

2. Press Ctrl+O or go to File > Open video file... and select the flipped video. You can also open the video by dragging and dropping it inside VirtualDub.

3. In the toolbar go to Video > Filters or press Ctrl+F.

4. Click the Add... button, select the flip horizontally filter and then click OK to add it.

5. On the video preview you'll now notice that the video has been flipped.
flip horizontally preview
Right: Original Video, Left: Unmirrored Preview

The easiest way to know this is to seek to a section in the video where there is some visible text like captions, credits or a watermark. The text should now be readable.

6. Next if you don't mind saving the file to AVI just go to File and select Save as AVI... or press F7. You can then convert the AVI to whichever other format you want using a video converter.



Step 4: Save Video to MP4 or Other Formats

While VirtualDub only supports saving to AVI it does provide a means for using external encoders since version 1.10+. The appropriate external decoders if set up correctly can be used to export the edited video to MP4, MKV, MOV and other formats.

A good guide on how to set up some external encoders to save to various formats can be read here. For the purpose of this tutorial however I'll cover only exporting to MP4 or MOV using FFMpeg as explained in that guide.

To do that:

1. First download and install FFMpeg for the version of Windows you're running.

2. Next download this VDub profile file or copy the code provided here and save it to a file named ffmpeg-1.vdprof.

3. In VirtualDub go to Options > External encoders... then click the Import... button and select the ffmpeg-1.vdprof file. Doing that will import three different profiles:
  • mov ff x264+pcm: to encode to MOV with x264 video and PCM audio (i.e. WAV - if you need lossless audio)
  • mp4 ff mpeg4 q1+ac3: to encode to MP4 with MPEG-4 video and AC3 audio
  • mov ff mjpeg+pcm: to encode to MOV with MJPEG video (lossless) and PCM audio (lossless)
import vdprof profile

4. Switch to the Encoders tab with the following list of profiles.
encoder profile

Double click to open each of the profiles and in the Program box select the path to where FFMpeg is installed e.g. in C:\Program Files\ffmpeg\bin\ffmpeg.exe
encoder path

Click OK and that's it.

5. Now to save your video, go to File > Export > Using external encoder... and select one of the profiles you've just set up and click OK.

6. Choose where to save the encoded file and give it a name then click the Save button to start the encoding. Give VirtualDub some time to do the encoding. Your video will be flipped horizontally and saved in MP4 or MOV.

TIP:
  • You can encode to the lossless MOV format then use a normal video converter to save it to any other format using your preferred codecs and encoding settings for video and audio.

How to Clear Only the Search History in Firefox

Firefox keeps a history search engine searches (google, bing etc) done in the search bar or the address bar. This way it's able to automatically suggest previous searches for you when you start typing words that match to those searches.

While the search bar and address bar suggestions can be disabled, you can also opt to just clear the search history.

Additionally, in Firefox you can delete the search history on its own unlike in Chrome and some other browsers where this option is usually unavailable.

To do this:

1. Press Ctrl+Shift+Del or reveal the toolbar and go to History > Clear Recent History...

2. At the top of the Clear All History window select the time range to clear. If you want to clear the entire search history leave it at Everything.

3. Below History uncheck all items except the Form & Search History.
clear all history
Clear Form & Search History

4. Click the Clear Now button to start the deletion. That's it.

Load External Audio Track for a Video in VLC

In VLC for Windows it's possible to add a separate audio track to a video that either has no audio stream or that has one but you want to play a different audio.

With that said the process is a bit long-winded compared to doing it on PotPlayer and MPC-HC. The steps are as follows:

1. Open VLC and on the toolbar go to Media -> Open Multiple Files... or press Ctrl+Shift+O.

2. Browse and select your video file by clicking the Add button. You can also load a video by dragging it inside the window.
add  video
Add Video

3. At the bottom of the window check the Show more option setting.

4. Next check the Play another media synchronously option then click the Browse button beside the Extra media box.

5. Browse and add the external audio (e.g. aac/m4a, ac3, mp3, ogg/opus etc) file by clicking the Add button. You can also select another video to use its audio stream as the external audio.

Click the Select button when you're done.
select external audio
Select external audio

5. Click the Play button to start playback or Enqueue if you need to add other files to play.


Having a Problem Loading External AAC Audio?

I've noticed VLC ignores the external audio track if it's in AAC (filename.aac). To solve this issue, change the extension of the audio file to M4A (filename.m4a) and try again.

M4A and AAC are technically the same audio file format so this shouldn't affect playback of the file with other media players.

Load External Audio Track for a Video in MPC-HC

Sometimes you may want to either add an audio track to a video that has none or to play a different audio track to the one it has e.g. a commentary.

You can do this quite easily using Media Player Classic (MPC-HC) by doing either of the following:


Option 1: Load External Audio Automatically

For a video that has no audio track, MPC-HC will automatically play a separate audio track if it has the same name as the video and are both located in the same folder. e.g. Bick Buck Bunny.mkv (video) and Bick Buck Bunny.m4a (audio)

This function is usually turned on by default when you install MPC-HC. The option can be enabled or disabled by going to: Options > Playback > Auto-load audio files


Option 2: Load External Audio Manually

With this option you can load a separate audio track with a different name. Additionally, this allows you to add a different audio stream to a video that already has an audio track(s) so that you can easily switch between them.

To do this:

1. Open MPC-HC and press Ctrl+O or right-click inside it's window and then go to File > Open File...

2. In the Open box browse and select the video file and then in the Dub box browse and select a playable external audio file (e.g. aac/m4a, ac3, mp3, ogg/opus etc). Click Ok when done.
open and dub sources
Load video and external audio

3. If the selected video has no audio file, MPC-HC will automatically play the audio track selected.
select audio stream
Switch between external and internal audio

If the video had its own audio stream, you'll have to switch to the external audio track by selecting it by right-clicking > Audio Track > External Audio File

Load External Audio Track for a Video in PotPlayer

You can use PotPlayer to play an external audio file for a video that has no embedded audio stream.
The external audio can also be loaded in a video with an audio stream, you only have to override it by selecting the external audio. e.g. a commentary audio

To do this:

1. Open your video with PotPlayer.

2. Right-click inside its window and select Open > Load external audio.
load external audio
Select external audio

3. Browse and open the external audio file in a playable format (e.g. aac/m4a, ac3, mp3, ogg/opus etc). You can also select a video to use its audio stream as the external audio.

To do that, in the Browse window beside the filename box click the dropdown box and select All files. You can then select a video file.

4. If the opened video had no audio track, PotPlayer will now automatically play the selected external audio file.
switch audio stream
Switch between audio internal and external treams

If the video had audio, you'll have to switch to the external audio track by right-clicking > Audio > Select Audio Stream > External Audio File ID

How I Fixed Origin Error for a Site on Ezoic

About six months ago I added this blog to Ezoic after being contacted by one of their representatives. Ezoic is a certified AdSense partner and what their platform essentially does is to optimize your site for the best revenue by testing different ad layouts and positions using machine learning.

For Ezoic to do this, one has to integrate their site onto their platform using either a script or at the DNS level. I went with the latter and had no issues with the platform other than taking a hit traffic wise in the first few months after integration.

That's until earlier this month when by chance I noticed the naked (root) domain of my blog wasn't redirecting to the WWW version. To make matters interesting, while the insecure HTTP version wasn't redirecting (returned a 404 from Google) the HTTPS version was returning an Origin Error.

If you're wondering why the 404 was coming from Google rather than from my site, it's because this blog is using Google's Blogger on a custom domain.

While all this wasn't a cause for major concern, after all my preferred domain in Google Search Console was set to use the WWW version, I knew I had to fix this immediately for the sake of the few visitors that visit my blog directly.



Tracing the Problem

I was certain that Ezoic was behind the error so I checked their help pages and sure enough I found a help page that touched on the origin error and how to resolve it.

However, none of the fixes mentioned there would work with my Blogger hosted blog so I contacted my account manager for help. She contacted their tech team about the issue and later replied that I had to resolve the redirection issue on my end before they could look into the Origin error.

I was stumped by this turn of events. Nevertheless, I decided to first take a took look at the SSL settings in Ezoic. In the app I noticed there was a setting to redirect the HTTP traffic to HTTPS that was turned off.

Since I had Blogger redirecting to HTTPS in its settings I thought I should do the same here. Unfortunately, that resolved  neither the redirection nor the origin error.

My next stop was the Third-party domain settings in Blogger where for some reason I found the redirection to the WWW version had been turned off.

When I tried to turn it back on I was yet again met by another error. Apparently Google could not verify ownership of the domain I was using.

That prompted me to check the CNAME and A records that are needed to point Blogger to my custom domain. These records were however no longer being hosted in my domain registrar (Namecheap) since changing my Nameservers to those of Ezoic.

I had overlooked this detail during the integration with Ezoic and up until now had never verified the DNS records Ezoic had imported. So I looked into the DNS Manager available in my Settings Dashboard and as I had suspected Ezoic had not imported one of the unique CNAME records that's required to verify my domain ownership.



Fixing the Redirection Error

Knowing I had found the culprit, I added the missing CNAME record into the Ezoic DNS Manager and wait to see if the redirection would work.
unique cname
Add the Verification CNAME

It didn't though I presume this was because the DNS records were taking longer than usual to take effect. Fortunately, in the meantime I could also reverify my ownership of the domain using a TXT record via Google Search Console.

I did that and 30 minutes later the reverification was successful. Finally, I could save the redirection settings.

Unfortunately, the redirection failed once more. However, the 404 error from Google had gone away and the naked domain in HTTP was now redirecting to the naked domain in HTTPS and then returning an Origin Error.



Fixing the Origin Error

Remember the HTTPS redirection I activated in Ezoic? That option was the one behind this new redirection. I turned it off and just like that the redirection to WWW started working again. Gone also was the accompanying origin error.
HTTPS Redirection
Turned Off HTTPS Redirection
My blog is now once more working as intended: both secure and unsecure naked domain is redirecting to the secure WWW version as it used to do before.

The bottom line here is that if you're experiencing the origin error you may want to check the redirection and DNS Settings for your domain.