Archive

Archive for October, 2020

open two independent Firefox instances

October 29, 2020 Leave a comment

Problem

Mixing SFW and NSFW content is not a good idea. It’s better to use another browser for NSFW content. My favourite browser is Firefox. But what to use for other purposes? I’ve tried several other browsers but I had some problems with all of them. Is it possible to open another instance of Firefox with a different profile?

Solution

Yes, it’s possible. I found a blog post about it here. In short:

  • launch “firefox -ProfileManager” and create a new profile
  • launch the second instance with “firefox -no-remote -P secondprofilename

That’s it.

I tried Opera, but after launching it, it froze for about 10-20 seconds. It happened when I had several tabs open. After a while I couldn’t use the right click on the mouse, this event was discarded. Palemoon was very lightweight (thus fast), but it couldn’t play some videos. I had the same problem with Chromium. Brave was good, but I already used that for something else.

VS Code: make the file Explorer more readable

October 28, 2020 Leave a comment

Problem

In VS Code, I find the Explorer on the left side hard to read when there are several subdirectories open. How to improve it?

Solution

I find a blog post about it here. The following settings worked for me:

    "workbench.tree.indent": 12,
    "workbench.tree.renderIndentGuides": "always",

Categories: vs code Tags:

join .mp4 files into one video

October 24, 2020 Leave a comment

Problem

You have several .mp4 files and you want to join them to get just one (big) video.

Example: you download a YouTube playlist that consists of lots of small videos. You would like to watch them all and it would be simpler if they were joined together into one video file.

Solution

I found the solution here. In short: prepare a text file that contains the files you want to join (input.txt):

file 'input1.mp4' 
file 'input2.mp4'
file 'input3.mp4'

Yes, the “file” prefix is necessary. Then, issue the following command:

ffmpeg -f concat -i input.txt -c copy output.mp4

This operation is fast.

Note

Once I joined 35 short videos like this. It worked, but there was a problem with one or two short videos, and when I wanted to play this part in the big video, the video stopped and I only heard the audio. When this part was over, the video became normal again.

So this is what I did: I joined the short videos with Adobe Premiere Pro CS6. The resulting video was huge but with this technique I could reduce its size. The drawback of using Premiere Pro CS6 is that you need to wait for the rendering process to finish, and then the file size reduction is also quite slow.

ffmpeg: convert .webm to .mp4

October 24, 2020 Leave a comment

Problem

You want to convert a .webm file to .mp4.

Solution

The simplest form is:

ffmpeg -i in.webm out.mp4

Links

Categories: linux Tags: , , ,

ffmpeg: reduce the size of a video

October 24, 2020 Leave a comment

Problem

I have a video and I want to reduce its size. For instance, I make a screencast video that is 100 MB. After editing it with a video editor software, the rendered product becomes 300 MB. How to reduce its size back to 100 MB?

Solution

I found the solution here. The simplest way is this:

ffmpeg -i in.mp4 -fs 100M out.mp4

That is, you want out.mp4 to be around 100 MB.

Links

Categories: linux Tags: , ,

youtube-dl: download in best quality

October 23, 2020 Leave a comment

Problem

With youtube-dl you want to download a YouTube video in the best quality.

Solution

For a long time I used youtube-dl like this:

youtube-dl -f 22 URL

However, it won’t produce the best quality. Let’s look at this example:

It indicates that format code 22 is the best, but its resolution is 1280×720 only! This video is also available in HD resolution! Under format code 299 we can see the best video, but it has no audio. Under format code 140 we can find the best audio. So, let’s download these two and ask youtube-dl to mix them together:

youtube-dl -f 299+140 URL

The output will be an .mp4 file.

You could also mix the two best webm files, here they are 303 and 251. In that case the output will be a .webm file, which is even smaller than the .mp4. Whichever you prefer.

The format codes can be different for each video, so first run youtube-dl with the -F switch to get the list of available formats.

Project idea

Write a little program that takes the URL of a YouTube video and spits out the youtube-dl command that would download the video in the best quality. The program must analyze the output of “youtube-dl -F URL”. Example:

$ ydlbq.py "https://www.youtube.com/watch?v=P1g0rCPlTJo"
youtube-dl -f 299+140 "https://www.youtube.com/watch?v=P1g0rCPlTJo"
Categories: linux, windows Tags: , , , ,

Adobe Premiere Pro CS6: empty the cache

October 23, 2020 Leave a comment

Problem

For editing my videos, I use Adobe Premiere Pro CS6. However, I noticed that I always run out of free space under Windows. I figured it out by accident that Premiere Pro makes a lot of cache files and this causes the problem. How to empty the cache?

Solution

Edit -> Preferences -> Media… Hit the Clean button.

In my case, free space went up from 9 GB to 67 GB… What I did before was that I always increased the size of the VirtualBox hard drive.

Java Design Patterns

October 13, 2020 Leave a comment

See https://java-design-patterns.com/ .

It also has a description of principles and a collection of code snippets.

Categories: java Tags: , ,