Download YoutTube videos and audio tracks using yt-dlp.
sudo yt-dlp --updateyt-dlp -x --audio-format mp3 --cookies ./cookies.txt \
--audio-quality 0 "https://www.youtube.com/watch?v=VIDEO_ID_HERE"yt-dlp -x --audio-format mp3 --audio-quality 0 "https://www.youtube.com/watch?v=VIDEO_ID_HERE"Use the -F flag to see formats, and then the -f flag to pick a format
yt-dlp -F https://www.youtube.com/watch?v=VIDEO_ID_HEREDownload using selected format number:
yt-dlp -f 140 https://www.youtube.com/watch?v=VIDEO_ID_HERECrop an audio file starting at 10 seconds for a duration of 120 seconds:
ffmpeg -ss 10 -i path/to/audio.m4a -t 120 -c copy path/to/audio.m4aConvert an m4a file to MP3:
ffmpeg -i path/to/audio.m4a -c:v copy -c:a libmp3lame -q:a 4 path/to/audio.mp3Creates an MP4 video from a JPEG and MP3 file:
ffmpeg -loop 1 -i path/to/photo.jpg -i path/to/audio.mp3 -c:v libx264 -tune stillimage \
-c:a aac -b:a 192k -pix_fmt yuv420p -shortest path/to/output.mp4