Monday, February 25, 2019

Sunday, February 24, 2019

easy way to copy ssh keys to remote machines

ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub user@host


This copies the public key to the authorized_keys file on the remote machine.

Saturday, February 23, 2019

stabilizing cycling videos

In the process of making videos of my morning cycling jaunts, wanted to stabilize the video and also speed it up. Found that Microsoft Hyperlapse Mobile was doing a reasonable job, though it is limited to saving in 720p on my LG Q6 mobile. Very blocky output (probably a low-bitrate codec?) and the video goes blurry once in a while, but stability is good. Compared to kdenlive's vidstab stabilization in the video below.

Bugs and workarounds -

1. My phone doesn't show all the videos all the time, either to Hyperlapse when importing video, or via MTP to Linux Mint 18.1 on USB for taking backups. Workaround, as suggested here, was to just restart the phone.

2. Initially, I was working with kdenlive 15 which came with Linux Mint 18.1, and faced the problem of tooltips being unreadable, having white text on yellow background as mentioned in this post. Then I started using the version 18.12 appimage - that does not have this issue, and also is less prone to random crashes.

3. My equipment is the LG Q6 mobile mounted on the handlebar using a cheap mount from Amazon,


The bracket is not tight enough, and I keep needing to push it up 5-6 times per ride (if the ride is not very smooth) to prevent the phone from tilting down and capturing only the ground right in front of me. Maybe a different way of mounting the phone may solve this - will try out different orientations. 

Time taken for processing

Hyperlapse took around 10 minutes per video to import, and 2 minutes to export as 4x sped up 720p video. Input videos were 1080p 30 fps captured by OpenCamera with the phone's default bitrate and codec, 17 Mbps mp4, file size limited to 1 GB. The 1 GB had around 8 minutes of footage. So, overall speed of Hyperlapse was 12 minutes for 8 minutes of footage, 1.5x real-time.

Kdenlive + vidstab was much slower. Around 2.5x real-time for just rendering mp4 to mp4. This is at a higher bitrate, but on an i7 Macbook. And around 50 minutes for an 8 minute clip stabilization. So, for speeding up 4x and then stabilizing, it would take around 35 minutes in a two-step process, or 4.4x real-time.  

So, I'm going with Hyperlapse. Maybe my colleagues with better stabilization software would prefer the raw footage, so I'm archiving the raw footage separately. 

Finally, here's the comparison video






Friday, February 22, 2019

options when running out of space in legacy GSuite free

Copy-pasting from an email I wrote to a colleague - Regarding email - currently, our domain uses GSuite legacy free plan and does not allow expansion of the existing amount of space. So, the only way is to delete large attachments. In many cases, the attachments are required and cannot be deleted. This can be handled in many ways.


1. Forward them themewise to specially created gmail ids and then delete
2. archive them locally by storing on a local hard disk and then delete
3. automate the local archiving using some tool like

Wednesday, February 20, 2019

videos for waiting area

We did a first test of a video screening solution for our waiting area at the planetarium. The idea is to have videos playing on the screen, with some onscreen text indicating the probable time of the next show. Raspberry Pis to play out on old surplus VGA or TV screens. After a bit of trial and error, the method used was to play videos using VLC called from a script,
cvlc -I http --http-port 43210 --http-password MyPassword  --fullscreen --no-video-title --sub-source="marq{file=/pathto/marq.txt,position=10}" /home/pi/playlist.xspf

Documentation for the marq subfilter is at https://wiki.videolan.org/Documentation:Modules/marq
and the idea came from this discussion.

Auto starting using a .desktop file put in .config/autostart directory as described at
https://www.raspberrypi.org/forums/viewtopic.php?t=17051
with the contents of the .desktop file being
[Desktop Entry] 
Type=Application
Exec=/path/to/my/shellscript.sh

Modifying the marq.txt is currently by ssh, need to make some better solution, perhaps using a web server and PHP or something like that. Some images below of our test setup -


Saturday, February 16, 2019

making a flower timelapse

Timelapses shot on 13 and 16 Feb 2019
using OpenCamera app on an LG Q6 mobile phone.

Settings:
Repeat - Unlimited
Repeat Mode Interval - 10 seconds.

So, playback at 30 fps made it 300x real-time.

Imported into kdenlive as an image sequence and then exported with pan and zoom effect applied.
Bug and workaround - kdenlive 15.12.3 which comes with Linux Mint 18.1 has an issue with importing image sequences when the numbering is not sequential, or jumps. For example, the image sequence shot by OpenCamera had filenames like
Although kdenlive would see all 463 files in the folder, the images after 85953 would be ignored, and 85953 would be repeated for those frames. Workaround was to put the 8xxx sequence in one folder, 9xxx sequence in a separate folder, etc, and then import as image sequence.

kdenlive 18.12.1 64 bit appimage seems to have mitigated this bug by just importing those frames in the sequence it recognizes, without causing any of the repeat frames. But in the clip properties, it still erroneously shows the larger number of frames found etc. So, the workaround above is recommended.


https://www.youtube.com/watch?v=tD0L7H1jbWo




Thursday, February 14, 2019

TVS MSP345 printer with Epson drivers

Using the TVS MSP345 printer with Epson 24-pin generic drivers on Linux, we need to use the resolution 360x180 - lower than that, the print quality is terrible, and higher than that, it just prints the print codes.

Monday, February 11, 2019

sending and receiving emails with domain aliases on GSuite

One of our units had two domains, longname.tld and shortname.tld - they asked if they would receive emails sent to user@shortname.tld which had been set up as a domain alias in GSuite. My reply - 

The above holds good for receiving emails from username@shortname.tld

If you wish to send emails from username@shortname.tld (as against username@longname.tld), you need to follow the procedure below by logging on to username@longname.tld 


  1. On your computer, open Gmail logged in as username@longname.tld .
  2. In the top right, click Settings Settings and then Settings.
  3. Click the Accounts and import or Accounts tab.
  4. In the "Send mail as" section, click Add another email address.
  5. There, enter username@sssvv.org
You also have an option to make whichever email you wish to have as the default sending email, just below that section.

Tuesday, February 05, 2019

modus operandi for processing audio files for rebroadcast

Made this list for the people at Studio, since I would no longer be processing mandir audio for rebroadcast -

1. Listen to the whole thing (if feasible at 2x speed, or at mandir itself, while the program is going on), mark problematic parts with markers.
2. If the program is a drama that contains copyrighted songs, edit out those songs within only 10-20 seconds.
3. If the program is of poor quality, like songs which are completely out of tune, do not process for broadcast.
4. If the program has speeches which are not of general interest, or which are not suitable for broadcast due to poor delivery, do not process for broadcast. If the speech is good, but marred by repetitive words like Ummmm / Aaaah / "You know" / "Like" etc, edit those out. Also edit out any gaps like speaker turning pages, speaker drinking water, etc. 
5. If it is a music program, try to cut into individual songs/announcements if possible. Filenames similar to historical filenames which you can see under MSV* and SV* in our local cdsearch page.
6. For speeches, I have been processing to remove noise as per this:
http://hnsws.blogspot.com/2010/01/tips-for-clean-audio.html or
http://hnsws.blogspot.com/2013/11/another-audio-cleanup-tool-chain-reaper.html

7. I have been skipping processing Telugu dramas for AsiaStream once TeluguStream started, so that if the Telugu team is interested, they can use for TeluguStream. Similarly now with Hindi team.