l8f

package
v0.0.0-...-e16861e Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 13 Imported by: 0

README

lyrics818 format (l8f)

a lyrics video format written in golang

Features

  • Two video tracks: one for laptop size and the other for mobile size
  • Written in Golang

Description of the Format

The general description looks like this:

{header_length}
{header}
{audio}
{laptop_frames_lump}
{mobile_frames_lump}

This format uses a framerate of 1

Description of {header} section

The {header} section made up of some subsections. It looks like this

laptop_unique_frames:
{number}: {size}
{number}: {size}
::
laptop_frames:
{frame_number}: {unique_frame_number}
{frame_number}: {unique_frame_number}
::
mobile_unique_frames:
{number}: {size}
{number}: {size}
::
mobile_frames:
{frame_number}: {unique_frame_number}
{frame_number}: {unique_frame_number}
::
binary:
audio: {audio_size_bytes}
laptop_frames_lump: {laptop_video_size_bytes}
mobile_frames_lump: {mobile_video_size_bytes}
::
Description of the {audio} section

The {audio} section takes mp3 data and writes it unparsed to the video format

Description of the {laptop_frames_lump} / {mobile_frames_lump} sections

The {video} section is made up of a lump file of unique frames. The unique frames must be of png format

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVideoLength

func GetVideoLength(inVideoPath string) (int, error)

This checks the length of the video using the frames itself It doesn't check against the audio data embedded in it

func MakeL8F

func MakeL8F(inFramesLaptopDirectory, inFramesMobileDirectory, inAudioFile string,
	meta map[string]string, tmpVideoDirectory, outFilePath string) error

MakeL8F is good for videos with a lot of stills eg. lyrics videos with a single background. the inFramesDirectory must contain png files numbered from 1.png upwards the framerate must be stored in the **meta** as a string

func ReadAudio

func ReadAudio(inVideoPath string) ([]byte, error)

The audio is []bytes but it should contain 'mp3' audio

func ReadLaptopFrame

func ReadLaptopFrame(inVideoPath string, seconds int) (*image.Image, error)

Read frame for 1 seconds, starting from the 'seconds' parameter 'seconds' parameter starts from 1

func ReadMobileFrame

func ReadMobileFrame(inVideoPath string, seconds int) (*image.Image, error)

Read frame for 1 seconds, starting from the 'seconds' parameter 'seconds' parameter starts from 1

Types

type MakeVideoLumpTemp

type MakeVideoLumpTemp struct {
	UniqueFrames                []UniqueFrameDetails
	FramesPointerToUniqueFrames map[int]int
}

type UniqueFrameDetails

type UniqueFrameDetails struct {
	Hash             string
	FirstFrameNumber int
	Size             int
}

type VideoHeader

type VideoHeader struct {
	Meta               map[string]string
	LaptopUniqueFrames [][]int
	LaptopFrames       map[int]int
	MobileUniqueFrames [][]int
	MobileFrames       map[int]int
	AudioSize          int
	LaptopVideoSize    int
	MobileVideoSize    int
}

func ReadHeaderFromVideo

func ReadHeaderFromVideo(inVideoPath string) (VideoHeader, error)

Jump to

Keyboard shortcuts

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