GeekTips
109 subscribers
586 photos
3 videos
77 files
231 links
Linux Mint, video encoding, ffmpeg, geek tips, regex, pdf manipulation, substitcher, mpv config
Download Telegram
Drag files into freac and set to Encode to a single file and Opus encoder to 16kbps.
Add a cover if there isn't one already there in the metadata. Also set Artist to the Author and Album to the Title of audiobook. Press Encode. Notice on telegram it shows Kevin B. MacDonald instead of Kevin MacDonald. You can use tageditor to fix that if you wish.

Telegram uses MiB (Mebibyte rather than Megabyte) which is International System of Units (SI)
100 MB = 95MiB (~5% less)
1GB = .93 GiB

Linux Mint terminal
ls -lh shows 182M which is 182MiB
ls -l --si shows 192M which is 192MB
Those on Linux Mint (or other distros it's on flathub) Warpinator has an iOS (requires iOS 13+) in beta app. Must start up warpinator first and then open app.

Beta Link for Warpinator iOS app
https://testflight.apple.com/join/7ndmZa31
LibreOffice Writer remove all Number References from a wiki article. [1][2][10][15], etc.
Search and Replace All (check regular expressions)
\[[\d]+\]

\[
and \] escape the [ ] characters
[\d] digits and + unlimited amount of digits

Remove all hyperlinks in document
Ctrl-A, right click and Remove Hyperlink
All Opus, Subs, x265.prst
2.4 KB
All Opus, Subs, x265.prst

8 Freac presets I use for video and audio encoding. Updated with audio filter Dynamic Audio Normalization / collection of mp3s prepare for opus chaptered audiobooks for getting correct chapter times.

Took me a couple of days to figure this one out but freac signal processing channel converter (mono) and Sample Rate Converter 48000 still resulted in incorrect chapter times on opus audiobooks. Videomass filter worked.

m4bs don't have this problem. Just usually a collection of mp3s since they all can contain various sample rates.

To see what the 8 freac presets are check here https://t.iss.one/geektips/311
I wasted over 30 hours on this but freac for whatever reason the Sample Rate Converter (48000) doesn't fix the opus chapter times nor it's channel converter to mono. It's gotta be a bug with it's signal processing. Videomass (frontend GUI for ffmpeg) does work. Now I can start producing some nice opus chaptered audiobooks from massive collections with confidence.

Converting mp3s to opus and errors messages such as
[mp3 @ 0x55fb83eaa680] Estimating duration from bitrate, this may be inaccurate
[mp3float @ 0x55fb83ef22c0] Header missing
Error while decoding stream #0:0: Invalid data found when processing input

are generally ok but other ones with bad header, etc. it's best to just delete and not use those damaged / corrupted mp3s. Otherwise your opus chaptered audiobook will not have correct chapter times.
videomass (ffmpeg) showing the audio filter dynaudnorm (Dyamic Audio Normalization). It doesn't just increase or decrease volume uniformly but rather does so in chunks so you get the result of the bottom graph.

Real World Results (Example)

Finally, the following waveform view illustrates how the volume of a "real world" audio recording has been harmonized by the Dynamic Audio Normalizer. The upper graph shows the unprocessed original recording while the lower graph shows the output as created by the Dynamic Audio Normalizer. As can be seen, the significant volume variation between the "loud" and the "quiet" parts that existed in the original recording has been rectified – to a great extent – while the dynamics within each section of the input have been retained. Also, there is absolutely no clipping or distortion in the "loud" sections.
Got tired of converting webp images to jpg for processing in Fotoxx before I could make a montage. This Firefox extension Save webP as PNG or JPEG saves me the hassle.
I've been using LibreWolf (privacy focused Firefox without telemetry {E.T. phone home spyware}) for about a month now. Since most users I doubt set up all the options in Firefox to disable E.T. phone home stuff it's a quick way to how it all setup and even comes with uBlock Origin pre-installed.

These are the extensions I use now for LibreWolf. For Qwant I don't use the official one as it's annoying just an unofficial one.
On VLC iOS don’t forget these playback gestures for audiobooks.
This error can be corrected with MKVToolnix
Error while decoding stream #0:0: Invalid data found when processing input
Audio packet of size 24 (starting with 00000000...) is invalid, writing it anyway

This error is fatal and the mp3 should be deleted
mp3float @ 0x5639205e7a40] invalid new backstep -1
[mp3float @ 0x5639205e7a40] big_values too big
[mp3float @ 0x5639205e7a40] Error while decoding MPEG audio frame.
Error while decoding stream #0:0: Invalid data found when processing input

Some errors with some mp3s so multiplexing them to mka with MKVToolnix solved the problem. ffmpeg -c:a copy and output to mka didn't. To batch multiplex mp3s all at once in MKVToolnix when dragging them into the app choose
Create new multiplex settings for each file
this will create a tab for each mp3
Click Multiplex then Action for all tabs then Start multiplexing
When done you can Multiplex then Action for all tabs then Close
Another way to remove line breaks besides a LibreOffice macro is using xed (Text Editor) in Linux.

Edit | Preferences | Draw whitespace | Trailing whitespace [x] | Newline character [x] which will show newlines (<—- looking symbol)
highlight a double newline and copy and paste it into search for field

Search for: newline newline
Replace with: %%

Ctrl-A to select all then Ctrl-J to join lines

Search for: %%
Replace with newline newline
Installed calibre which I haven't used for a couple of years now. https://calibre-ebook.com/download_linux
Tried using pandoc and it worked but couldn't get text to justify and it hyphenated which I despise.

These are the options I use to convert an epub to PDF

ebook-convert input.epub output.pdf --base-font-size=7 --change-justification=justify --embed-font-family=freesans
Switched to a different computer just a tad faster but main thing is hottest is around 50 degrees C and put LMDE 5.0 Elsie which stands for Linux Mint Debian Edition. Main difference I notice is no PPAs so having to build a few packages from source and many from python.

Kernel: 5.10.0-13-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 Desktop: Cinnamon 5.2.7 tk: GTK 3.24.24 wm: muffin dm: LightDM Distro: LMDE 5 Elsie base: Debian 11.2 bullseye

installed Bulk-Renamer from Thunar XFCE file manager as it's superior to nemo
sudo apt install thunar
In nemo the file manager preferences under Behavior set
Bulk Rename command:
thunar -B
as it's superrior to nemo's Bulky

sudo apt-get install python-wxtools
sudo pip3 install videomass

sudo pip3 install ocrmypdf

downloaded source for tesseract-ocr 5.x
./autogen.sh
./configure
make
(took like 45 minutes)
sudo make install
sudo ldconfig

1 [tesseract] Error opening data file /usr/local/share/tessdata/eng.traineddata
1 [tesseract] Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.

Installed English, Japanese, Chinese Simplified
sudo apt install tesseract-ocr-eng tesseract-ocr-jpn tesseract-ocr-chi-sim

sudo cp /usr/share/tesseract-ocr/4.00/tessdata/*.traineddata /usr/local/share/tessdata

also had to install ffmpeg 5.0.1 from source
sudo apt install libopus-dev
./configure --disable-x86asm --enable-libopus
make
sudo make install
Couldn't login — after inputting password it would flash and I'd be stuck in a loop of re-entering user password. Ctrl-Alt-F2 (terminal)
sudo chown myuser:myuser /home/myuser/.Xauthority 
solved the issue then Ctrl-Alt-F7 to switch back to X11.
MusicBrainz Picard (free on Win, Linux, Mac) easy to edit a chaptered opus audiobook. Can change chapter names or even times.
After converting to mka with MKVToolnix which fixes most mp3 errors and then with videomass (ffmpeg) you convert to opus and you still get this error you must deleted these corrupt mp3s as it'll destroy chapter times in the entire opus audiobook. See here for more info
Notes from this excellent Regular Expression Article

grep -o -w "\w\{5\}" wordle-caps.txt > wordle-complete.txt

The regex string itself, \w\{5\} is equivalent to five continuous characters

shuf -n 5 wordle-complete.txt

grep '[^ED][A][T][^ED][^ED]' wordle1 > wordle2

The circumflex ( ^ ) means that the single statement should be inverted, similar to the -v switch. So the full regular expression [^ED][A][T] [^ED][^ED] searches for a string of five letters. The first must not be E or D, the second must be an A, the third must be a T, and so on

grep '[^WP][A][T][A][^WP]' wordle2 >

The A can occur in the second, fourth, or fifth position, and the O can occur in the second, third, or fourth position. L and R do not occur at any position in the target word. The regex for this is [C][^LR][^LR][^LR][^LR]
WordleREGREX.pdf
2.1 MB
Worlde Regrex article