ffmpeg -i dish.it.out.s01e01.mkv -c copy dish.it.out.s01e01.mp4 Preserve quality while reducing size (~50% smaller than H.264).
ffmpeg -i dish.it.out.s01e01.mkv or more detailed:
ffmpeg -i dish.it.out.s01e01.mkv -vf scale=1280:720 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k dish.it.out.s01e01.720p.mp4 ffmpeg -i dish.it.out.s01e01.mkv -t 00:02:00 -c copy dish.it.out.s01e01.clip.mkv 2.6 Remove unwanted audio tracks or subtitles Keep only the first audio track and no subtitles.
Get-ChildItem -Filter "dish.it.out.s01e*.mkv" | ForEach-Object ffmpeg -i $_.Name -c:v libx265 -crf 28 -c:a aac -b:a 128k ($_.BaseName + ".hevc.mp4")
ffmpeg -i dish.it.out.s01e01.mkv -map 0:v -map 0:a:0 -c copy dish.it.out.s01e01.clean.mkv | Command | Codec | Relative size | Quality | Encoding speed | |---------|-------|---------------|---------|----------------| | Remux only | Copy | 100% | Original | Instant | | H.264 CRF 23 | H.264 | ~40-50% | Very good | Medium | | H.265 CRF 28 | H.265 | ~25-35% | Good | Slow | | 720p H.264 | H.264 | ~15-25% | Acceptable | Medium | 4. Batch Processing for Multiple Episodes If you have all episodes of Season 1, use a loop.
Objective: Provide a set of ffmpeg commands to analyze, compress, convert, and optimize the video file for storage or playback. 1. Preliminary Analysis Before processing, inspect the source file.
for f in dish.it.out.s01e*.mkv; do ffmpeg -i "$f" -c:v libx265 -crf 28 -c:a aac -b:a 128k "$f%.mkv.hevc.mp4" done