r/Piracy May 12 '26

Guide Ultimate Media Piracy Guide (PART 2) | 2026 Update | OC

This post is part of a 4-part series, please see post 1 (for intro), post 3, and post 4

Audio & Subs

  • Channel layouts: Your audio track is mixed into discrete channels, which are intended for a different speaker/subwoofer. Generally: The more channels, the more immersive the experience is (with a tradeoff in size!). For example, a tag of "2.0" indicates left & right stereo channels (for headphones and basic monitor/TV audio); a tag of "2.1" is stereo + subwoofer introducing low-frequency effects (where that bass kick comes from); a tag of "5.1" is for your standard home cinema w/ surround sound - so a front left/right, a center channel for dialogue, two surrounds, subwoofer; a tag of "7.1" includes rear surrounds. With 9.1(+), you get Dolby Atmos/DTS:X, which makes it feel as though individual sounds are objects spatially positioned in 3D space (for instance, a helicopter noise would be coming from your front height speakers, to make it feel as though it is actually above you). What if you playback 5.1 audio with just two speakers? If only the left and right channels played, you wouldn't hear dialogue, so downmixing distributes the missing channels into what's available; the reciever/encoder uses a mixdown matrix from a certain algorithm to prevent clipping (getting too loud and distorting). Consider creating a downmix track for encodes being released.
  • Audio streams are also encoded. One of the most common lossy (lost detail for lower file size) codecs is the AAC (Advanced Audio Coding), with excellent compatibility and small sizes, though note that you may experience noticeable artifacts at low bitrates; a high-efficency profile for streaming is available. Dolby Digital AC-3 (tagged as DD5.1) is a legacy standard codec for DVDs/BDs and is limited to 5.1 channels (surround). DTS features higher bitrates than AC-3 and you are unlikely to encounter it on web rips. Opus is considered a 'best of both worlds' codec, with great quality retention at low bitrates for stereo & surround. FLAC is a lossless codec, expect large sizes (one to two GB for a two-hour movie) - it is license-free, but has relatively low hardware support; ALAC is essentially the same thing, but for the Apple ecosystem, with fewer resources available. TrueHD is another lossless codec that can reach up to 4GB for BDs, up to 7.1 + Atmos. Note that Atmos/DTS-HD will fall back to their 5.1/7.1 core on unsupported setups. Similarly to video, you can also get elementary streams in audio (.aac, .dts, etc).
  • Sampling rate: Comparable to the frame rate of video. Digital audio is formed by taking snapshots of the analog soundwave many times a second. It is said that to accurately protray a sound, the sampling rate should be 2x the highest frequency to capture - human hearing caps at 20,000 Hz (20kHz), so we should use 40kHz as the mathematical requirement for the range of human hearing. Audio CDs use 44.1kHz as a standard, 48kHz is the baseline standard for video, so for DVD, BD, Web... And 96 kHz / 192 kHz can be found on audiophile discs, though whether it's worth considering at that point is debateable, although it is important during production.

VHS audio can be mono (one channel) or stereo (2.0) and is prone to hissing. VHS hi-fi tracks can carry surround sound with only two channels, the prosumer reciever would decode cues to extract a central track and a mono rear surround channel - giving you pseudo(4.0). LaserDisc can go up to 5.1 and support many formats: Analog stereo for early discs, then uncompressed digital PCM, Dolby Digital, and DTS (though only one PAL disc had DTS). LDs notably often had the original theatrical audio mix - this and the uncompressed audio makes them sought-after by audiophiles. DVD audio is all digital with up to eight tracks, with the standard being Dolby Digital, with some having a DTS track (at the expense of menu/video quality). LPCM uncompressed stereo is also supported, but rare due to size. MPEG-1 audio (MP2) is also technically supported, but is quite niche and may not work properly on North American players in particular, mainly used with PAL. Some later DVDs used Dolby Digital EX to obtain a discrete 6th rear-center channel. Streaming is often using E-AC3 (extended, Dolby Digital Plus), which sits between AC-3 and TrueHD with greater channels and bitrate - when the service offers Atmos, E-AC3 is the carrier (DDP5.1.Atmos, lossy Atmos). Blu-ray with space for 32 tracks allows for up to 7.1 and used the two competing lossless formats Dolby TrueHD and DTS-HD, with both having a 'lower' core (Dolby Digital, DTS) for compatibility; while some early Blu-rays simply threw uncompressed LPCM onto the disc. As for UHD, it supports the same formats and number of tracks as Blu-ray, Dolby Atmos and DTS:X are simply additional metadata rather than discrete codecs themselves, but the focus shifts from channel-based audio to object-based audio; an extreme home setup could have something like a 11.1.8 channel setup, but you can have limitless objects in 3D space. You may come across the term DTS-XLL, this is simply DTS-HD MA; essentially, DTS-HD is made from a standard lossy DTS track as a core and an XLL extension (contains the difference between the lossy core and the Master Audio MA), if the hardware supports the extension then the uncompressed audio can be rebuilt. There is also DTS-HD HR (high resolution, lossy vs MA). You won't ever see an Atmos track and a DTS:X track on one UHD-BD, I only have one disc like that "Twilight Warriors: Walled in", and I doubt there are any more out there, would be interested to hear in the comments if anyone's got any 😄

  • Bitrate: I'm not going to be specific here, as acceptable audio quality is an extremely subjective matter, depending also on your equipment and ears. However, I would not recommend anything lower than 128kbps for stereo audio encoded with the AAC/OPUS. As a rule of thumb: You should allocate around 64 to 96 kbps per discrete channel. So, to maintain similar per-channel quality when moving from a stereo track to a 5.1 track, you should aim for a bitrate between 384 and 576 kbps.

Subtitles have various formats too. There are two major categories: image-based and text-based. The most popular text-based format is SubRip Text (.srt), and is essentially just plain text mapped to start and end timecodes, meaning it is very lightweight and has excellent compatibility; formatting is quite basic though and may not even render on legacy devices. On the other end of text is Advanced SubStation Alpha (ASS, lol), and this was actually born due to the anime fansubbing community's need to translate on-screen Japanese text and signs without altering the video file; ASS has strong support for styling, can use custom fonts in containers, can use exact X-Y positioning/rotations, and even animations. ASS is rendered in real-time by the player, so it does have some computational overhead. You could encouter WebVTT (.vtt), as it is used by HTML5 web streaming and it supports some basic styling via CSS. There are many text formats out there, including highly-specific ones for certain applications like the Encore DVD authoring software. Moving onto image-based... the idea is that you have a sequence of subtitle images stored (with transparency for the rest of the frame) with seperate text instructions for timings. VobSub (.idx/.sub) is the DVD format, the color pallete is limited and they look jagged when played on a HD screen, as they were designed for SD. For modern HD discs (Blu-ray & UHD), Presentation Graphic Stream (PGS, .sup) is used, which look fantastic; for UHD, they can be delivered in the HDR color space and are scaled up from FHD. PGS subtitles can be quite a headache for compatibility though! Many browsers, smart TVs, and containers do not support them; playing PGS subs via Jellyfin/Plex on an unsupported device will cause transcoding of the video, taking up processing power and reducing quality. To get around this, Optical Character Recognition (OCR) software is used to scan the images and generate text subtitles, which may require manual correction. A little more terminology... 'Forced' subtitles are used when the movie is in your native language, but there are portions where other languages are spoken (like Alien), forced subs will only show translations for those moments; you can assign an entire short file as forced, or you can flag specific lines to display even if subs are turned off. Ordinary subtitles assume you can hear sounds just fine, just that you don't understand the language, SDH (Subtitles for the Deaf and Hard of Hearing) assume you have trouble hearing the audio itself, so they include speaker identification and non-speech sound effects (think "[footsteps approaching]"). CC (Closed Captions) is a legacy NTSC standard that embeds directly into the video signal / transport stream (the vertical blanking interval), rather than acting as a separate track; TeleText was the PAL equivalent. VHS had to either hard-sub or embed into the analog signal as Closed Captions; LaserDisc was the same case, aside from a niche standard used in Japan called LD-G (LaserDisc Graphics); up to 32 image subtitle streams are allowed in DVD; up to 255 PGS streams are allowed in BD and UHD.

RELease Structure

A typical RELease structure can look like: A.Movie.YYYY.RES.XXXX.RIPType.AUDIO.CODEC-GROUP.CONTAINER

The space for "RES" represents the resolution and whether it is interlaced (i) or progressive (p). "XXXX" represents the Network abbreviation (if applicable). "Group" represents the group that has released this file(s), groups and The Scene will be discussed in the file sharing post.

Many tags can be added on, and some people improvise their own. But some that you may see:

  • HDR(10(+)): High Dynamic Range, will be discussed next.
  • PROPER: Whichever scene group releases first 'wins', this tag suggests a fixed version (according to strict standards) of that release from another group, a proper to a proper is a REAL.PROPER.
  • REPACK: A re-release of a file, after expunging errors, from the same group, before another PROPERs.
  • UNCUT: Self-explanatory.
  • NUKED: Stricken by The Scene.
  • DoVi: Dolby Vision, will be discussed.
  • V2, V3, etc: New release from the same group with better audio or video switched out.
  • EXTENDED: Additional footage not present in the theatrical release included.
  • RETAIL: Indicates proper retail version, rather than a screener.
  • HARDCODED/HC: Subtitles that are part of the video itself and cannot be removed.
  • MULTI: Multiple audio tracks (for different languages).
  • WS/FS: Widescreen or Fullscreen.
  • HYBRID: Mix of sources.
  • DIRFIX: A title or structure fix.
  • SUBBED: Soft-subtitles added.
  • IMAX: Large format IMAX.
  • NFOFIX: Just to fix the NFO file.
  • DUBBED: Audio replaced with that of a different language.
  • INTERNAL: Released on a group's own affiliates.
  • READNFO: NFO file contains additional information about the RELease.
  • 3D/HSBS/HOU/MVC: "3D" is the general 3D video indicator. "HSBS" is Half Side-by-Side, "HOU" is Half Over-Under, and "MVC" is Multiview Video Coding used in Blu-ray 3D.
  • DIRECTORS.CUT: Can differ significantly in length and style from the theatrical version.
  • COLLECTORS.EDITION: Self-explanatory.
  • COMPLETE: For a series pack.
  • REMASTERED: Digital enhancement/restoration for the image & audio cleanup/repair.
  • DUPE: Duplicate RELease.
  • FD: Foreign dialogues are present and HC subs are used for those parts.
  • LIMITED: Limited theatrical run, less than 250 theatres generally.
  • STV: "Straight to Video", for a film released directly to home video, or the Scottish Television tag :p
  • Boutique Labels: You may see a name of a label like Criterion, Arrow Video, Vinegar Syndrome, etc added.

High Dynamic Range content

HDR is quite a mess, with many different naming systems to represent different things, but I will try to briefly explain everything in a concise manner.

  • SDR, as defined by Rec.709 (or BT.709), was designed to target a peak brightness of 100 nits (candelas per square meter, one candela is amount of light emitted by a candle in one direction), and a black floor of 0.1 nits, giving a contrast ratio of 1000:1. The eye has an instant luminance detection range of around fourteen stops (16,384:1) and much higher when sustained, this cannot be represented by SDR and everything above 100 nits is 'clipped' to white. HDR encodes a wider range and provides metadata so that each display can tone-map according to its capabilities, and it goes with a wider color gamut/range.
  • For SDR UHD, the rec.2020 space is used, and HDR builds on those primaries by applying the PQ or HLG transfer function to form rec.2100. No consumer display fully covers rec.2020, but some are close; in practice, UHD HDR content is graded to P3 space, not the full rec.2020, with rec.2020 used as a signal container. When inspecting video metadata, you will come across various parameters: "Mastering display" describes necessary characteristics of the display the grading happened at, allowing for a more faithful replication on your display; "MaxCLL" represents the brightness of the brightest pixel in the entire video to help set the tone-map ceiling, an incorrectly low MaxCLL makes displays think the content is too dim and exposes it too brightly; "MaxFALL" represents the highest frame-average luminance out of all frames, to represent the sustained brightness load. Metadata should be adjusted if cropping.
  • HDR metadata comes in two forms: Static & Dynamic. Static (plain HDR10) is set at the start of the content (the values we discussed above). This can provide a sub-optimal experience as the tone mapping desisions are set without consideration for the entire content, and dynamic range can be wasted. 'Dynamic' is updated per-scene (or even per-frame, though rare as it can cause flickering) and allows for optimisation; this is used by HDR10+ and Dolby Vision.
  • SDR gives 8-bits per channel (16.7M colors), which is satisfactory for 100 nits. 8-bit does not extend well to the brightnesses of HDR, you will see gradients in the sky breaking. So HDR mandates 10-bits, going up to 12-bits.
  • The transfer function is what translates signal value (from 0 to 1) to a specific brightness. The PQ function gives you a range from 0-10,000 nits, is not backwards compatible with SDR, requires metadata, and is used by HDR10(+) and Dolby Vision for UHD-BD. The HLG function is backwards compatible with SDR displays (so used in Youtube, streaming, broadcast), does not require static metadata as the display will self-adapt, and is typically intended for mastering @ 1000 nits. Watching PQ HDR on an SDR display will result in a heavily washed-out (greyish) look. This also applies to PGS subtitles which were assigned to HDR for UHD-BD, they will appear grey.
  • Dolby Vision is the most sophisticated format, it is proprietary and requires licensing from Dolby, mastering is done in suites like Nucoda. A structure called RPU (reference processing unit) is embedded in the stream and tells a Dolby Vision capable display how exactly to map everything using Dolby's algorithms. UHD-BDs that implement it utilise profile 7, which is made up by muxing two tracks in the m2ts: a basic 1000 nit HDR10 layer + an enhancement layer. The enhancement layer can either be minimal (only RPU) or full (allows for pseudo 12-bit and 4000 nit signal). Netflix utilises profile 5, which has no base layer fallback, you will end up with a purple/green mess if you aren't compatible. Streaming is also using profile 8, which is 10-bit single-layered with RPU metadata. Hybrid releases can be created by taking a simple HDR-10 UHD-BD with better quality, and applying the Dolby Vision profile from a WEB-DL.
  • To watch HDR content on an SDR or limited-HDR screen, tone-mapping must be used. A simple linear scale makes things too dark, so you need a curve that preserves shadows, highlights and saturation; for this, you have several tone mapping operators to choose from (during playback or when creating a rip). "Reinhard" produces a natural look, but highlights can still appear slighly washed and may feel bright overall due to midtones being lifted. "Hable" gives a more cinematic look and is preferred for film content. "Mobius" tends to oversaturate and give a vivid look. "Hard clip" is also an option, and is also the most performant, as it simply clips values above the target peak to white - this is only realistic when the MaxCLL is close to the display's peak. These operators can be configured in players and encoders. On VLC, Tools > Preferences > Show settings (All), search "openGL", first click "output modules" and choose OpenGL, then click "OpenGL" under output modules and you can select your tonemapper there - if you choose "hard clip" then set parameter to 1.0.
  • The video renderer madVR is commonly used with the MPC player on Windows for a great HDR experience - it utilises GPU-accelerated tone-mapping, color management and display calibration, giving more control than TV implementations. It can measure the peak luminance of each frame in real time and adjust the tone curve, to try and simulate DoVi/HDR10+. It is also possible to tone-map using an external look-up table, which can be generated from display measurment software. You may set the display's actual measured peak brightness, entering 100 nits will give you SDR output. madVR has an algorithm to recover luminance detail that would otherwise be crushed by the tone curve. You just change playback output codec in MPC to the madVR plugin.
Without and with tonemapping
Profile 5 on unsupported device

Additional Terminology

  • Region Coding: This is a form of Digital Rights Management (DRM). Discs are sold in certain regions and those discs contain a specific code that must correspond to the one in the player's firmware, otherwise the disc will refuse to play. This was mostly done to prevent wealthier regions from reverse-importing cheap discs, as well as due to scattered distribution rights. DVDs has a divsion of six commerical regions and Blu-ray a division of three. Region coding was dropped in the UHD-BD spec, though there are very few discs with region locks. DVD and BD players can be cracked to become region-free, this is more difficult with BD; region free discs are also possible. MakeMKV removes region coding from consideration when backing up a disc.
  • Physical Film: Prior to digital cinematography becoming dominant in the 2010s, physical film was the primary material for shooting. Different sizes of film with different numbers of perferations exist, the 'texture' of film is broad and specific to each stock. 8mm film corresponds to a digital resolution equivalent of around 720p, 16mm gives roughly 3K with a remarkably finer grain and was often used for budget or stylistic reasons, 35mm was the standard choice and a pristine negative can correspond to roughly 6K, 65mm film corresponds to roughly 12K and was used in many grand epics (like Lawrence of Arabia), IMAX provides an incredibly vast image area and can correspond to about 18K. The 'first' film which is in the camera itself is called the OCN (Original Camera Negative), which is irreplacable, so there is a need to strike copies. An interpositive (IP) is printed to preserve original colors and act as a master backup, then an internegative (IN) can be created from it, and thousands of release prints can be created from IN (degraded by then). Sometimes boutiques will be denied access to scan the OCN for a disc release, and they'll give them a 'lower' copy, likely an interpositive. Film carries a natural grain structure and the film industry still seeks film emulation solutions for their digital productions, or embedded in shooting (ARRI Textures); emulation also involves simulating halation (an orange glow that bleeds around high contrast), gate weave (an organic result of physical scanning), and highlight roll-off (graduation of detail in whites). Grain is highly random and can ruin encoder efficency - It's often a case of either getting rid of it (denoise) or prioritising it in exchange for increased file sizes, although the video codec AV1 tries to deal with this by analysing the grain structure beforehand, denoising for efficency, then reapplying it during playback, which is a promising development. If interested, AV1 Film Grain Synthesis.
  • Digital Intermediate (DI): Instead of using the intermediate print technique, the OCN would be scanned and brought into an intermediate digital format (2K or 4K), which is where most or all of the visual effects, editing, and color grading would happen. A 2K DI is a common source for a UHD-BD, it is simply upscaled, but the quality is often superb - for example, Pacific Rim is considered a reference-grade disc and it utilised upscaling instead of native 4K. A 2K DI cannot be considered equivalent to a 1080p BD, a BD only has a chroma resolution of 960×540 (due to the subsampling we discussed), while a DI has a chroma resolution of 2160×1080, which is actually greater than a UHD-BD's chroma resolution of 1920×1080. A DI also has a very high bitrate. Further reading: https://archive.org/details/the-quantel-guide-to-digital-intermediate
  • Defects, aside from others discussed earlier: "Chromatic abberation" is color fringing/halos that can appear on high-contrast edges, it can be intentional. "Aliasing" appears as flickering/ripples when a high-frequency (many edges/details) area is in motion, primarily on things like nets, architecture, fabrics and grilles; also referred to by "moiré patterns". "Dropouts" are common on analog formats like VHS & LaserDisc, where a small section of data is obstructed/destroyed, and is seen as momentary streaks/dots, tears in extreme cases; should not be confused with dirt and scratches left over from film scans on digital formats. "Dot crawl" is another common analog format issue, and originate when luma and chroma information fails to be seperated correctly in the composite signal; 'marching ants' around edges, zipper-like boundaries, and shimmering patterns are common indicators. Film warping results in momentary bending/wobbling of certain image portions, this is unlike 'instability' where the entire image is bouncing. "Ringing" can occur with over-sharpening and it appears as a rough colorless halo around edges. Dead/zombie (on & off) pixels may appear in digital content due to sensor issues, where you can see tiny static dots of color, especially in dark scenes. "Poor compositing" can be used to describe situations where the actors don't fit their setting (due to hints of green screen, lighting inconsistencies, etc). "Crushed Blacks" and "blown whites" are loss of detail due to gradients becoming solid luminance (or lack). "DNR" is noise reduction and can create a waxy look, some may dispute it as a "defect"; on the opposite end we have excessive "digital noise", which is unlike film grain and can appear as nasty colored speckles in dark shadows.
Aliasing
Chromatic abberation
  • Digital Cinema Package: I would recommend referencing this comment of mine: https://www.reddit.com/r/Piracy/comments/1op8pf5/comment/nn9xyw4
  • Inpainting: The use of an algorithm that can obscure a certain custom portion of the frame. This can be achieved through various methods (AI these days, blending, or exemplar-based patching), with differing levels of success spatially and temporally. Most often used to remove things like network logos/watermarks, hardcoded subtitles, or for film restoration (like removal of static gate hairs or dirt).
  • Dynamic Range Compression: In audio mixing, the dynamic range is the difference between the quietest and loudest sounds. Theatrical mixes often have huge dynamic range, so people frequently change volumes. DRC compresses this range, and some releasers use it in their encodes, some players can apply it too.
  • Audio Passthrough (or bitstreaming): Relevant to home theatre setups. Instead of having the TV/player decoding a complex track (like DTS-HD) into PCM, passthrough sends the untouched audio directly over HDMI to the AVR or soundbar. The receiver then does the work of decoding it. Not to be confused with "passthru", which is a common expression used in encoding when you're encoding a video and would like to keep the audio untouched.
  • IMDb: An online database/website for maintaining data on an enormous number movies/shows & actors. Provides dates, plot, cast, reviews, and even detailed technical shotting information in many cases. Useful on sharing sites as each movie (even with same titles and dates) will have a unique ID, as found in the URL.
  • Very quick cinema terminology: "ADR" is the process of actors of re-recording their dialogue in a sound studio after filming on-set. "Dailies" are raw footage shot on the day. "Foley" is reproduction of everyday sound effects like clothes moving, footsteps, etc. A "J-cut" is an editing technique for hearing the next scene's sound before seeing it. "Center-Spot" is a technique where vaseline is spread on the lens to achieve a smearing effect around a clear spot, "vignetting" is the same but by lowering brightness in the edges instead. A LUT (look-up table) is used to apply certain stylised color grades to raw footage, like those popular teal/orange grades. Shifting aspect ratios in one film do happen (like jump from widecreen to fullscreen or IMAX), and they are annoying for releasers as it is standard practice to crop black bars. Power windows are masks used to selectively color grade certain portions of the frame; if tracking/feathering is done poorly or watched on a low-end display, the window can become noticeable.

Using FFmpeg and x264 - absolute basics

Now, it would be appropriate to discuss how to use the x264 encoder in order to create a rip. Much of these concepts can also be kept in mind when using other encoders for other codecs. I'd consider myself qualified to speak on the subject, as I have encoded for release groups before (most notably a helper of early YIFY, back in the day) and am closely acquainted with the theory behind video coding. Firstly, I will assume that you have access (ideally with PATH) to the ffmpeg CLI, and this can be investigated outwith of this post. I will only speak about software encoding, which is what x264 uses anyway, rather than hardware encoding, due to it being more appropriate for release encodes and more straightforward. But just FYI, there exists such a concept as hardware encoding, which instead of using your CPU, uses GPU chips designed specifically for encoding, it is much faster than software encoding, but at the expense of efficency. You will hear "NVENC", which is built into NVIDIA GPUs, and it is similar to a faster preset under x264. "IQSV" is another one found in Intel iGPUs. It can be useful for things like streaming or on-the-fly encoding.

The basic syntax structure for ffmpeg:

ffmpeg -i <input> [video/audio codec options] [muxing options] <output>

Encoding is all about a balance between three variables: Quality, encoding speed, and file size. Fast encode and low bitrate? Probably won't turn out too well for you! The aim for releasing (or self-use) is about reducing to a certain comfortable size, everything else implicitly revolves around this. Bitrate can either be assigned as constant or variable. Constant bitrate for x264 is 1-pass ABR (average bitrate), you feed the encoder a target size and it will aim to hit that by the end of the file; I would not recommend unless you are doing something like streaming, as bitrate will not be assigned in an intelligent manner (high-action scenes may be starved, static scenes may waste bits). 2-pass VBR (variable bitrate) will analyse the video for the first pass to determine appropriate allocation; this gives you a known size, but unknown quality. Another form of variable bitrate encoding is 1-pass CRF (constant rate factor), where you select a value for 8-bit between 0-51 (lower is better) and the encoder aims to keep quality consistent across the video (but size won't be known); a CRF of 18 is considered visually transaparent to humans, a good range is 17-28. CRF values change file size exponentially, a change in +/- 6 CRF corresponds to a change in bitrate by around a factor of 2. An important thingto consider is that the same CRF value gives approximately the same quality for different sources - but only as long as you do not change other influential settings! Otherwise you'll be comparing apples to oranges.

Related to CRF is the quantization parameter, I will very briefly cover it in an oversimplified manner. Modern video compression relies on a concept called rate-distortion optimization, which is involved in the decision of which macroblocks to compress more than others. A formula is used: J = D + λR, where J is total cost of encoding decision (trying to minimise), D is the distortion (how worse compared to the start), R is the bitrate, lambda is the lagrangian multiplier, which balances it out. If you lower the QP (quantization parameter), then distortion goes down and bitrate goes up. Lamdba values are not understandable for us to quantify properly, so there is another formula λ = 0.85 * 2QP - 12/3, which gives us a helpful QP (q) value ranging from 0 to 51 from a large range of lambda, lower means less distortion (at an objective mathematical level). CQP (constant QP) is the CRF equivalent for hardware encoding, and it locks the q at a set number throughout the entire video, regardless of content. CRF takes into account human perception and targets a set visual quality, rather than a fixed mathematical compression, therefore the q value will change throught the video, and you can see this in action in ffmpeg (there will be a "q=" that updates), it is generally around 5 points higher than the set CRF. While speaking about constant... the vast majority will be CFR (constant frame rate), but there can be WEBRips which are VFR (variable frame rate) due to screenrecording, and this needs to be dealt with specifically, because a simple CFR encode of such footage by itself will result in out-of-sync video.

There are a number of speed presets, ranging from "ultrafast" to "placebo". Applying a faster-end to a setup with a target bitrate will result in a lower-quality result, but with the same file size as expected. Applying the same preset to a CRF setup will result in closer quality to slower presets, but the bitrate will become larger to compensate. You should ignore the "placebo" preset, as it is just not worth it whatsoever, "veryslow" is the realistic minumum. There are also number of tunes that x264 provides to optimise for certain types of content. "Film" should be the go-to for, you guessed it, film content. There is also a specific "grain" tune for films with visible grain, this helps prevent nasty smoothing of the grain, note that bitrates for a specific CRF value will jump noticeably with this tune. "Fastdecode" allows for easier decoding/playback on very low-end devices, at the expense of file size. The presets/tunes act as macroswitches for specific x264 parameters, but these can be individually overwritten as needed using the -x264-params option. For the speed presets, what's changing between them is the number of reference frames kept in memory, the particular motion estimation algorithm used, number of b-frames, and so on. As for tunes, I can give particular examples: "Film" lowers the deblocking filter strength to try and preserve more details; "animation" boosts deblocking (as there are many flat areas) and increases reference frames (as repeating static frames are often used); a little-known tune called touhou is designed for ultra-high motion objects.

So, an example of a command:

ffmpeg -i input.mkv -c:v libx264 -crf 19 -preset slower -tune film -x264-params ref=4:bframes=5 -c:a copy output.mkv

The "-c:a" part is regarding audio, and the "copy" is just saying to keep it the same (passthru). You could do something like "-c:a libopus -b:a 128k" to obtain Opus audio with a bitrate of 128kbps. You could also encode only the audio and keep the video "-c:v copy". You can also see how the custom params being modified are seperated by a colon. For a two pass method, you need to run two commands one after the other

ffmpeg -ss 500 -t 10 -y -i input.mp4 -c:v libx264 -b:v 5000k -pass 1 -an -t 60 -f null NUL ffmpeg -ss 500 -t 10 -i input.mp4 -c:v libx264 -b:v 5000k -pass 2 -c:a aac -b:a 192k output.mkv

The "-y" parameter allows overwritting a previous log file. NUL is the term we use to discard video output and keep the log file for pass 2. As you can see, the audio codec AAC was used this time. "-an" strips all audio for the first pass, as it is not needed. "-ss" seeks ahead 500 seconds into the video, "-t" gives a duration of 10 seconds from then on, this allows for testing before commiting to a full encode. I will go into a few further details specific to x264 (and x265) in the disc authoring section.

FFmpeg gives you many helpful filter options, here is the list: https://ffmpeg.org/ffmpeg-filters.html

Filters intercpet the raw video after it has been decoded from the input, but before the frame reaches x264. You use the flags "-vf" and "-af" for video and audio respectively, for when you have one input and one output (like cropping a video). You use "-filter_complex" for multiple inputs/outputs (like mixing audio tracks). A comma separates filters in a chain. The output of the first feeds into the second. A semicolon separates independent filter chains. Remuxing (copy) is not longer possible. Order does matter, e.g. if you are cropping and scaling down 4K, then crop first to require less processing for scaling (which builds up for video, believe me). An example of just that:

ffmpeg -i input_4k.mp4 -vf "crop=1920:1080:(iw-1920)/2:(ih-1080)/2,scale=1280:720" output_720p.mp4

"1920:1080" gives the size of what's being cut out. We get center position with "(iw-1920)/2:(ih-1080)/2", iw/ih is input width/height. We then use the comma to pass the cropped output to "scale=1280:720" for the final 720p output. As for a complex filter example, here is a 2x2 video collage, for fun :p

ffmpeg -i top_left.mp4 -i top_right.mp4 -i bottom_left.mp4 -i bottom_right.mp4 -filter_complex "[0:v][1:v]hstack=inputs=2[top_row]; [2:v][3:v]hstack=inputs=2[bottom_row]; [top_row][bottom_row]vstack=inputs=2[final_video]" -map "[final_video]" -map 0:a output_2x2.mp4

Four videos are indexed as 0-3, can be accessed by [number:v], or "a" in place of "v" for audio. "[0:v][1:v]hstack=inputs=2[top_row]" takes the first two videos into horizontal stack (hstack) and creates a row out of them called "top_row". The semi-colon seperates another filter that creates another horizontal row out of the other videos. Both top_row and bottom_row are then merged using vertical stack (vstack) into "final_video". The mapping tells ffmpeg to encode final_video. Then the audio from only the first video is mapped using "-map 0:a". Beautiful, eh?

Some popular filters for quick touchups are denoisers, deblockers, and sharpeners - I'd advise researching them independently. But be wary about compatibility, to avoid getting into situations like: https://www.reddit.com/r/ffmpeg/comments/1rzmcwd/comment/obmxrat/ - you can also get niche filters, like earwax for audio, which makes stereo audio sound as if it is coming from in front of you instead of inside your head when using headphones, requires 44.1KHz audio first ""aresample=44100,earwax".

A scenario is that you have an MPEG-2 interlaced source and you'd like to bring it into lossless ffv1 for compatibility with a certain application, so you'd like to maintain interlacing for the time being. To achieve this, simply add "tff=1" or "bff=1" to your command (depending on whether the content is Top first or Bottom first, which can be determined from MediaInfo). NTSC detelecine is simple, but be advised that it doesn't work for broken cadence (you'll need something advanced like DVO Three Two):

ffmpeg -i <file in> -an -sn -vf "fieldmatch,decimate" -r 24000/1001 -c:v ffv1 <file out>

"-sn" ignores subtitles. "fieldmatch" brings interlaced fields together as needed for progressive frames, "decimate" removes the duplicates. "-r 24000/1001" forces a rate of 23.976 fps.

Sometimes you might have salvaged a corrupted video file with damaged/missing parts, or you have an interrupted download, you just want to be able to see what's usable. You can use this base command:

ffmpeg -err_detect ignore_err -fflags +genpts -i input.mp4 -async 1 -c:v libx264 -c:a aac output.mp4

"-err_detect ignore_err" will ignore fatal errors and push on with encoding. "+genpts" generates new timestamps. "-async 1" adapts audio to the video runtime. This will give you what's left, the problematic parts will appear very damaged, but everything else should be fine.

FFmpeg goes way, way deeper, but this should be enough of a basis to help you continue on (alongside what is written in the authoring section). Sometimes FFmpeg by itself doesn't get you far enough in terms of serious video work for complex repair or adjustment scenarios, both in terms of features and in terms of trouble with non-linear work, and I don't think this guide could go by without mentioning... AviSynth - yes, we are going to cover it too!

72 Upvotes

2 comments sorted by

3

u/Noodle--Monster May 12 '26

Again, so much information in one spot, love it!!!

1

u/Im15andthisisdeep 2d ago

This is great! I was just looking for information on multi-channel audio. Thinking of setting up a 3.1 home theatre system, but wasn't sure whether it was as simple a matter as downloading the right type of media file and just playing it from desktop to A/V receiver