Intro
I stumbled upon
YouTube-dl
and found it super handy for downloading entire channels. The only catch was the webm format it outputted isn’t always compatible. So, I looked into ffmpeg commands for format conversion.
Config File
Later, I realized a simple config file tweak would do the trick. Just add this line to your config:
| |
Here’s my full config file:
| |
Single Command
You can quickly transcode with this command:
| |
But doing it one by one is way too slow, which led me to think about batch processing.
Batch Processing
Create a new Notepad file and paste this code:
| |
Here, (*.webm) is the original file type, and \"%%~na.mp4\" is the desired output file type.
Save it as run.bat, drop it into the target folder, and run it.
However, having to edit it every time for different files isn’t super practical.
DOS Script
So, I dove a bit into .bat files and quickly whipped up the following script (FYI: GB2312 encoding is needed for proper Chinese output in the command line).
| |
Just drop this in the desired folder and run it.
References
Practical YouTube-dl Tips · eisen blog
20+ FFmpeg Command Examples for Beginners - Zhihu
FDM’s Down, youtube-dl’s Sluggish – Doomsday for Content Editors?! Comment by AnnMilne
Batch Transcoding FFmpeg with .bat Commands - Wuren’s Notes
Learning Bat Commands - Sunshine & Rain - Blog园
Detailed Explanation of bat set Command_Python Veteran Noob’s Blog - CSDN Blog