Wednesday, November 29, 2023

converting flat video to fulldome

Leaving aside paid products like Adobe After Effects, for multiple videos on a fulldome frame, a good option would be OCVvid2fulldome

If we want to project a high resolution, say 4K flat-screen video onto the dome, OCVvid2fulldome v1.6 or above, with the following parameters works relatively well, except for some slight distortion at the bottom and top edges - 
#Outputw_pixels__=height
4096
#Output_fps
30
#Output_fourcc
XVID
#Number_of_input_videos_max_is_99
1
#Filename0
D:/Input/Filenm.avi
#vidlongi0
180
#vidlati0
76
#vidw0
270

Example images - 
Flat, 16x9

Using OCVvid2fulldome with 270 degrees coverage as above:


Another option is Natron, which has a G'MIC Distort filter for "Square to Circle" as referenced in this video. But Natron is prone to crashing for video to video conversions, image sequences seem to work OK. Also, Natron renders at something like 2 seconds per frame for 4K output, at least 4x slower than OCVvid2fulldome.

Square input - 


to Circle output - 

Natron troubleshooting notes:

im seq crashes were probably due to wrong way of entering filename?

im_%05d.jpg works well. Also need to check if the pre-multiplied value is correct, Opaque is fine for RGB video. Natron Tutorial | How to Render / Export / Write - YouTube

In the video link above, he has to re-render missing frames! and creating a proxy mov file at around the 13:00 minute mark.

troubleshooting premiere import - source settings, set the R, G, B.

Some frames randomly lo res!

Use precomp for large script if rendering fails!

saving script can overwrite a jpg!

To make a 16x9 video into a square video, padding with 1080 black border on top - does not look good - too small on the dome. Need to crop to square, so the sides are lost. 




Wednesday, November 22, 2023

saga of backing up and restoring a course with H5P content on moodle

My initial understanding was that backing up and restoring a course with H5P content on moodle would not work, based on the discussion at https://moodle.org/mod/forum/discuss.php?d=427198

A test course backup and restore did not work. But then, it turned out that the issue was that the H5P plugin mod_hvp had some missing files (since this moodle instance had its database copied over from another test instance) which were causing H5P content to not display at all. Diagnosed via php errors in /var/log/apache2/error.log.

The relevant course had 90+ H5P activities, it took 2.5 hours to backup via the CLI, and the restore also is likely to have taken a similar amount of time. 
screen
date && sudo -u www-data /usr/bin/php admin/cli/backup.php --courseid=511 && date
Mon Nov 20 14:38:34 UTC 2023
== Performing backup... ==
Backup completed, the new file is listed in the backup area of the given course
Mon Nov 20 17:09:05 UTC 2023

Detailed notes and dead ends listed below.

Looking at the discussion here,
It seems there are two ways in which H5P files can be used in a course - as a "link" and as a "downloadable file".
The "downloadable file" method is such that the course instructors cannot edit the content from the server, they need to download it to their computer and use some other software to edit it - so I guess what you have used is the "link" method.

In that case, there seems to be no easy way to backup and restore, the easiest way may be to re-create the course on the new server, if my understanding of the discussion here is correct - 

(
Another option would be to copy the entire database of the learning server onto the student server - and then you would need to
delete all unnecessary users
delete all unnecessary courses
re-upload files for all necessary courses
re-upload all files for appearance, logo, etc.
but this seems to be more difficult that re-creating the course. 
)

(
According to the last-but-one comment in the bug tracker
course backup and restore would work, but only tested on the same server. 

I tried out the command-line backup option for that course,
but that also did not finish even after an hour - stopping it manually gave the error message
Potential coding error - existing temptables found when disposing database. Must be dropped!
This looks like some sort of bug in the moodle backups code, I guess.

Or maybe just some temp tables which need to be dropped.

Apparently temp tables are automatically dropped when the connection to the database is closed.

)

(
Checking
moodledata/temp/backup/ directory
and
and

Even after clearing the moodledata/temp/backup directory, even a small course is taking a long time to backup.
So, there may be some temp data tables which need to be dropped. Need to check - 
Potential coding error - existing temptables found when disposing database. Must be dropped!

SELECT * FROM information_schema.INNODB_TEMP_TABLE_INFO;
(no results)
)

mentions backup can hang if non-standard course format

delete a file
go to course, choose the file / activity / resource, choose delete

delete a course

h5p backup speedup by disabling backing up libraries

Backup settings page, choose not to include the libraries
But not available in
Site Administration - Courses - General backup defaults

Will enable async backup with
https://devel2.server.of.ours.org/admin/settings.php?section=asyncgeneralsettings
and try.

Tried creating a course on devel2 with
My Courses -> Create new course.

Backup option is inside the course, under More -> Course Reuse -> Backup

Restoring similarly,
can go to any course, More -> Course Reuse -> Restore
and then choose to restore to a new course.
(NOT Import)

Just as in the learning portal, on the student portal also, the H5P hub option is turned on,
https://our.server/admin/search.php?query=hub

I have turned off and turned on this setting as suggested in one of the replies in the thread

In case that does not help, it may be required for you to fill in the H5P Hub account settings,
Register an account on the H5P Hub here

If not,

Another possible cause for confusion may be the two different ways of using H5P, using a plugin and using H5P core.
This discussion above uses Moodle 3.9, but our case with Moodle 4.1 might be different, too, and we might have to investigate further.

mod_h5p and mod_h5pactivity are already installed by default in Moodle 4.
https://server/admin/plugins.php

I tried creating a simple h5p activity in a test course by uploading a file arithmetic-quiz-22-57860.h5p, but the activity is not visible on the student site

To display H5P content in Moodle activities, the Display H5P filter must be enabled, and the URL (e.g., h5p.com) should be listed as an allowed source in Site admin / Plugins / Filters / Display H5P.


https://docs.moodle.org/401/en/Display_H5P_filter

Found a google drive listed there,

https://drive.google.com/file/d/1Mviw-REDACTEDZ3F/view?usp=sharing

After removing, still no. 

I see two possibilities.

1. In the page which talks about setting up h5p on moodle, there is mention of a filters page, where the url of the h5p server should be entered - 
There was a google drive link in that filters section which I have now removed. But then, we may need to add the correct filters. Or perhaps the "show h5p content"  may be sufficient, which is done at this page,
https://server/admin/filters.php 
If you have some url with a working h5p content from the hub, we can put the appropriate url in
https://server/admin/settings.php?section=filtersettingdisplayh5p

2. Another possibility is this thread - 


1. files missing as seen in apache2 errors.log


2. Compatibility issue with PHP 8,

But we're using PHP 7.x, so not this issue.

Trying uninstalling both
mod hvpactivity and mod hvp
installed only mod hvp, working
While installing mod_hvp, it mentioned "automatically registering your site with h5p" - so that is also done.

Even the web-based backup worked, for the test course! Just took an hour. and included 4 MB.

For without user data,
first change backup default setting at
(take backup and then change the default back)

CLI backup completed in around 2.5 hours, it is available to download from the course's restore area
in "User private backup area" of admin user

Tuesday, November 14, 2023

moodle app build for v4.3.0

Some small changes were needed in the github workflow in order to build the latest version, 4.3.0, of the moodle android app. My earlier posts about building the moodle app can be found here

Trying the old workflow led to some errors like

Failed to restore plugin "cordova-plugin-screen-orientation". You might need to try adding it again. Error: Error: Command failed with EACCES

Checking the testing.yml in the 4.3.0 tag found some extra lines like 

npm ci --no-audit --prefix cordova-plugin-moodleapp

Adding that led to a different error,

 cordova-plugin-moodleapp@0.0.0 prod /home/runner/work/LMSapp/LMSapp/cordova-plugin-moodleapp

> NODE_ENV=production scripts/build.js

sh: 1: scripts/build.js: Permission denied

Trying the simplistic solution of giving run permissions for everything,

chmod -R +x ./*

This worked, except for needing resources/android/icon-background.png to be added manually as in earlier releases. 

Tweaked the build script to directly pull the codebase of the release from github instead of manually adding it, with all customizations from our private repo which has the following file structure:



 

 

 

Monday, November 13, 2023

moodle app ui for multiple logins

Once logged in to one site, if someone has a login in another site also, they can log in to the other site by tapping on their profile icon on the top right corner of the screen and choosing the "Switch account" option, even without logging out completely.

using mv to move hidden files from a script or command line on Linux

mv subfolder/{.,}* /path/

But this can cause scripts in github actions to fail, so using cp -r instead.

show hidden files in Linux Mint File Open Dialog

 

 Ctrl+H to toggle show/hide hidden files!

Saturday, November 11, 2023

mirror ipad screen on Windows PC

 https://www.howtogeek.com/247573/how-to-mirror-your-iphone-or-ipads-screen-on-your-windows-pc/

Install AirPlay Screen Mirroring Receiver (free) from the Microsoft Store, open it.

Open the Control Center in ipad/iphone by swiping up from the bottom, or down from the top right edge, depending on which version of iOS you have. Then tap "Screen Mirroring." The PC should appear on a list of available devices.

But some apps like Disney + Hotstar don't work if mirroring is enabled, "Please try again after disabling screen recording".


Friday, November 10, 2023

the beginning of the end of Google

Whatever goes up has to come down. Ever since it went public, Google seems to have slowly but surely gone down the road that leads to its ultimate decline. People were discussing this in 2006, but now even their flagship Google Search seems to have gone downhill with their policies put in place (probably to avoid abuse). 

Case in point - a personal blog, created on blogspot.com (owned by Google!) was not being indexed. Even after submitting the sitemap created by blogspot itself, Google Search console shows that blog as being crawled, but not indexed. Whereas bing.com and duckduckgo.com at least show the pages on the site if the keyword site:actual.url.of.the.site is used. After filling up the "submit feedback" form on Google Search Console, of course, there was no response whatsoever.

Cory Doctorow, of course, has written about it eloquently on medium -
https://doctorow.medium.com/googles-enshittification-memos-2d6d57306072

and the ad-free, login-free version on

https://pluralistic.net/2023/10/03/not-feeling-lucky/#fundamental-laws-of-economics

Edit: Here is a Google insider's take on Google's cultural erosion - via slashdot, 

Hixie's Natural Log: Reflecting on 18 years at Google

Wednesday, November 08, 2023

turning off some notification types in a default Moodle install

It is probably prudent to turn off "forum" and "new login" notifications in a new moodle instance to avoid users' email providers marking the emails from the server as spam, and to avoid exceeding quota limits if using GMail / Google Workspace / other provider with daily quotas.

Tuesday, November 07, 2023

zoom effect in blender without moving camera

 By animating the focal length property of the camera, we can get the equivalent of a zoom lens effect in blender, without moving the camera.

https://blender.stackexchange.com/questions/23783/zoom-with-camera-in-an-animation

getting started with google search console

Google webmaster tools have been moved to google search console. Got an email after signing up, "Now that you've verified your site in Search Console (or created a site in Blogger or Google Sites, which verified your site for you) we have some tips to help you use Search Console more effectively."


Sent a report via google search console. The above page gives detailed about search indexing problems like "crawled, not indexed."
 
Edit - more about "crawled, not indexed" in this post, https://hnsws.blogspot.com/2023/11/the-beginning-of-end-of-google.html

Probable reason for crawling and not indexing could be that most of the posts are back-dated to the 1990s and some in the mid 2000s.

Bing does index it though. And so duckduckgo does too, since it uses Bing for the back-end.

Friday, November 03, 2023

adding a file to an appimage

To test out the script in the interesting discussion
https://github.com/Stellarium/stellarium/discussions/3424

I tried to add the script in the discussion to an appimage of stellarium 19.3. It turns out it's not that easy, but some things can be done.

https://superuser.com/questions/1301583/how-can-i-extract-files-from-an-appimage

suggests the --appimage-extract command-line option, but is not very explicit on whether the option should be run on appimagetool or on the appimage itself.

https://unix.stackexchange.com/questions/517881/how-can-i-change-the-files-of-an-appimage

clarifies that the option is to be run on the appimage itself, and not on appimagetool.

So, that extracted the files into ./squashfs-root, and I could add the new script into the scripts directory. But when I tried to create an appimage from the modified squashfs-root using appimagetool, it failed with an error,

org.stellarium.Stellarium:~: metainfo-filename-cid-mismatch

Googling led me to https://kb.vmware.com/s/article/1007969
which says that we should manually correct the cid for similar errors with VM images. But that advice doesn't seem to be relevant here. 

In any case, the bin directory inside ./squashfs-root had a stellarium executable which could run, and the extra added script also showed up.