bdtools

module
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: Apache-2.0

README

bdtools — Blu-ray tools in pure Go

bdtools is a command-line tool that turns a Blu-ray into a file any player handles. It converts a 3D Blu-ray into a side-by-side MKV. The second eye of a 3D disc is coded as MVC, which Plex and libavcodec cannot decode, so bdtools decodes it and stacks it beside the first. It converts a 2D or Ultra HD Blu-ray into an H.264, HEVC or AV1 MKV and keeps HDR10, HDR10+ and Dolby Vision. Or it makes a remux with only the tracks you want.

bdtools reads .iso images and BDMV folders in place. Nothing is mounted and nothing is extracted. It also reads playlists, .m2ts streams and Matroska remuxes. It picks the feature itself, and when a conversion is interrupted it resumes where it stopped.

Everything between the disc and the encoder is Go, and all of it is in this repository. That means the UDF and Blu-ray structure readers, the transport stream demuxer, four video decoders (H.264 with MVC, HEVC, MPEG-2 and VC-1), a deinterlacer, the Dolby Vision RPU and enhancement-layer processing, and the Matroska muxer. GPUs from NVIDIA, Intel, AMD and Apple are driven in process through their own system libraries, without cgo. With a GPU, a conversion runs no other program at all. Without one, x264, x265 or SVT-AV1 does the encoding.

bdtools --check                                              # what is installed
bdtools --list --input "Avatar (2009) 3D.iso"                # what the disc holds
bdtools --input "Avatar (2009) 3D.iso" --output "Avatar (2009) 3D FSBS.mkv" \
        --codec h265 --audio-lang eng --audio-best --subs-lang eng
bdtools --input "Dune (2021) UHD.iso" --output "Dune (2021).mkv" --codec h265   # HDR10/DV kept
bdtools --remux --input "Dune (2021) UHD.iso" --output "Dune (2021).mkv"       # no re-encode
bdtools --input "Furiosa (2024).mkv" --output "Furiosa (2024) 3D.iso" --to-3d    # a Blu-ray 3D made

There is more in the cookbook, which gives a complete command for each common operation, and in bdtools' common tasks. The grading manual explains how to grade a 2D-to-3D conversion by eye, on the web page or in a headset. Both manuals are also web pages with the pictures, in docs/manual. They are carried in the binary and in every release, and bdtools --manual :8080 serves them.

These are the decoders. Each one is checked against the conformance streams of its standard.

Decoder Package What it decodes Checked against Speed (Core Ultra 9 285K)
H.264 / MVC mvc Baseline, Main and High; Stereo High and Multiview High with two views; progressive pictures the JVT conformance streams, and a whole 3D Blu-ray byte for byte against edge264 ~1100 stereo pairs/s, 113 on one core
HEVC internal/hevc Main and Main 10, which is everything Ultra HD Blu-ray uses all 152 JCT-VC conformance streams of those profiles, byte for byte against ffmpeg ~250 fps for a disc's 4K stream
MPEG-2 internal/mpeg2 Main Profile, frame and field pictures the ISO conformance streams, within the transform's tolerance of ffmpeg, 64 dB and up ~30 fps for 1080i
VC-1 internal/vc1 Advanced Profile, progressive and interlaced the SMPTE conformance streams, and a VC-1 Blu-ray byte for byte against ffmpeg ~110 fps for 1080p on one core

The HEVC, MPEG-2 and H.264 parsers also drive VAAPI, which Intel and AMD GPUs use on Linux, because VAAPI has no parser of its own. NVDEC and VideoToolbox decode on their own. See what works where.

The H.264/MVC decoder can be used on its own as a library, as shown below. mvcdec decodes a stream to raw YUV or Y4M. probe identifies a disc image, an MKV or an MP4 from a pre-download sample.

Build

go build ./cmd/mvcdec ./cmd/bdtools

On amd64 the hot paths are hand-written Go assembly. The files are *_amd64.s, the Go toolchain assembles them, and no cgo is involved. The assembly covers the CABAC residual, motion vector difference and coded block pattern decoders, motion compensation (6-tap luma, bilinear chroma, averaging and weighted prediction), the inverse transforms, the deblocking filters and the reset of each macroblock's grids. It is used when the CPU has AVX2, BMI2 and LZCNT, which is checked with CPUID at startup. Other CPUs and other architectures use the equivalent Go code. You can force the Go code on any CPU with -tags purego. Every assembly routine has a randomized test against its Go counterpart, in TestCabac*Asm and TestSIMD*.

Releases are built with CGO_ENABLED=0 for Linux, macOS and Windows, on amd64, arm64 and arm/v7. See .goreleaser.yml.

The H.264/MVC decoder as a library

import (
	"github.com/brunoga/bdtools/m2ts"
	"github.com/brunoga/bdtools/mvc"
)

dec := mvc.NewDecoder(mvc.Options{})       // Threads: 0 = all CPUs
dm := m2ts.NewDemuxer(file)                 // Blu-ray .m2ts / .ssif
for {
	au, err := dm.Next()
	if err != nil { break }
	dec.DecodeAU(au.Base, au.PTS)           // base view (AVC)
	dec.DecodeAU(au.Dep, au.PTS)            // dependent view (MVC)
	dm.Recycle(&au)
	for {
		sf, ok := dec.NextFrame()       // display order
		if !ok { break }
		left, right := sf.Base, sf.Dependent // *mvc.Frame (right nil for 2D)
		_ = left.Y; _ = left.Cb; _ = left.Cr // cropped 4:2:0 planes + strides
		_ = left.Image()                // zero-copy *image.YCbCr
		sf.Release()                    // give the buffers back
	}
}
dec.Flush()                                 // then drain NextFrame again

You can also let the decoder drive the loop over a whole stream and write the result out as Y4M. The stream can be a transport stream, an interleaved Annex B stream, or the demuxed pair that tsMuxeR writes:

dec := mvc.NewDecoder(mvc.Options{})
y4m := mvc.NewY4MWriter(w, mvc.LayoutSideBySide)
src := mvc.Source{Format: mvc.FormatSplit, R: baseFile, Dependent: depFile}
stats, err := dec.DecodeStream(src, mvc.DecodeOptions{}, func(sf *mvc.StereoFrame) error {
	if stats.Frames == 0 {              // the SPS has been seen by now
		y4m.FPSNum, y4m.FPSDen = dec.FrameRate()
	}
	return y4m.Write(sf)
})
err = y4m.Flush()

There are other ways to feed the decoder:

  • dec.Decode(chunk) accepts an Annex B byte stream split at arbitrary boundaries. The MVC NAL units are interleaved in it, as they are in the JVT conformance streams.
  • mvc.NewAUReader(r) splits an Annex B stream into access units. Use two of them to pair a base .264 with a separate dependent .mvc stream, which are the files tsMuxeR writes.
  • dec.DecodeNAL(nal) decodes one NAL unit without its start code.

Frames come back in display order once they are fully decoded. NextFrame never blocks. WaitFrame blocks until the next frame is ready. A frame's planes stay valid until you call Release. A buffer that is not released is not reused, and the decoder allocates a new one instead, so release frames promptly or copy them. A Decoder must be used from one goroutine. Internally, the decoding work is spread over Options.Threads worker goroutines.

mvcdec

mvcdec [flags] movie.m2ts            # Blu-ray transport stream
mvcdec [flags] stream.264            # interleaved Annex B stream
mvcdec [flags] base.264 dep.mvc      # separate view streams (tsMuxeR)

# full side-by-side Y4M into x264
mvcdec -y4m - -layout sbs movie.m2ts | x264 --demuxer y4m --frame-packing 3 -o sbs.264 -

# raw planes of each view
mvcdec -base left.yuv -dep right.yuv movie.m2ts

-layout is one of sbs, tab, base or dep. Side by side makes a 3840x1080 picture from a 1080p stream. -swap exchanges the views. The Y4M frame rate comes from the stream's VUI timing, and -fps num:den overrides it.

bdtools

bdtools --check                                   # which external tools are installed
bdtools --input "Life of Pi (2012).iso" --output "Life of Pi (2012) 3D.mkv"
bdtools --input "Dune (2021) UHD.iso" --output "Dune (2021).mkv" --codec h265
bdtools --remux --input disc.iso --output film.m2ts --audio-lang eng --audio-best

bdtools converts a Blu-ray into an MKV with the audio and subtitles you choose. The source can be a disc image, a BDMV folder, a playlist or an m2ts, or a Matroska remux of one. A 3D disc comes out side by side, at full or half width, with the subtitles flat or drawn in 3D. A 2D or Ultra HD disc comes out as it is, in H.264, HEVC or AV1 at 8 or 10 bits. HDR10, HDR10+ and Dolby Vision are kept. Dolby Vision can be written as profile 8.1, with its full enhancement layer composed in, or as profile 7, with the layers kept apart. bdtools can also remux, with no re-encoding. A 3D disc's MVC goes into one .m2ts. A 2D or Ultra HD disc, Dolby Vision included, or an MKV goes into an MKV.

The disc is read once and in place. An image is not extracted, and nothing is demuxed to disk except the audio and subtitles. Decoding and muxing happen in process. A GPU decodes and encodes in process as well, through its own system library, so with a GPU the conversion needs no external tools at all. Without one, the only external tool is x264, x265 or SvtAv1EncApp. ffmpeg takes over for software half-SBS, and for an interlaced H.264 feature that the decoder here does not handle, which is rare. A remux needs no tools. A container with the whole toolchain is published as ghcr.io/brunoga/bdtools for amd64 and arm64. See cmd/bdtools, which starts with examples of common tasks.

Probing a source before downloading it

probe identifies a Blu-ray image, a Matroska file, or an MP4 or QuickTime file from the little that a pre-download sample holds. For a torrent, that is a piece or two. It reports what the container states: whether the film is 2D or 3D, and if 3D, how it is laid out (MVC, MV-HEVC, side by side or top-bottom), the feature's length, and its video, audio and subtitle tracks. It reads no video and pulls in nothing of the decoder.

r, err := probe.Image(sample, imageSize, name) // an io.ReaderAt over the pieces you have
var missing *probe.MissingDataError
if errors.As(err, &missing) {
	// fetch the piece holding missing.Offset, then try again
}
if r.Is3D && r.Layout == probe.LayoutMVC { /* a Blu-ray 3D */ }

r, err = probe.Matroska(prefix, name) // the first 32 KiB or so of an MKV

r, err = probe.MP4(sample, fileSize, name) // an io.ReaderAt: the movie box is at the start or the end
if r.Is3D && r.Layout == probe.LayoutMVHEVC { /* Apple spatial video */ }

A disc image keeps its UDF directory at the front and its playlists and clip info at the end, so the first and last pieces of a torrent are usually enough. On ten Blu-ray 3D images, two 16 MiB pieces were enough for all but one. That disc had 316 playlists and needed a third piece, and the error said which bytes were missing. When the sample cannot satisfy a read, the result is an error that names the missing bytes. It is never a panic, and never a plausible wrong answer. Fields the source does not state are left zero. For example, a disc's "multi-channel" audio has no channel count until the probe can read the stream's first frames, which it does when the sample holds them.

H.264/MVC decoder performance

Measured on an Intel Core Ultra 9 285K (24 cores), Go 1.27.1:

stream single thread all cores
3D Blu-ray, 1080p24 MVC, ~28 Mbit/s (stereo pairs/s) 113 ~1100
x264 1080p, 25 Mbit/s, B-pyramid, weighted pred, deblocking (frames/s) 119 ~1000
x264 1080p, crf 35 (1.5 Mbit/s, mostly skipped macroblocks) (frames/s) 745

For comparison, edge264, which is C with SSE/AVX2 intrinsics, decodes the same clips at 126 stereo pairs/s, 127 frames/s and ~880 frames/s on one core. Here the CABAC residual decoding, motion compensation, intra prediction and deblocking are all assembly, with pure-Go fallbacks under -tags purego. The remaining difference is the Go code between those routines, the glue that walks the macroblocks and calls them.

These numbers decode from memory, one access unit at a time, with go test -bench File. mvcdec with file I/O is somewhat slower. Real time for a 3D Blu-ray is 24 stereo pairs/s, so a single core is over 3x real time.

H.264/MVC decoder features

The decoder supports the following:

  • The Baseline, Main, High, Stereo High and Multiview High profiles. Baseline is supported without FMO and ASO. Multiview High is supported with two views.
  • CAVLC and CABAC, I, P and B slices, the 8x8 transform, scaling matrices, explicit and implicit weighted prediction, spatial and temporal direct prediction, long-term references and all MMCO operations, frame_num gaps, multiple slices, POC types 0, 1 and 2, and reference list modification including inter-view references. Output is bumped and reordered through the VUI's num_reorder_frames.
  • For MVC, prefix NAL units (type 14), the subset SPS (15), coded slice extensions (20) and the Blu-ray dependent view delimiters (24). The dependent view's NAL units may arrive before their base view, and the dependent view may start late in the stream.

Interlaced coding is decoded too, both field pictures (PAFF) and MBAFF frames, which is what 1080i 2D discs use. The decoder passes 79 of the 80 interlaced JVT conformance streams. The one left is CAMACI3, constrained intra prediction in MBAFF, and a feature the decoder does not handle goes to NVDEC, VideoToolbox or ffmpeg instead. Some things are not supported, because Blu-ray does not use them: 4:2:2 and 4:4:4 chroma, bit depths above 8, FMO and ASO, SP and SI slices, and more than two views.

The decoder can also work with an accelerator, set with Decoder.SetAccel. It then parses a 2D progressive stream, keeps track of its reference pictures and output order, and hands each picture's slices to the GPU. This is how bdtools decodes H.264 on VAAPI.

Malformed input never panics. Errors are returned, and lost macroblocks are concealed from the previous reference picture. Decoding is fuzzed with go test -fuzz FuzzDecode.

Testing

go test -race ./...                            # assembly kernels vs Go, conformance, bdtools
go test -tags purego ./...                     # the pure-Go decoder every other platform runs
MVC_BENCH_FILE=clip.264 go test -bench File -run X

testdata/bluray is a synthetic Blu-ray 3D, as both a folder and a UDF image. The built-in demuxer is tested on it with no tools installed. The bdtools end-to-end tests convert it through x264, and also convert a Matroska remux built from the MVC fixtures. They skip when x264 is not on PATH.

testdata/conformance holds the ITU-T/JVT conformance bitstreams, with per-view output hashes taken from edge264-mvc. tools/refdump is a small C program that dumps both views with edge264. It is the reference for real Blu-ray content, where no other decoder outputs the dependent view.

The other decoders' conformance suites are large and are not committed. Point the tests at them with these variables. They skip when the suites are missing, and they compare against ffmpeg, so ffmpeg must be installed:

BDTOOLS_HEVC_SAMPLES=~/hevc-conformance go test -run Conformance ./internal/hevc   # JCT-VC *.bit
BDTOOLS_MPEG2_SAMPLES=~/fate/mpeg2 go test -run Conformance ./internal/mpeg2        # FATE's mpeg2/
BDTOOLS_VC1_SAMPLES=~/fate/vc1 go test -run Conformance ./internal/vc1              # FATE's vc1/
BDTOOLS_HEVC_BENCH=uhd.hevc go test -bench Decode -run X ./internal/hevc

The GPU tests run on whatever the machine has and skip what it lacks. On Linux, the VAAPI tests are pointed at a driver with libva's own environment variables. This example uses Intel's driver from a Flatpak runtime:

D=/var/lib/flatpak/runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/25.08/active/files
LIBVA_DRIVERS_PATH=$D LIBVA_DRIVER_NAME=iHD LD_LIBRARY_PATH=$D/lib \
  BDTOOLS_HEVC_SAMPLES=~/hevc-conformance BDTOOLS_MPEG2_SAMPLES=~/fate/mpeg2 \
  go test -run 'VAAPI|GPUDecoders' ./internal/gpu

The GPU libraries' structures are mirrored in Go and checked against their C headers. Variables such as MVC_LIBVA_HEADERS and MVC_NVENC_HEADERS say where the headers are. testdata/vaoff.c generates vaapi_layout.go.

Layout

file contents
mvc/decoder.go the public API, NAL dispatch, picture and access unit management, and the workers
mvc/params.go, mvc/slice.go the SPS, subset SPS and PPS, and the slice headers
mvc/dpb.go POC, reference marking, reference lists and MVC inter-view references
mvc/cabac*.go, cavlc.go, mb*.go, recon.go entropy decoding and the macroblock layer
mvc/mvpred.go, inter.go, intra.go, transform.go, deblock.go prediction and reconstruction
mvc/*_amd64.s, *_amd64.go the assembly kernels and their dispatch. *_noasm.go and *_generic.go are the Go fallbacks
mvc/aureader.go, m2ts/ access unit splitting, and transport stream reading (PES and program tables)
mvc/stream.go, y4m.go the whole-stream decoding loop, and Y4M output
cmd/mvcdec, cmd/bdtools the commands
tools/pgskodi, tools/felrd, tools/qcmp, tools/refdump pgskodi splits wide PGS subtitles for Kodi in films converted before bdtools did it. felrd measures Dolby Vision FEL encodes against the source's composition. qcmp measures any encode against its source in PSNR, VMAF and CAMBI banding, Dolby Vision FEL and 3D sources included. refdump is the edge264 reference dumper
internal/convert the Blu-ray 3D conversion pipeline behind bdtools. It holds the built-in demuxer and remuxer, resumable segmented encoding, and the 3D subtitles
internal/hevc, internal/mpeg2, internal/vc1, internal/deint the HEVC, MPEG-2 and VC-1 decoders in Go, whose parsers also drive VAAPI, and a deinterlacer. They are for 2D sources
internal/dovi, internal/hdr Dolby Vision, that is RPU parsing and rewriting from profile 7 to 8.1, and enhancement-layer composition. Also HDR10 and HDR10+ metadata
internal/gpu the GPU encoders and decoders, driven in process through their system libraries. NVENC and NVDEC, VAAPI, VideoToolbox and Media Foundation
internal/bdmv the Blu-ray structure. Playlists, clip info, and folders and UDF images read in place
internal/esinfo audio and video stream headers, for the track listings
internal/mkv the Matroska muxer. It takes H.264 and HEVC frame timing from picture order counts, and frames AV1 temporal units, audio and PGS. Also a streaming Matroska reader
probe identifies a disc image, a Matroska file, or an MP4 or QuickTime file from a pre-download sample

Directories

Path Synopsis
cmd
bdtools command
Command bdtools converts a frame-packed Blu-ray 3D source (MVC) into a side-by-side MKV that an ordinary decoder can play.
Command bdtools converts a frame-packed Blu-ray 3D source (MVC) into a side-by-side MKV that an ordinary decoder can play.
hevcenc command
Command hevcenc codes raw 4:2:0 video with the HEVC encoder in this module, for its development: planar 8-bit or 10-bit little endian samples in, an Annex B stream out.
Command hevcenc codes raw 4:2:0 video with the HEVC encoder in this module, for its development: planar 8-bit or 10-bit little endian samples in, an Annex B stream out.
mvcdec command
Command mvcdec decodes H.264/MVC stereo video into raw YUV or Y4M.
Command mvcdec decodes H.264/MVC stereo video into raw YUV or Y4M.
mvcenc command
Command mvcenc adds a dependent view to an H.264 base view stream, writing an H.264 MVC (Stereo High) stream.
Command mvcenc adds a dependent view to an H.264 base view stream, writing an H.264 MVC (Stereo High) stream.
docs
manual
Package manual is bdtools' manual as web pages: the documents in docs/ (grading.md, cookbook.md) made HTML by Build, with a stylesheet and the pictures beside them.
Package manual is bdtools' manual as web pages: the documents in docs/ (grading.md, cookbook.md) made HTML by Build, with a stylesheet and the pictures beside them.
manual/gen command
Command gen writes the manual's generated pages beside it (go generate in docs/manual): the documents in docs/ made HTML by manual.Build.
Command gen writes the manual's generated pages beside it (go generate in docs/manual): the documents in docs/ made HTML by manual.Build.
internal
aac
Package aac encodes AAC-LC (ISO/IEC 14496-3): PCM in, ADTS frames out, mono to 5.1 at 44.1 or 48 kHz.
Package aac encodes AAC-LC (ISO/IEC 14496-3): PCM in, ADTS frames out, mono to 5.1 at 44.1 or 48 kHz.
ac3
Package ac3 encodes AC-3 (Dolby Digital, ATSC A/52): PCM in, frames any AC-3 decoder plays out.
Package ac3 encodes AC-3 (Dolby Digital, ATSC A/52): PCM in, frames any AC-3 decoder plays out.
av1
Package av1 is an AV1 encoder: 4:2:0 pictures of 8 or 10 bits coded as an AV1 stream (OBUs, the low overhead format), each picture's reconstruction exactly a decoder's.
Package av1 is an AV1 encoder: 4:2:0 pictures of 8 or 10 bits coded as an AV1 stream (OBUs, the low overhead format), each picture's reconstruction exactly a decoder's.
bdmv
Package bdmv reads the structure of a Blu-ray disc: the playlists that make up its titles, and the stream files they refer to, from a BDMV directory or directly out of a UDF disc image.
Package bdmv reads the structure of a Blu-ray disc: the playlists that make up its titles, and the stream files they refer to, from a BDMV directory or directly out of a UDF disc image.
convert
Package convert drives the conversion of a frame-packed Blu-ray 3D source (MVC) into a side-by-side MKV that an ordinary decoder can play.
Package convert drives the conversion of a frame-packed Blu-ray 3D source (MVC) into a side-by-side MKV that an ordinary decoder can play.
cuda
Package cuda runs compute kernels on an NVIDIA GPU through the CUDA driver API, loaded at run time (no cgo, no CUDA toolkit: the driver compiles the kernels' PTX for the GPU it has).
Package cuda runs compute kernels on an NVIDIA GPU through the CUDA driver API, loaded at run time (no cgo, no CUDA toolkit: the driver compiles the kernels' PTX for the GPU it has).
deint
Package deint deinterlaces 8-bit 4:2:0 pictures, one frame out for each frame in (the field shown first kept, the other interpolated), as NVDEC's adaptive deinterlacer and ffmpeg's bwdif do for the other decoders here.
Package deint deinterlaces 8-bit 4:2:0 pictures, one frame out for each frame in (the field shown first kept, the other interpolated), as NVDEC's adaptive deinterlacer and ffmpeg's bwdif do for the other decoders here.
depth
Package depth estimates a video's depth, frame by frame: Video Depth Anything (Chen et al., CVPR 2025), its streaming form, from the published checkpoint as it is.
Package depth estimates a video's depth, frame by frame: Video Depth Anything (Chen et al., CVPR 2025), its streaming form, from the published checkpoint as it is.
dovi
Package dovi handles Dolby Vision's carriage: the configuration record a container gives a Dolby Vision track (dvcC or dvvC), and the single-track form of a dual-layer stream.
Package dovi handles Dolby Vision's carriage: the configuration record a container gives a Dolby Vision track (dvcC or dvvC), and the single-track form of a dual-layer stream.
dts
Package dts decodes DTS Coherent Acoustics core audio (ETSI TS 102 114): the core of a DTS or DTS-HD stream (its extension substreams left aside), up to 5.1 at 48 kHz, in fixed point, as the reference decoder does it.
Package dts decodes DTS Coherent Acoustics core audio (ETSI TS 102 114): the core of a DTS or DTS-HD stream (its extension substreams left aside), up to 5.1 at 48 kHz, in fixed point, as the reference decoder does it.
esinfo
Package esinfo reads the headers of the elementary streams a Blu-ray carries — enough to describe a track the way a listing does: codec flavour, channels, sample rate, bitrate, picture size and frame rate.
Package esinfo reads the headers of the elementary streams a Blu-ray carries — enough to describe a track the way a listing does: codec flavour, channels, sample rate, bitrate, picture size and frame rate.
gpu
Package gpu drives GPU video encoders and decoders through their system libraries — NVENC and NVDEC (NVIDIA's driver), VAAPI (Mesa, Intel's media driver), VideoToolbox (macOS) and Media Foundation (Windows) — loaded at run time, so bdtools needs neither cgo nor ffmpeg for hardware video.
Package gpu drives GPU video encoders and decoders through their system libraries — NVENC and NVDEC (NVIDIA's driver), VAAPI (Mesa, Intel's media driver), VideoToolbox (macOS) and Media Foundation (Windows) — loaded at run time, so bdtools needs neither cgo nor ffmpeg for hardware video.
hdr
Package hdr reads and writes the metadata HDR10 and HDR10+ video carries beside its pictures: the mastering display colour volume and content light level (static, SMPTE ST 2086 and CTA-861.3), and HDR10+'s dynamic metadata (SMPTE ST 2094-40, as an ITU-T T.35 message).
Package hdr reads and writes the metadata HDR10 and HDR10+ video carries beside its pictures: the mastering display colour volume and content light level (static, SMPTE ST 2086 and CTA-861.3), and HDR10+'s dynamic metadata (SMPTE ST 2094-40, as an ITU-T T.35 message).
hevc
Package hevc decodes H.265/HEVC Main and Main 10 video in Go (4:2:0, 8 and 10 bits, every tool of those profiles): a fallback where no GPU decodes an Ultra HD Blu-ray's HEVC.
Package hevc decodes H.265/HEVC Main and Main 10 video in Go (4:2:0, 8 and 10 bits, every tool of those profiles): a fallback where no GPU decodes an Ultra HD Blu-ray's HEVC.
mkv
Package mkv writes Matroska files: the muxer behind bdtools' default output, taking an encoder's raw H.264 or HEVC stream and the audio and subtitle tracks a Blu-ray demux produces.
Package mkv writes Matroska files: the muxer behind bdtools' default output, taking an encoder's raw H.264 or HEVC stream and the audio and subtitle tracks a Blu-ray demux produces.
mp4
Package mp4 writes ISO base media files (MP4, QuickTime): a video track of HEVC or MV-HEVC with Apple's stereo signalling, and audio tracks of AC-3 or E-AC-3, from the same sources the Matroska muxer takes.
Package mp4 writes ISO base media files (MP4, QuickTime): a video track of HEVC or MV-HEVC with Apple's stereo signalling, and audio tracks of AC-3 or E-AC-3, from the same sources the Matroska muxer takes.
mpeg2
Package mpeg2 decodes MPEG-2 video (ISO/IEC 13818-2, Main Profile: 4:2:0, frame and field pictures, every prediction mode) in Go: a fallback where no GPU decodes a Blu-ray's or DVD's MPEG-2.
Package mpeg2 decodes MPEG-2 video (ISO/IEC 13818-2, Main Profile: 4:2:0, frame and field pictures, every prediction mode) in Go: a fallback where no GPU decodes a Blu-ray's or DVD's MPEG-2.
nn
Package nn runs neural networks published as PyTorch checkpoints: their weights read from the .pth file as it is, and the layers they are made of (linear, convolutions, attention, normalisations, resizing) on float32 tensors, laid out as PyTorch lays them out (row major, the last dimension fastest).
Package nn runs neural networks published as PyTorch checkpoints: their weights read from the .pth file as it is, and the layers they are made of (linear, convolutions, attention, normalisations, resizing) on float32 tensors, laid out as PyTorch lays them out (row major, the last dimension fastest).
ocr
Package ocr reads the text of subtitle pictures (a Blu-ray's PGS): a line of text at a time, by a small network trained here (a CRNN: convolutions over the line's picture, a bidirectional LSTM over its columns, CTC to the characters), its weights embedded.
Package ocr reads the text of subtitle pictures (a Blu-ray's PGS): a line of text at a time, by a small network trained here (a CRNN: convolutions over the line's picture, a bidirectional LSTM over its columns, CTC to the characters), its weights embedded.
pgs
Package pgs reads Blu-ray subtitles (Presentation Graphic Streams): their display sets made into the pictures they show, and when.
Package pgs reads Blu-ray subtitles (Presentation Graphic Streams): their display sets made into the pictures they show, and when.
stereo
Package stereo makes a stereo pair of a 2D picture and its disparity: each eye is the picture shifted by half the disparity, rendered row by row so that what is nearer covers what is behind it, and what an eye sees that the picture does not (behind a nearer thing's edge) filled from the farther side.
Package stereo makes a stereo pair of a 2D picture and its disparity: each eye is the picture shifted by half the disparity, rendered row by row so that what is nearer covers what is behind it, and what an eye sees that the picture does not (behind a nearer thing's edge) filled from the farther side.
udf
Package udf writes UDF 2.50 file system images, a Blu-ray disc's: read-only, its files' entries and directories in a metadata partition (with its mirror), their contents in the physical partition laid out in an order the caller chooses, so that one file (a 3D film's SSIF) can be made of pieces of others, interleaved.
Package udf writes UDF 2.50 file system images, a Blu-ray disc's: read-only, its files' entries and directories in a metadata partition (with its mirror), their contents in the physical partition laid out in an order the caller chooses, so that one file (a 3D film's SSIF) can be made of pieces of others, interleaved.
vc1
Package vc1 decodes SMPTE 421M (VC-1) Advanced Profile video in Go: progressive, interlaced frame and interlaced field pictures, 4:2:0 8-bit, as Blu-ray and HD DVD carry it.
Package vc1 decodes SMPTE 421M (VC-1) Advanced Profile video in Go: progressive, interlaced frame and interlaced field pictures, 4:2:0 8-bit, as Blu-ray and HD DVD carry it.
version
Package version resolves the version string a binary reports.
Package version resolves the version string a binary reports.
vmaf
Package vmaf measures a distorted video against its reference as Netflix's VMAF does: libvmaf's integer feature extractors (VIF at four scales, ADM, motion) ported to Go, and its v0.6.1 models (the 1080p one, and the 4K one for pictures above 1080 lines).
Package vmaf measures a distorted video against its reference as Netflix's VMAF does: libvmaf's integer feature extractors (VIF at four scales, ADM, motion) ported to Go, and its v0.6.1 models (the 1080p one, and the 4K one for pictures above 1080 lines).
Package m2ts demultiplexes the video elementary streams of an MPEG-2 transport stream (including Blu-ray .m2ts with 192-byte packets) and pairs the base view (AVC) and dependent view (MVC) access units.
Package m2ts demultiplexes the video elementary streams of an MPEG-2 transport stream (including Blu-ray .m2ts with 192-byte packets) and pairs the base view (AVC) and dependent view (MVC) access units.
Package mvc implements an H.264/AVC decoder with Multiview Video Coding (MVC, Annex H) support for stereo streams such as 3D Blu-ray, producing both the base view and the dependent view for each access unit.
Package mvc implements an H.264/AVC decoder with Multiview Video Coding (MVC, Annex H) support for stereo streams such as 3D Blu-ray, producing both the base view and the dependent view for each access unit.
Package probe identifies a video source from the little of it that a pre-download sample contains: a disc image's BDMV metadata, a Matroska file's header, an MP4 or QuickTime file's movie box, or a bare transport stream's program tables.
Package probe identifies a video source from the little of it that a pre-download sample contains: a disc image's BDMV metadata, a Matroska file's header, an MP4 or QuickTime file's movie box, or a bare transport stream's program tables.
tools
av1bench command
Command av1bench measures the AV1 encoder (internal/av1) against SVT-AV1 (through ffmpeg's libsvtav1): each clip coded at a few quantizers by each configuration, decoded by libdav1d (ffmpeg), its size, speed and quality (PSNR of each plane, SSIM, VMAF, by internal/vmaf) recorded, and the configurations compared by their BD-rates against an anchor's, per metric, with their speeds.
Command av1bench measures the AV1 encoder (internal/av1) against SVT-AV1 (through ffmpeg's libsvtav1): each clip coded at a few quantizers by each configuration, decoded by libdav1d (ffmpeg), its size, speed and quality (PSNR of each plane, SSIM, VMAF, by internal/vmaf) recorded, and the configurations compared by their BD-rates against an anchor's, per metric, with their speeds.
av1lfasm command
Command av1lfasm writes the AV1 encoder's loop filter kernel (internal/av1/lf_amd64.s): the sample filtering process (spec 7.14.6) for the four lines of an edge segment at once, a line a 32-bit lane.
Command av1lfasm writes the AV1 encoder's loop filter kernel (internal/av1/lf_amd64.s): the sample filtering process (spec 7.14.6) for the four lines of an edge segment at once, a line a 32-bit lane.
av1tables command
Command av1tables turns the AV1 specification's constants, enumerations and constant lookup tables into Go source for package av1:
Command av1tables turns the AV1 specification's constants, enumerations and constant lookup tables into Go source for package av1:
av1txasm command
Command av1txasm turns the AV1 encoder's 1D forward transforms (internal/av1/transform_fwd.go) and the inverse ones (transform_bf.go) into AVX2 kernels that run eight of them at once, one per 32-bit lane:
Command av1txasm turns the AV1 encoder's 1D forward transforms (internal/av1/transform_fwd.go) and the inverse ones (transform_bf.go) into AVX2 kernels that run eight of them at once, one per 32-bit lane:
depthtrain command
Command depthtrain learns the depth refinement (internal/stereo's RefineWeights) from 3D discs' pairs: stereobench -samples files, each a picture's left eye, the depth network's depth of it and the disc's disparity, all at half size.
Command depthtrain learns the depth refinement (internal/stereo's RefineWeights) from 3D discs' pairs: stereobench -samples files, each a picture's left eye, the depth network's depth of it and the disc's disparity, all at half size.
felrd command
Command felrd measures how near encodes of a Dolby Vision profile 7 FEL source come to the picture the source's layers compose to:
Command felrd measures how near encodes of a Dolby Vision profile 7 FEL source come to the picture the source's layers compose to:
gradefit command
Command gradefit learns how 3D discs grade depth: from stereobench -frames CSVs (a picture's features, and the disc's disparity fitted by the network's depth: disparity = a depth + b), a ridge regression of a and b on the features.
Command gradefit learns how 3D discs grade depth: from stereobench -frames CSVs (a picture's features, and the disc's disparity fitted by the network's depth: disparity = a depth + b), a ridge regression of a and b on the features.
inpainttrain command
Command inpainttrain learns the hole filler (internal/stereo's InpaintWeights) from crops tools/stereobench -holes records: a rendered eye, the mask of its holes and the disc's own eye.
Command inpainttrain learns the hole filler (internal/stereo's InpaintWeights) from crops tools/stereobench -holes records: a rendered eye, the mask of its holes and the disc's own eye.
pgskodi command
Command pgskodi rewrites a PGS subtitle file (.sup) so that Kodi draws its wide subtitles whole in a side-by-side 3D film: each object wider than half the plane becomes two side by side.
Command pgskodi rewrites a PGS subtitle file (.sup) so that Kodi draws its wide subtitles whole in a side-by-side 3D film: each object wider than half the plane becomes two side by side.
qcmp command
Command qcmp measures encodes against their source, picture by picture:
Command qcmp measures encodes against their source, picture by picture:
shapeprobe command
shapeprobe: how much of the disc's disparity mapping (scale and offset of our depth, stereo.Shape) is a film's, a shot's, and predictable from the picture.
shapeprobe: how much of the disc's disparity mapping (scale and offset of our depth, stereo.Shape) is a film's, a shot's, and predictable from the picture.
stereobench command
Command stereobench measures the 2D to 3D conversion against native 3D:
Command stereobench measures the 2D to 3D conversion against native 3D:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL