Documentation
¶
Index ¶
- Constants
- func DurationSeconds(ctx context.Context, locator Locator, path string) (float64, error)
- func EncodeFromPNGDir(ctx context.Context, cfg EncodeConfig) error
- func ExtractSegment(ctx context.Context, locator Locator, src, dst string, fromSec, toSec float64, ...) error
- func FileSizeMB(path string) (float64, error)
- func GetVideoInfo(ctx context.Context, locator Locator, videoPath string) (map[string]any, error)
- func ImageDir(videoKey string, episode int, root string) string
- func ResolveEncoderThreads() int
- func SafeConcat(ctx context.Context, locator Locator, inputs []string, output string, ...) error
- type Config
- type EncodeConfig
- type H264RemuxEncoder
- type Locator
- type RawRGBEncoder
- type VideoFrameRGB24
Constants ¶
const DefaultCRF = 25
Variables ¶
This section is empty.
Functions ¶
func DurationSeconds ¶
func EncodeFromPNGDir ¶
func EncodeFromPNGDir(ctx context.Context, cfg EncodeConfig) error
func ExtractSegment ¶
func ExtractSegment(ctx context.Context, locator Locator, src, dst string, fromSec, toSec float64, overwrite bool) error
ExtractSegment copies a time range from src into dst using ffmpeg.
func FileSizeMB ¶
func GetVideoInfo ¶
GetVideoInfo mirrors lerobot.datasets.video_utils.get_video_info (v0.5.1).
func ResolveEncoderThreads ¶ added in v1.1.0
func ResolveEncoderThreads() int
ResolveEncoderThreads reads LEROBOT_ENCODER_THREADS (0 when unset/invalid).
Types ¶
type EncodeConfig ¶
type H264RemuxEncoder ¶ added in v1.1.0
type H264RemuxEncoder struct {
// contains filtered or unexported fields
}
H264RemuxEncoder muxes Annex-B access units into MP4 via ffmpeg copy (no RGB round-trip).
func NewH264RemuxEncoder ¶ added in v1.1.0
func NewH264RemuxEncoder(ctx context.Context, locator Locator, fps int, outputPath string) (*H264RemuxEncoder, error)
NewH264RemuxEncoder starts ffmpeg in h264 copy mode.
func (*H264RemuxEncoder) Close ¶ added in v1.1.0
func (e *H264RemuxEncoder) Close() error
Close flushes stdin and waits for ffmpeg.
func (*H264RemuxEncoder) FrameCount ¶ added in v1.1.0
func (e *H264RemuxEncoder) FrameCount(ctx context.Context) (int, error)
FrameCount probes packet count via ffprobe when available.
func (*H264RemuxEncoder) OutputPath ¶ added in v1.1.0
func (e *H264RemuxEncoder) OutputPath() string
OutputPath returns the destination mp4 path.
func (*H264RemuxEncoder) WriteAccessUnits ¶ added in v1.1.0
func (e *H264RemuxEncoder) WriteAccessUnits(aus [][]byte) error
WriteAccessUnits writes ordered access units (nil entries are skipped).
type Locator ¶
func NewLocator ¶
type RawRGBEncoder ¶ added in v1.1.0
type RawRGBEncoder struct {
// contains filtered or unexported fields
}
RawRGBEncoder streams raw RGB24 frames directly into an ffmpeg process for video dtype features. This avoids writing per-frame PNG files to tempfs/disk for the bulk of the episode, keeping memory bounded to in-flight decoded frames + small stats samples.
func NewRawRGBEncoder ¶ added in v1.1.0
func (*RawRGBEncoder) Close ¶ added in v1.1.0
func (e *RawRGBEncoder) Close() error
func (*RawRGBEncoder) OutputPath ¶ added in v1.1.0
func (e *RawRGBEncoder) OutputPath() string
func (*RawRGBEncoder) WriteFrame ¶ added in v1.1.0
func (e *RawRGBEncoder) WriteFrame(frame VideoFrameRGB24) error
func (*RawRGBEncoder) WriteFrameBytes ¶ added in v1.1.0
func (e *RawRGBEncoder) WriteFrameBytes(rgb24 []byte) error
WriteFrameBytes keeps backward compatibility for callers still passing raw bytes.
type VideoFrameRGB24 ¶ added in v1.1.0
VideoFrameRGB24 is the typed contract for streaming raw RGB24 into encoders.
func AsVideoFrameRGB24 ¶ added in v1.1.0
func AsVideoFrameRGB24(v any, width, height int) (VideoFrameRGB24, error)
AsVideoFrameRGB24 accepts typed frames or legacy []byte with explicit dimensions.
func ParseOptionalVideoFrameRGB24 ¶ added in v1.1.0
func ParseOptionalVideoFrameRGB24(v any, width, height int) (VideoFrameRGB24, bool, error)
ParseOptionalVideoFrameRGB24 parses a frame value; nil/absent input returns ok=false without error.
func (VideoFrameRGB24) ExpectedSize ¶ added in v1.1.0
func (f VideoFrameRGB24) ExpectedSize() int
func (VideoFrameRGB24) Validate ¶ added in v1.1.0
func (f VideoFrameRGB24) Validate() error