- E-book Format Conversion
- ffmpeg
- Check if WAV files has the same audio data
- Upscale images with AI
- waifu2x ncnn Vulkan
- Record rtmp streams
- Concat two images with ImageMagick
- Download YouTube videos with youtube-dl
E-book Format Conversion
- Calibre should do the job in most cases.
- There was once I wanted to convert DjVu to PDF, but Calibre didn't work. And I used this method.
ffmpeg
This is always the first friend that comes to my mind when I need to do anything about files with audio and video.
- Downmix multi-channel DTS-WAV audio to stereo FLAC.
ffmpeg -i input.wav -ac 2 output.flac
- Concat video chunks downloaded from sources that use HLS.
ffmpeg -i playlist.m3u8 -codec copy output.mkv ffmpeg -allowed_extensions ALL -i playlist.m3u8 -codec copy output.mkv
- Convert WEBM to MP3.
ffmpeg -i input.webm -codec:a libmp3lame -q:a 0 output.mp3
Reference: https://trac.ffmpeg.org/wiki/Encode/MP3
- Merge audio and video.
ffmpeg -i video.mp4 -i audio.wav -c copy output.mkv
- Tip: When you're not sure what format to output to for audio-visual works, use
mkv
, since it can contain streams encoded by almost all codecs.
- Tip: When you're not sure what format to output to for audio-visual works, use
- Cut audio.
ffmpeg -ss <start_position> -i <input> -to <duration> -c copy <output>
- where
<start_position>
and<duration>
are in the form ofhh:mm:ss
.
- where
- Extract audio from video.
ffmpeg -i <input> -vn <output>
-vn
means no video.
Check if WAV files has the same audio data
shntool hash <file>
Computes the MD5 or SHA1 fingerprint of PCM WAVE data. (from man page)
Upscale images with AI
waifu2x ncnn Vulkan
- (more natural)
upconv_7_photo
>upconv_7_anime_style_art_rgb
>cunet
(less natural) - Higher denoise level, less natural.
Record rtmp streams
Record your favorite radio programs.
rtmpdump -r rtmp://fms-base2.mitene.ad.jp/agqr/aandg333 -v -o output.flv
Concat two images with ImageMagick
convert <image1> <image2> +append <result>
Download YouTube videos with youtube-dl
- List available formats
youtube-dl -F <url>
- Select a format to download
youtube-dl -f <id> -o <output_file> <url>