What you NEED to know before touching a video file

2026-05-15 · source · source ↗ · raw capture · wiki page

An in-depth educational guide for novice video editors and encoders, written after the author observed repeated beginner mistakes in subtitling and video re-editing communities.

1. The Anatomy of a Video File and Remuxing vs. Reencoding

.mp4 and .mkv are container formats, not encoding formats. The actual video coding formats (H.264/AVC, H.265/HEVC, VP9, AV1, ProRes) do the real compression work. Container formats package already-compressed streams, storing multiple audio/subtitle tracks, chapters, and metadata.

Reencoding = decoding and re-encoding a video stream (lossy, time-consuming). Remuxing = changing the container without touching the encoded stream (fast, lossless).

Tools like Handbrake or online converters often reencode when users just want a container change. Distinguishes H.264 (the format) from x264 (a specific encoding program).

2. Video Quality

Lists common misconceptions about what determines quality (resolution, frame rate, bit depth, file size, file format, codec, encoding program/settings, source, colors, sharpness) and explains why none of these alone determines quality.

The Encoding Program and its Settings: H.264 only specifies decoding, not encoding methodology. x264 and x265 are the best encoders for quality. Hardware encoders like NVENC prioritize speed over quality. CRF (Constant Rate Factor) is the main quality control — lower CRF = higher quality, larger file.

Interlude: So Then, What is Quality Actually? Quality is "how closely it resembles the source it was created from." Quality is relative to some reference/ground truth. Automated metrics (PSNR, SSIM, VMAF) exist but none are perfect.

Mythbusting

3. Summary of Key Takeaways

4. Learning to Spot Quality Loss

Areas to focus on: dark areas/gradients, strong colors (especially black edges on deep reds), grainy/textured areas, spaces around sharp lines (look for halos/ringing), text edges, image borders. Acceptability is subjective.

5. Color Space Parameters

Explains YCbCr color space and chroma subsampling (typically 4:2:0 where chroma is stored at half resolution in both directions).

Key parameters: - Color matrix: BT.601 (older, SD-era) vs BT.709 (HD video). Wrong tagging causes color shifts. - Color range: Limited vs Full (vast majority of videos use Limited range) - Transfer characteristics/gamma: BT.709, BT.601, BT.1886, sRGB, PQ, HLG - Primaries: BT.709, BT.601, BT.2020 - Chroma location: Default is "center left" for most videos. Incorrect handling causes chroma shift visible as colored glows on edges.

"If you see your reencode somehow changing colors, check your input and output video's color matrices." Tools: MediaInfo to check, MKVToolNix to edit.

6. Subtitles

ASS (Advanced SubStation Alpha) is the most powerful subtitle format. Only mkv fully supports ASS subtitles. Avoid hardsubbing when possible since it "involves reencoding, and hence introduces quality loss."

7. Recommended Tools

Recommended: MediaInfo, mpv, ffmpeg, SlowPics, MKVToolNix, MKVExtractGUI/MKVcleaver, Aegisub, MkvToMp4

Tools to avoid: Handbrake ("has a lot of footguns"), any file conversion websites ("just use ffmpeg directly"), Topaz AI, Anime4k, RealESRGAN, RIFE, imgsli for comparisons

8. Workflows

General principle: Reencode only once, at the very end. Use lossless intermediates where possible. Export lossless from editing software, then encode with ffmpeg.

Encoding template:

ffmpeg -i yourinput.mkv -c copy -c:v x264 -preset slower -crf 20 youroutput.mkv

Three-way tradeoff between file size, quality, and encoding speed (CRF regulates quality vs size; preset regulates speed vs efficiency).

9. Bonus: Interlacing

Interlaced-looking footage is often actually telecined (3:2 pulldown). Readers should "consult some more experienced person before blindly running a deinterlacer" on telecined footage.

10. The Rabbit Hole

Points to the JET Guide and the author's blog for further learning.

11. Footnotes (17)

Covering: codec terminology, x264 superiority, CRF vs bitrate, post-processing caveats, fractional frame rates, scaling/destructive operations, lowpassing in Blu-ray authoring, color "fixes," sharpening caveats, RGB color spaces, YouTube's color matrix, gamma complexity, chromatic aberration vs chroma shift, ASS jokes, transparency-targeting settings, MediaInfo reliability for CFR, and the term "telecine."

Comments

The author states the guide's target audience is "users that make some form of edit of some video that they want to distribute or archive and who, at least to some extent, care about video quality." A commenter posted a TL;DR generated by Gemini 2.5 Pro; another criticized it as stripping "all of the learning, meaning and knowledge shared." The author explained their intentional lack of quantitative recommendations and acknowledged legitimate reencoding use cases.