simply convert video files from MKV to MP4
ffmpeg -i in.mkv -movflags +faststart -codec copy out.mp4
convert to HD 720P/1080P
ffmpeg -i in.mp4 -s hd720 -profile:v baseline -vf format=yuv420p out.mp4
ffmpeg -i in.mp4 -s hd1080 -profile:v baseline -vf format=yuv420p out.mp4
convert to h.265
ffmpeg -i in.mp4 -vcodec libx265 -crf 28 out.mp4
convert all files to h.265
find . -type f -exec ffmpeg -i "{}" -vcodec libx265 -crf 28 "{}".h265.mp4 \;
crop a video 80×60 section, starting from position (200, 100)
ffmpeg -i in.mp4 -filter:v "crop=80:60:200:100" -c:a copy out.mp4
cut the videos based on start and end time (timing format: hh:mm:ss)
ffmpeg -ss 00:01:00 -i in.mp4 -to 00:01:17.5 -c copy out.mp4
ffmpeg -ss 00:01:00 -i in.mp4 -t 00:00:17.5 -c copy out.mp4
ffmpeg -ss 00:01:00 -i in.mp4 -t 17.5 -c copy out.mp4
Use ffmpeg to add text subtitles
How to Add Font size in subtitles in ffmpeg video filter
How to set background to subtitle in ffmpeg?
How to Add Subtitles to a Video with FFmpeg (5 Different Styles)
ffmpeg -i in.mp4 -vf subtitles="in.vtt:force_style='OutlineColour=&H80000000,BorderStyle=4,Fontsize=24'" out.mp4
Download m3u8 streaming to mp4
set useragent in ffmpeg
ffmpeg -user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3554.0 Safari/537.36" -headers "origin: https://XXXXXXX.com" -headers "referer: https://XXXXXXX.com/XXXXXXX" -y -re -i 'https://XXXXXXX.com/XXXXXXX.m3u8' -c copy -bsf:a aac_adtstoasc -- XXXXXXX.mp4
change framerate
ffmpeg -i in.mp4 -filter:v fps=fps=30 out.mp4
Concatenate two MP4 files
Merge two videos without re-encoding
# Create File List
echo file file1.mp4 > mylist.txt
echo file file2.mp4 >> mylist.txt
echo file file3.mp4 >> mylist.txt
# Concatenate Files
ffmpeg -f concat -i mylist.txt -c copy out.mp4