~/bend-docscommunity

rec.bend checks

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

Frames into the bytes of a file, in one of four 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; FLV pictures, their times and the audio, G.711 included (.flv): flvw.bend.

5 imports
import Base
import ./bytes.bend as B
import ./ts.bend as T
import ./frame.bend as F
import ./flvw.bend as X

Types

type Rec source · line 22 · 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 29 · raw

Data

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

Definitions

def Rec.raw source · line 32 · raw

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

def Rec.ts source · line 35 · raw

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

def Rec.ends source · line 38 · raw

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

def Rec.named source · line 41 · raw

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

def Rec.for source · line 48 · raw

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

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

def Rec.aud source · line 52 · raw

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

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

def Rec.tables source · line 59 · raw

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

def Rec.flv source · line 67 · raw

@p:0x2355f41b6f5561f50104a75ccca27cf7/flvw.Put -> Wrote

def Rec.put source · line 73 · raw

@r:Rec -> @f:0x2355f41b6f5561f50104a75ccca27cf7/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.