~/bend-docscommunity

rec.bend checks

raw source on the hub · import 0xd6fc55bf65b187fec4175f80d08c165a/rec.bend as Rec

Frames into the bytes of a file, in one of three forms:

raw the video's access units one after the other, the announced parameter sets first (.h264, .h265): what a decoder reads, with no times and no audio; TS MPEG-TS: each picture and each run of AAC frames in a PES packet with its time (.ts). G.711 has no place in a TS and is left out. sound the audio alone, as it comes: AAC with its ADTS headers is an .aac file, G.711 samples an .alaw or .ulaw one.

4 imports
import Base
import ./bytes.bend as B
import ./ts.bend as T
import ./frame.bend as F

Types

type Rec source · line 19 · raw

Data

sets: the parameter sets still to go in front of the first picture. vcc, acc, tcc: the packet counters of the video, the audio and the tables. n: pictures written.

type Wrote source · line 25 · raw

Data

What a frame gave: bytes to write, and the state after.

Definitions

def Rec.raw source · line 28 · raw

@i:0xd6fc55bf65b187fec4175f80d08c165a/frame.Info -> Rec

def Rec.ts source · line 31 · raw

@+i:0xd6fc55bf65b187fec4175f80d08c165a/frame.Info -> Rec

def Rec.ends source · line 34 · raw

@+path:String -> @a:String -> @b:String -> @c:String -> Bool

def Rec.named source · line 37 · raw

@+path:String -> @+i:0xd6fc55bf65b187fec4175f80d08c165a/frame.Info -> Rec

def Rec.for source · line 43 · raw

@path:String -> @i:0xd6fc55bf65b187fec4175f80d08c165a/frame.Info -> Rec

The form a file's name asks for: TS for .ts, the audio alone for .aac, .alaw and .ulaw, the raw video for the rest.

def Rec.aud source · line 47 · raw

@h265:Bool -> List<&2, U32>

The access unit delimiter that opens each access unit in a TS.

def Rec.tables source · line 54 · raw

@yes:Bool -> @+tcc:U32 -> @h265:Bool -> @audio:Bool -> List<&2, U32>

def Rec.put source · line 64 · raw

@r:Rec -> @f:0xd6fc55bf65b187fec4175f80d08c165a/frame.Frame -> Wrote

A frame into the file. In a TS: the tables again every 30 pictures, and everything 0.7 s after the clock the video carries.