rec.bend checks
raw source on the hub · import 0xfbc4773809086afacef84e7fba6d620c/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.
Raw@sets:List<&2, U32> -> Rec
SndRec
Ts@h265:Bool -> @audio:Bool -> @vcc:U32 -> @acc:U32 -> @tcc:U32 -> @n:U32 -> @sets:List<&2, U32> -> Rec
type Wrote source · line 25 · raw
Data
What a frame gave: bytes to write, and the state after.
Wrote@bytes:List<&2, U32> -> @r:Rec -> Wrote
Definitions
def Rec.raw source · line 28 · raw
@i:0xfbc4773809086afacef84e7fba6d620c/frame.Info -> Rec
def Rec.ts source · line 31 · raw
@+i:0xfbc4773809086afacef84e7fba6d620c/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:0xfbc4773809086afacef84e7fba6d620c/frame.Info -> Rec
def Rec.for source · line 43 · raw
@path:String -> @i:0xfbc4773809086afacef84e7fba6d620c/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:0xfbc4773809086afacef84e7fba6d620c/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.