mp4

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 11 Imported by: 2

README

Fragmented MP4

ffmpeg -i "rtsp://..." -movflags +frag_keyframe+separate_moof+default_base_moof+empty_moov -frag_duration 1 -c copy -t 5 sample.mp4
  • movflags frag_keyframe Start a new fragment at each video keyframe.
  • frag_duration duration Create fragments that are duration microseconds long.
  • movflags separate_moof Write a separate moof (movie fragment) atom for each track.
  • movflags default_base_moof Similarly to the omit_tfhd_offset, this flag avoids writing the absolute base_data_offset field in tfhd atoms, but does so by using the new default-base-is-moof flag instead.

https://ffmpeg.org/ffmpeg-formats.html#Options-13

HEVC

Browser avc1 hvc1 hev1
Mac Chrome + - +
Mac Safari + + -
iOS 15? + + -
Mac Firefox + - -
iOS 12 + - -
Android 13 + - -

Documentation

Index

Constants

View Source
const (
	MimeH264 = "avc1.640029"
	MimeH265 = "hvc1.1.6.L153.B0"
	MimeAAC  = "mp4a.40.2"
	MimeOpus = "opus"
)

Variables

This section is empty.

Functions

func ParseQuery added in v1.1.0

func ParseQuery(query map[string][]string) []*streamer.Media

ParseQuery - like usual parse, but with mp4 param handler

Types

type Consumer

type Consumer struct {
	streamer.Element

	Medias     []*streamer.Media
	UserAgent  string
	RemoteAddr string
	// contains filtered or unexported fields
}

func (*Consumer) AddTrack

func (c *Consumer) AddTrack(media *streamer.Media, track *streamer.Track) *streamer.Track

func (*Consumer) GetMedias

func (c *Consumer) GetMedias() []*streamer.Media

func (*Consumer) Init

func (c *Consumer) Init() ([]byte, error)

func (*Consumer) MarshalJSON

func (c *Consumer) MarshalJSON() ([]byte, error)

func (*Consumer) MimeCodecs added in v1.1.0

func (c *Consumer) MimeCodecs() string

func (*Consumer) MimeType

func (c *Consumer) MimeType() string

func (*Consumer) Start

func (c *Consumer) Start()

type Muxer

type Muxer struct {
	// contains filtered or unexported fields
}

func (*Muxer) GetInit

func (m *Muxer) GetInit(codecs []*streamer.Codec) ([]byte, error)

func (*Muxer) Marshal

func (m *Muxer) Marshal(trackID byte, packet *rtp.Packet) []byte

func (*Muxer) MimeCodecs added in v1.1.0

func (m *Muxer) MimeCodecs(codecs []*streamer.Codec) string

func (*Muxer) Reset

func (m *Muxer) Reset()

type Segment

type Segment struct {
	streamer.Element

	Medias     []*streamer.Media
	UserAgent  string
	RemoteAddr string

	MimeType     string
	OnlyKeyframe bool
	// contains filtered or unexported fields
}

func (*Segment) AddTrack

func (c *Segment) AddTrack(media *streamer.Media, track *streamer.Track) *streamer.Track

func (*Segment) GetMedias

func (c *Segment) GetMedias() []*streamer.Media

func (*Segment) MarshalJSON

func (c *Segment) MarshalJSON() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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