this will give you an .mkv and a .srt file:
yt-dlp -f "bv[ext=webm]+ba[ext=m4a]" --write-subs --embed-subs --sub-lang en,en.* --sub-format srt https://www.youtube.com/watch?v=inKdUICLmXY
this will give you an .mkv and a .srt file:
yt-dlp -f "bv[ext=webm]+ba[ext=m4a]" --write-subs --embed-subs --sub-lang en,en.* --sub-format srt https://www.youtube.com/watch?v=inKdUICLmXY
MKVToolNix GUI
is a Qt GUI for mkvmerge and a successor of mmg.
mkvmerge
merges multimedia streams into a Matroska file.
mkvinfo
lists all elements contained in a Matroska file.
mkvextract
extracts specific parts from a Matroska file to other formats.
mkvpropedit
allows to analyze and modify some Matroska file properties.
General Format for mkvmerge:
mkvmerge -o video_merged.mkv original.mkv original.srt
where -o or –output file-name is write to the file file-name.
add subs to a video:
mkvmerge -o Max\ Headroom\ -\ S01E01\ -\ Blipverts-merged.mkv Max\ Headroom\ -\ S01E01\ -\ Blipverts.mkv Max\ Headroom\ -\ S01E01\ -\ Blipverts.srt
extract subs from simple file:
mkvmerge -i Star\ Trek\ Lower\ Decks\ -\ S01E01\ -\ Second\ Contact.mkv
mkvextract tracks Star\ Trek\ Lower\ Decks\ -\ S01E01\ -\ Second\ Contact.mkv 2:Star\ Trek\ Lower\ Decks\ -\ S01E01\ -\ Second\ Contact.srt
extract subs from complex file:
mkvmerge -i Cowboy\ Bebop\ (2021)\ -\ S01E01\ -\ Cowboy\ Gospel.mkv
mkvextract tracks Cowboy\ Bebop\ (2021)\ -\ S01E01\ -\ Cowboy\ Gospel.mkv 7:Cowboy\ Bebop\ (2021)\ -\ S01E01\ -\ Cowboy\ Gospel.srt
convert mp4 to mkv with srt:
mkvmerge -o "result.mkv" "orig.mp4" "subs.srt" << reboot
Automatic subtitles scrapers are running into obnoxious 102 byte advertisements from opensubtitles.com instead of valid .srt files. To find and clean them out, run:
find . -type f -size -200c -iname "*.srt"
Once you’re sure of the list of files shown, you can delete with:
find . -type f -size -200c -iname "*.srt" -delete
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
find -name "*.flac" -exec ffmpeg -i {} -q:a 0 -map a {}.mp3 \;
rm *.flac
rename -v 's/\.flac\.mp3/\.mp3/' *
sudo apt install handbrake
sudo apt install handbrake-cli
cd to the music folder
yt-dlp --extract-audio --audio-format mp3 (youtube link)
To upgrade yt-dlp (if you get an error) :
yt-dlp -U
To find out about more options:
ebook-convert gets installed with calibre
in epub folder:
for f in ./*.epub; do ebook-convert "$f" "${f%.epub}.pdf";done
After downloading comic book or anime images as a mix of .webp and .jpg, run the following:
find . -name "* *" -type f | rename -v -f 's/ /_/g' && for f in *.webp; do dwebp $f -o $f.jpg;done && rename -v 's/\.webp\.jpg/\.jpg/' * && rm *.webp && sudo chown -R jeff:users * && sudo chmod -R 777 *
This will change any spaces to underscores, convert any .webp to .webp.jpg, rename those to just .jpg, set permissions and ownership.
Use the compress option in Gnomes Files to compress the jpg’s into a .zip, then rename the .zip to .cbz
or:
zip bookname.cbz *.jpg
install exiftool using:
sudo apt install libimage-exiftool-perl
run with:
exiftool ‘-filename<%f_$imagesize.%e’ (images folder)
Download mkvtoolnix from:
https://mkvtoolnix.download/downloads.html
You can use mkvmerge (from mkvtoolnix) to inspect the file to see what the ID of the subtitles data will be:
mkvmerge -i input.mkv
This will list the tracks, for example like this:
File 'input.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_AAC)
Track ID 3: subtitles (S_TEXT/UTF8)
Based on the ID of the track, call the following command, where is the one you identified above. You can use any srt filename that you want.
mkvextract tracks input.mkv :.srt
So, in our case, that would have been:
mkvextract tracks input.mkv 3:subs.srt