-
Notifications
You must be signed in to change notification settings - Fork 1
/
aom_analyzer.go
43 lines (33 loc) · 970 Bytes
/
aom_analyzer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"aom_analyzer/analyzer"
"bufio"
"fmt"
"log"
"os"
"os/exec"
)
func main() {
fmt.Printf("AOM Analyzer for AOM Build Version %v\n\n", analyzer.Version)
if len(os.Args) != 2 {
fmt.Printf("Usage: aom_analyzer.exe bitstream.webm\n")
return
}
var analyzer analyzer.Analyzer
// Pipe a directory listing through sort.
analyzer.Tracer = exec.Command("aom/bin/aomdec.exe", os.Args[1], "-o", os.Args[1]+".yuv", "--i420", "--trace_level=65535")
// Get the pipe of Stderr from Tracer and assign it to the Scanner.
pipe, err := analyzer.Tracer.StderrPipe()
if err != nil {
log.Fatal(err)
}
analyzer.Scanner = bufio.NewScanner(pipe)
// Start() cmd, so we don't block on it.
err = analyzer.Tracer.Start()
if err != nil {
log.Fatal(err)
}
go analyzer.ParseTrace()
fmt.Printf("Type 'help' for more commands information\n")
analyzer.ParseCmd(os.Args[1], bufio.NewReader(os.Stdin))
}