Convert video files to mp3

Dec 13, 2020

Many of the video resources I recommend are so well orated, they can be listened to (rather than watched) without much loss from the learner. These days you can just use whatever video app and just listen to it. But you may prefer the files as mp3 - easier to sort & organize, prevents lock-screen video-stopping, etc.

Download YouTube playlists

Some of the video resources I recommend are iTunes courses, hosted as playlists on YouTube. Setup yt-dlp then run:

yt-dlp -o "%(autonumber)s-%(title)s.%(ext)s" -f worstaudio -x --audio-format mp3 youtube.com/playlist?list=<EDIT THIS>

I use worstaudio because I'm not an audiophile when listening to spoken word, the quality is just fine. Otherwise you can use bestaudio - look at the yt-dlp docs.

Convert videos to mp3

If you already have video files (eg mp4), you can convert them to audio to add to your audio-player. Install ffmpeg (sudo apt-get install ffmpeg on Ubuntu, instructions for other OSs). Then in the video folder, run the following (replacing .mp4 with the video extension)

for f in *.mp4; do ffmpeg -i "$f" "\${f%.mp4}.mp3" && rm "$f"; done

Audio player

After one of the above steps, load onto your mp3 player. I use Smart Audiobook Player. You need to get the files to your phone, steps for Android. Put these in a folder (best to create one), open Smart Audiobook on your phone, select that folder as the "root" folder, and click Sync.

Try a walking desk

Long coding sessions lead to physical fatigue and mental fog. A walking desk keeps you alert and focused, preventing costly bugs and burnout.Stay focused and healthy during long coding sessions.Get the factsGet the facts

Comments temporarily disabled because Disqus started showing ads (and rough ones). I'll have to migrate the commenting system.