Posts

Webcam streaming throught VLC with YUY2 compatibility

If you try to stream your webcam throught VLC you probably will see the following issue:

# vlc v4l2:///dev/video0 --sout '#rtp{mux=ts,sdp=rtsp://:8888/live.sdp}' 

VLC media player 3.0.4 Vetinari (revision 3.0.4-0-gf615db6332)
[000055c7620dd630] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007ff730002fe0] main mux error: cannot add this stream
[00007ff730001180] stream_out_rtp stream out error: cannot add this stream to the muxer
[00007ff73000ff60] main decoder error: cannot create packetizer output (YUY2)
[00007ff73000ff60] main decoder error: buffer deadlock prevented

To fix it, you must enable the transcoding and run the following command:

cvlc -vvv v4l2:///dev/video0:chroma=mp2v --v4l2-width 1280 --v4l2-height 720 --sout '#transcode{vcodec=mp2v,acodec=mpga,fps=30}:rtp{mux=ts,sdp=rtsp://:8888/live.sdp}'

where chroma enables hardware video decoding. You can edit the resolution, codecs and frame per seconds to enchanc…

v4l2: open /dev/video0: Permission denied

If you try to stream using your webcam throught vlc or xawtv

vlc v4l2:///dev/video0
or
xawtv -c /dev/video0

probably you will have this issue.
To solve it, you must add your user to the video group as follows:

sudo adduser username video
sudo usermod -a -G video username

where username is your user (whoami)
Now restart your computer

Enjoy it!

ERROR: LoadError: UndefVarError: writedlm not defined

I got this issue when I migrated my code from Julia 0.6.1 to Julia 1.0.1.
To solve it you must add to the beginning of your code the following line:

using DelimitedFiles

Enjoy it!


How to install pgadmin4 in Ubuntu 18.10 throught apt

If you want to install pgadmin4, as the official site said, probably you can't do it if you have Ubuntu Cosmic.

You need to add bionic repository, because in cosmic only pgadmin3 is available. Also, you need to specify if you are using 64 bits architecture.

sudo apt-get install curl ca-certificates
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

sudo sh -c 'echo "ddeb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

sudo apt update
sudo apt install pgadmin4

Enjoy it!


Official site: https://wiki.postgresql.org/wiki/Apt

How to install Visual Code from apt in Ubuntu

To get the lastest software versions, is a good idea get it from repositories to upgrade them.
To add Visual Code to apt execute the following lines:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code 

Enjoy it!

How to use aria2c with chrome as download manager in Linux

In the following site, you can found the source code and the link to the extension for google chrome:

https://github.com/robbielj/chrome-aria2-integration

After installed aria2, you must run the following sentence:

aria2c -s10 -x10 --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all=true

Now, you could choose download your files with aria2c from google chrome.
Enjoy it!

How to disable power button in Ubuntu 18.10

Image
If you have an Asus notebook, probably you hate the new power button location (right top corner).
To disable it and avoid accidently turn off your computer you can do the following steps:

Step1: Install dconf-editor

sudo apt install dconf-editor

Step2:

Run dconf-editor and go to org.gnome.settings-daemon.plugins.power.power-button-action

Step3:

Choose the value 'nothing'

Enjoy it!

Also, you can try directly with these commands:

gsettings list-recursively org.gnome.settings-daemon.plugins.power
gsettings set org.gnome.settings-daemon.plugins.power button-power 'nothing'