Tag Archives: 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

Download udemy course videos using youtube-dl

Tools Required

  1.  youtube-dl
  2.  youtube-dl extractors – udemy, udemy:course
$ youtube-dl --list-extractors | grep udemy

Please refer to Youtube-dl Download page for the installation.

Steps

  1.  Get link to the course to download. e.g. https://www.udemy.com/mentoring/
  2.  Login into udemy website, save the cookie from chrome using Chrome Cookie.txt export extension. Save it to file udemycookies.txt
  3.  Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
# $ youtube-dl {course_link} --cookies {path_to_cookies_file}

$ youtube-dl https://www.udemy.com/mentoring/ --cookies ~/udemycookies.txt

General Tips

I prefer to keep downloaded videos inside the directory. So, at first I create a normal directory and put cookies.txt into it. Then `cd` into this directory and execute the above command. This way I will have all videos downloaded into a directory.

 

[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