add comment
This commit is contained in:
parent
bf89f36b1a
commit
767bba0224
2
doc.txt
2
doc.txt
@ -33,6 +33,8 @@ The first h264 packet
|
|||||||
[h264 @ 0x7fdf01802200] NAL 5(IDR) at 79/279 length 124
|
[h264 @ 0x7fdf01802200] NAL 5(IDR) at 79/279 length 124
|
||||||
[h264 @ 0x7fdf01802200] NAL 5(IDR) at 207/279 length 71
|
[h264 @ 0x7fdf01802200] NAL 5(IDR) at 207/279 length 71
|
||||||
|
|
||||||
|
AUD is a must for QuickTime player.
|
||||||
|
|
||||||
NAL_SLICE = 1,
|
NAL_SLICE = 1,
|
||||||
NAL_DPA = 2,
|
NAL_DPA = 2,
|
||||||
NAL_DPB = 3,
|
NAL_DPB = 3,
|
||||||
|
@ -35,7 +35,8 @@ func readSamples(filename string, ch chan Sample) {
|
|||||||
close(ch)
|
close(ch)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
debug := false
|
debugData := true
|
||||||
|
debugStream := false
|
||||||
|
|
||||||
var file *os.File
|
var file *os.File
|
||||||
var err error
|
var err error
|
||||||
@ -70,8 +71,6 @@ func readSamples(filename string, ch chan Sample) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
debugStream := false
|
|
||||||
|
|
||||||
onStreamPayload := func() (err error) {
|
onStreamPayload := func() (err error) {
|
||||||
stream := findOrCreateStream(header.PID)
|
stream := findOrCreateStream(header.PID)
|
||||||
r := bytes.NewReader(payload)
|
r := bytes.NewReader(payload)
|
||||||
@ -94,7 +93,7 @@ func readSamples(filename string, ch chan Sample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if stream.Data.Len() == int(stream.PESHeader.DataLength) {
|
if stream.Data.Len() == int(stream.PESHeader.DataLength) {
|
||||||
if debug {
|
if debugData {
|
||||||
fmt.Println(stream.Type, stream.Title, stream.Data.Len(), "total")
|
fmt.Println(stream.Type, stream.Title, stream.Data.Len(), "total")
|
||||||
fmt.Println(hex.Dump(stream.Data.Bytes()))
|
fmt.Println(hex.Dump(stream.Data.Bytes()))
|
||||||
}
|
}
|
||||||
@ -114,7 +113,7 @@ func readSamples(filename string, ch chan Sample) {
|
|||||||
if header, n, err = ts.ReadTSPacket(file, data[:]); err != nil {
|
if header, n, err = ts.ReadTSPacket(file, data[:]); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if debug {
|
if debugData {
|
||||||
fmt.Println(header, n)
|
fmt.Println(header, n)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,9 +133,6 @@ func readSamples(filename string, ch chan Sample) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
//fmt.Println("pmt", pmt)
|
//fmt.Println("pmt", pmt)
|
||||||
if debug {
|
|
||||||
fmt.Println(hex.Dump(payload))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user