Skip to content

Commit 45fbead

Browse files
committed
doc: clearer doc
1 parent cc3e268 commit 45fbead

File tree

7 files changed

+29
-15
lines changed

7 files changed

+29
-15
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
[![Go Report Card](https://goreportcard.com/badge/github.com/edgeware/mp4ff)](https://goreportcard.com/report/github.com/edgeware/mp4ff)
77
[![license](https://img.shields.io/github/license/edgeware/mp4ff.svg)](https://github.com/edgeware/mp4ff/blob/master/LICENSE.md)
88

9-
MP4/ISOBMFF media file parser and writer. Focused on fragmented files as used for streaming in DASH, MSS and HLS fMP4.
9+
Package mp4ff implements MP4 media file parser and writer for AVC video, AAC audio and stpp/wvtt subtitles.
10+
Focused on fragmented files as used for streaming in DASH, MSS and HLS fMP4.
1011

1112
## Library
1213

13-
The library has functions for parsing (called Decode) and writing (Encode).
14+
The library has functions for parsing (called Decode) and writing (Encode) in the package `mp4ff/mp4`.
15+
It also contains codec specific parsing of of AVC/H.264 including complete parsing of
16+
SPS and PPS in the package `mp4ff.avc`.
1417

15-
Traditional multiplexed non-fragmented mp4 files can be parsed and decoded, see `examples/segment`.
18+
Traditional multiplexed non-fragmented mp4 files can also be parsed and decoded, see `examples/segment`.
1619

1720
The focus is, however, on non-multiplexed single-track fragmented mp4 files as used in DASH, HLS, and CMAF.
1821

@@ -114,7 +117,7 @@ it can be calculated. It is set to `MoofBox.Size()+8`.
114117

115118
Some simple command line tools are available in `cmd`.
116119

117-
1. `mp4ff-pslister` extracts and displays pps and sps for AVC in an mp4 file
120+
1. `mp4ff-pslister` extracts and displays pps and sps for AVC in an mp4 file.
118121

119122
## Example code
120123

@@ -133,7 +136,7 @@ The APIs should be fairly stable, but minor non-backwards-compatible tweaks may
133136

134137
MIT, see [LICENSE.md](LICENSE.md).
135138

136-
Some code in pkg/mp4, es from or is based on https://github.com/jfbus/mp4 which has
139+
Some code in pkg/mp4, comes from or is based on https://github.com/jfbus/mp4 which has
137140
`Copyright (c) 2015 Jean-François Bustarret`.
138141

139142
Some code in pkg/bits comes from or is based on https://github.com/tcnksm/go-casper/tree/master/internal/bits

avc/doc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/*
2+
Package avc implements parsing of AVC(H.264) nal headers, slice headers and complete SPS and PPS.
3+
*/
4+
package avc

cmd/mp4ff-pslister/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func main() {
5959
avcC := stsd.AvcX.AvcC
6060
trackID := trak.Tkhd.TrackID
6161
if *verbose {
62-
fmt.Printf("Videavo track ID=%d\n", trackID)
62+
fmt.Printf("Video track ID=%d\n", trackID)
6363
}
6464
var spsInfo *avc.SPS
6565
var err error

doc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Package mp4ff implements MP4 media file parser and writer.
2+
Package mp4ff implements MP4 media file parser and writer for AVC video, AAC audio and stpp/wvtt subtitles.
3+
Focused on fragmented files as used for streaming in DASH, MSS and HLS fMP4.
34
45
MP4 library
56

examples/resegmenter/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// mp4ff-resegmenter resegments mp4 files into concatenated segments with new duration.
1+
// resegmenter resegments mp4 files into concatenated segments with new duration.
22
//
3-
// The mp4 files must look like a CMAF track with init segment and media segments.
3+
// The input file must be a CMAF track with init segment and media segments.
44
//
55
// Usage:
66
//
7-
// mp4ff-resegmenter -f <input.mp4> -o <output.mp4> -b <chunk_dur>
7+
// resegmenter -f <input.mp4> -o <output.mp4> -b <chunk_dur>
88
// -b int
99
// Required: chunk duration (ticks)
1010
// -f string

examples/segmenter/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// segmenter segments a progressive mp4 file into audio and video segments
22
//
3-
// There should be at most one audio and one video track in the file.
3+
// There should be at most one audio and one video track in the input.
44
// The output files will be named as
5-
// init segments: <output>_a.mp4 and <output>_v.mp4
6-
// media segments: <output>_a_<n>.m4s and <output>_v_<n>.m4s where n >= 1
5+
// init segments: <output>_a.mp4 and <output>_v.mp4
6+
// media segments: <output>_a_<n>.m4s and <output>_v_<n>.m4s where n >= 1
77
//
88
// Usage:
99
//

examples/tree/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// mp4ff-tree print a tree of the box structure of a file.
1+
// tree prints a tree of the box structure of a file using the Dump method of boxes.
22
//
33
// Usage:
44
//
@@ -30,5 +30,11 @@ func main() {
3030
}
3131
defer ifd.Close()
3232
parsedMp4, err := mp4.DecodeFile(ifd)
33-
parsedMp4.Dump(os.Stdout, " ")
33+
if err != nil {
34+
log.Fatal(err)
35+
}
36+
err = parsedMp4.Dump(os.Stdout, " ")
37+
if err != nil {
38+
log.Fatal(err)
39+
}
3440
}

0 commit comments

Comments
 (0)