Hacker Public Radio Hacker Public Radio
-
- Technology
-
Hacker Public Radio is an podcast that releases shows every weekday Monday through Friday. Our shows are produced by the community (you) and can be on any topic that are of interest to hackers and hobbyists.
-
HPR4077: FFMPEG Series: Joining and Splitting files
FFMPEG Series
Part 2: Joining and Splitting files
Joining Files
Link: https://trac.ffmpeg.org/wiki/Concatenate
For lossless files of the
same codecs
ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy output.ts
For mp4 files, using
intermediate files
ffmpeg -i input1.mp4 -c copy intermediate1.ts
ffmpeg -i input2.mp4 -c copy intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy output.ts
Brief explanation of the options used in the command:
-i: input
-c copy: use codec same codecs as input
Splitting Files
Splitting by Duration:
ffmpeg -i input.mp4 -t 00:05:00 output_part1.mp4
ffmpeg -i input.mp4 -t 00:05:00 -ss 00:05:00 output_part2.mp4
Brief explanation of the options used in the command:
-i: Input file
-t: Duration of the output file
-ss: Start position of the output file (optional)
Splitting by Chapters or
Markers:
Use additional scripting to get out chapter marker times, then use
above
C. Splitting by Size:
ffmpeg -i input.mp4 -map 0 -c copy -segment_size 50M -segment_times 1 output_%03d.mp4
Brief explanation of the options used in the command:
-map 0: Select the first stream (video and audio)
-c copy: Copy the stream without re-encoding
(faster)
-segment_size: Size of each output file segment
-segment_times: Number of segments to create
output_%03d.mp4: printf-style pattern for the output
files -
HPR4076: WLED House Lights!
Video:
https://rmccurdy.com/.scripts/PROJECT365/PROJECT365%20PROJECT%20365%20WLED.mp4
PROJECT365 PROJECT 365 WLED
https://rmccurdy.com/.scripts/PROJECT365/
https://docs.google.com/document/d/1YLvVe2cgYSOTAWW47eK1Yp_K96ysCAQQDUmvkoqPbow/edit?usp=sharing
Project365
https://rmccurdy.com/.scripts/PROJECT365/
https://docs.google.com/spreadsheets/d/1y1NmHzS1OoQ3XDt48HXQC7AKnFjQGsQ9O8UTJvUXPgk/edit?usp=sharing -
HPR4075: Making a Pomodoro Timer
Making a Pomodoro Timer
Slacking Off at work
I get distracted Easy
My mind drifts if I try to focus on a single task For more than
20-30 Minutes.
If I try to fight the urge to just keep working my productivity goes
way down.
I end up working for a bit, then slacking off for half an hour.
I can get more work done If I embrace my limitation and force myself
to take a break.
Pomodoro Technique
From Wikipedia https://en.wikipedia.org/wiki/Pomodoro_Technique
The Pomodoro Technique is a time management method developed by
Francesco Cirillo in the late 1980s. It uses a kitchen timer to break
work into intervals, typically 25 minutes in length, separated by short
breaks. Each interval is known as a Pomodoro, from the Italian word for
tomato, after the tomato-shaped kitchen timer Cirillo used as a
university student.
The Timer
There are plenty of Pomodoro Apps I've tried using an app, but I
would often forget.
I wanted a physical device that was always on by desk and could grab
my attention.
I looked for a dedicated physical Pomodoro timer, but only found the
kitchen timers
I decided to make myself a timer using a Circuit Playground
Express
Circuit Playground Express
In my past episode about using a Pi pico to type passwords I
mentioned I owned a playground express.
The playground express is a micro controller with a lot of built ins
2 buttons
10 multi color LED
...
Runs circuit python with lots of libraries so it is easy to
program.
TDD
About once every other year I decided to start a project with as
much TDD as I can.
TDD Basics
Write a test BEFORE you write the code
Run the test - It will fail
Write the simplest code that will pass the test
Run the test and make sure it passes
Refactor/improve the code if needed.
TDD advantages
Code is easy to separate into discrete functions
Parts of the code can be rewritten without affecting the rest
confidence in rewrites
pomodoro.py
Circuit python looks for and runs a file named
code.py
A lot of the circuit Python code has to be run on the micro
controller
My Developers workstation does not have the LED's or buttons
I split the some code into a separate file based on if it could run
in "regular" python.
I used TDD as much as possible to test the functions in
pomodoro.py
code.py
BREAK_MINUTES = 5
WORK_MINUTES = 25
Functions that require hardware
No tests.
counts down and changes color of led
minutes divided by number of LED
Using the timer
Ready
Green Light next to button to start work Period
Blue Light next to button to start break Period
Working
White Background
Green progress pixels
Break
White Background
Blue progress pixels
Button A
Start working
Button B
Start Break
Links
https://gitlab.com/norrist/circuit_playground_pomodoro
https://circuitpython.org/downloads -
HPR4074: Jade Empire
I love the story-based games and experiences. Jade Empire is based in
the past in China or Japan, and you will be following this martial
artist searching for their kidnapped trainer.
Links
Wikipedia page:
Jade Empire -
HPR4073: Is the 1990 documentary "Cyberpunk" worth watching today?
In the podcast episode, I mention my HD restoration on archive.org,
however I found an even better restoration on YouTube at https://youtu.be/ZsbMXYigewI for those not allergic to
the platform. -
HPR4072: Piper text to speech engine
Using Piper
Github
Piper
Piper
Github
Thorsten-Voice
Thorsten-Voice Github
README
Piper Github README
Videos
Create your AI digital voice clone locally with Piper TTS |
Tutorial
Create voice clone with
Piper
Thorsten-Voice
Thorsten Mueller
Voices
Voice repo
Piper voices
Voice sample testing
Voice sample testing
Clone voices
Clone this model repository
Make sure you have git-lfs
installed
Git
lfs (Large filesystem)
In my case on Fedora 39
sudo dnf install git-lfs | teelog
Aside
I use an alias to create a log file with a date stamp
alias teelog='tee -a ~/logfiles/dump_`date +"%Y-%m-%d_%H%M%S"`.log'
git lfs install
git clone https://huggingface.co/rhasspy/piper-voices
# if you want to clone without large files – just their pointers
# prepend your git clone with the following env var:
GIT_LFS_SKIP_SMUDGE=1
Sample usage
echo 'Welcome to the world of speech synthesis!' | ./piper --model en_US-lessac-medium.onnx --output_file welcome.wav
Usage from a text file
cat sample/hamlet_to_be.txt | piper --model ~/git/piper/etc/test_voice.onnx --output_file hamlet_to-be_piper_sample_voice.wav
Customer Reviews
Love this idea
Keep it up
This is real Open Source
With a different host every day, you get people's once every few month bit of tech awesomeness every day, not oh no we have to do a show, let's throw something together. Great job on this show community. Way to go open source podcasting.
Mixed bag, at best
Some of it is moderately interesting from time to time. But after just listening to a guy (probably drunkenly,) ramble about installing an SSD and 16 gigs of RAM into a decade old MacBook for 18 minutes straight, I can't recommend. (Real hacker stuff, that...) There's plenty of better podcasts that are more consistent and technology-focused out there.