Category Archives: Linux

All about linux

Borderless video with mplayer

mplayer borderless window

mplayer borderless window

Below is the command that will display borderless video with the mplayer. The command below is specific to mplayer only.

mplayer -noborder "video.mp4" -geometry 2%:98% -zoom -x 325 -y 190 -vf crop=1280:544:0:88

Here ‘-noborder’ option turns off the border of th window.

-geometry : place the video window in xoffset: 2%, yoffset: 98% from top

-zoom : resizes the actual movie size to 325×190

-vf crop= : option removes the black borders that appear in some video. This needs to be tweaked video to video.

Use -vf cropdetect to detect what needs to be used to crop the black borders

To keep video, ‘always on top’ click the video windowand then hit capital ‘T.’

Reference
Mplayer hint: http://opensource-htpc.blogspot.com/2011/04/remove-black-borders-and-bars-from.html
Aspect Ratio Calculator: http://size43.com/jqueryVideoTool.html

[Solved] avconv: error while loading shared libraries: libx265.so.43

I recently installed the youtube-dl and while running it I got the error as follows.

avconv: error while loading shared libraries: libx265.so.43: cannot open shared object file: No such file or directory

avconv-error

Find the one that is currently in use

$ ldd $(which ffmpeg) | grep -i "libx265"

It will display something like

libx265.so.79 => /usr/lib/x86_64-linux-gnu/libx265.so.79 (0x00007fdff37b7000)

Now, we have to create symlink to this file. In my case, I symlink libx265.so.43 to libx265.so.79. We should use the full path for both files. Use the command given below.

$ sudo ln -s "full_path_to_actual_file" "full_path_to_missing_file"

Here, actual_file is libx265.so.79 and missing_file is libx265.so.43 that was reported earlier.

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libx265.s0.79 /usr/lib/x86_64-linux-gnu/libx265.so.43

After this command was executed. My avconv started working. I can now use it with youtube-dl, ffmpeg.

[Solved] Font render issue in Ubuntu

I recently faced a font rendering issue in Ubuntu. Though I used to have
these problems before back then I used to fix these by installing the appropriate languages
from Regional and Language settings. But it didn’t work this time. I then researched
on it and have come across the following solution that might be helpful to other
having the same problem like mine. It had to follow all the way upto solution5 to get this
solved.

My System specifications:
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

Solution 1:
– From Regional and Language settings install Nepali (macrolanguage). Apply
this system wide.
– if everything is fine you should see correct rendering of the Devnagiri fonts
in google chrome. This doesn’t need the logout/login to see the change.

Installed the Nepali (macrolanguage) but still you are facing the same font
rendering problem then you might want to try the below solutions one by one.

Solution 2:
– remove/rename the font that might be causing the issue.
– I preferred to rename the font instead of delete.

$ sudo mv /usr/share/fonts/truetype/freefont/FreeSerif.ttf /usr/share/fonts/truetype/freefont/FreeSerif.ttf.backup
$ sudo mv /usr/share/fonts/truetype/freefont/FreeSans.ttf /usr/share/fonts/truetype/freefont/FreeSans.ttf.backup

– for details on why it might work, see http://askubuntu.com/questions/97639/hindi-font-problem-in-chrome

Solution 3:
– Some websites by default use Mangal.ttf fonts that are unicode devnagiri fonts. And thus installing this font locally solves most of the rendering issue. BBC Nepali uses this font and thus if you are having problem with BBC Nepali you might want to give it a try.

Solution 4:
– During research, I also came across this bug report (https://bugs.launchpad.net/ubuntu/+source/webbrowser-app/+bug/1378184)
in Ubuntu which is quite not related to the problem specified here. But I thought
to give it a try by installing the fonts-lohit-deva
– Try to install the fonts-lohit-dev and see if this solves your problem

$ sudo apt-get install fonts-lohit-dev

Solution 5:
– install fontconfig-infinality and use its setstyle to linux
– please refer to this link for the instructions on how to do it.
http://www.webupd8.org/2013/06/better-font-rendering-in-linux-with.html

[Solved] Enable/Disable Touchpad in – Asus 510z (Ubuntu 16.04)

Machine Specification
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty

Board Information

sudo dmidecode | grep "Base Board"

BoardType:
Base Board Information
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: X550ZE

My Touchpad information:

cat devices | grep Touchpad

N: Name=”ETPS/2 Elantech Touchpad”

Now copy this script to /usr/local/bin/touchpad.sh
https://gist.github.com/samundra/6e06485c46f8267b222b1d4f7d6ea85b

Create file “/usr/local/bin/touchpad.sh” then copy and paste the above file contents into it.
change the file permission so it’s editable and executable by you.
sudo chmod u+x touchpad.sh

you might need to change the ownership of the file too.
sudo chown developer:developer /usr/local/bin/touchpad.sh

Here developer:developer is the user:group in linux.

Dash Menu

Now, we should bind a keyboard shortcut so that we can execute this script easily
through shortcuts. Open dashmenu and type keyboard. Open Keyboard settings.
In Keyboard settings window, navigate to shortcuts then to “custom shortcuts”.
Then click on the “+” sign shown and enter the following details:

Name: Touchpad
Command: /usr/local/bin/touchpad.sh

Keyboard custom shortcut
Click Apply.

Now this will be listed in the shortcut. But we are not done yet.
Now to assign the shortcut, click on the shortcut, it will change to “new accelerator”.
Hit any shortcut that you would like to assign to enable/disable touchpad. In my
case, I choose super+D, here super is “win” key in windows. This will save the
shortcut. If you already have assigned the shortcut to something else it will
ask you to reassign the shortcut.

Now try to enable/disable the touchpad with shortcut. You should see disable/enable
notification at the right corner. Hope you found this useful, let me know if you
found any difficulty in following this article.

Thanks,