@@ -18,7 +18,7 @@ func main() {
1818Usage:
1919 qvh devices
2020 qvh activate
21- qvh record <outfile > <audiofile >
21+ qvh record <h264file > <wavfile >
2222
2323Options:
2424 -h --help Show this screen.
@@ -54,17 +54,17 @@ The commands work as following:
5454
5555 rawStreamCommand , _ := arguments .Bool ("record" )
5656 if rawStreamCommand {
57- outFilePath , err := arguments .String ("<outfile >" )
57+ h264FilePath , err := arguments .String ("<h264file >" )
5858 if err != nil {
5959 log .Error ("Missing outfile parameter. Please specify a valid path like '/home/me/out.h264'" )
6060 return
6161 }
62- outFilePathAudio , err := arguments .String ("<audiofile >" )
62+ waveFilePath , err := arguments .String ("<wavfile >" )
6363 if err != nil {
6464 log .Error ("Missing audiofile parameter. Please specify a valid path like '/home/me/out.raw'" )
6565 return
6666 }
67- record (outFilePath , outFilePathAudio )
67+ record (h264FilePath , waveFilePath )
6868 }
6969}
7070
@@ -125,46 +125,46 @@ func activate() {
125125 log .Info (qtOutput )
126126}
127127
128- func record (outFilePath string , outFilePathAudio string ) {
128+ func record (h264FilePath string , wavFilePath string ) {
129129 activate ()
130130 cleanup := screencapture .Init ()
131131 deviceList , err := screencapture .FindIosDevices ()
132132 defer cleanup ()
133133 if err != nil {
134134 log .Fatal ("Error finding iOS Devices" , err )
135135 }
136- log .Infof ("Writing output to:%s " , outFilePath )
136+ log .Infof ("Writing video output to:'%s' and audio to: %s " , h264FilePath , wavFilePath )
137137 dev := deviceList [0 ]
138138
139- file , err := os .Create (outFilePath )
139+ h264File , err := os .Create (h264FilePath )
140140 if err != nil {
141- log .Debugf ("Error creating file :%s" , err )
142- log .Errorf ("Could not open file '%s'" , outFilePath )
141+ log .Debugf ("Error creating h264File :%s" , err )
142+ log .Errorf ("Could not open h264File '%s'" , h264FilePath )
143143 }
144- audioFile , err := os .Create (outFilePathAudio )
144+ wavFile , err := os .Create (wavFilePath )
145145 if err != nil {
146- log .Debugf ("Error creating file:%s" , err )
147- log .Errorf ("Could not open file '%s'" , outFilePath )
146+ log .Debugf ("Error creating wav file:%s" , err )
147+ log .Errorf ("Could not open wav file '%s'" , wavFilePath )
148148 }
149149
150- writer := coremedia .NewAVFileWriter (bufio .NewWriter (file ), bufio .NewWriter (audioFile ))
150+ writer := coremedia .NewAVFileWriter (bufio .NewWriter (h264File ), bufio .NewWriter (wavFile ))
151151
152152 defer func () {
153- stat , err := audioFile .Stat ()
153+ stat , err := wavFile .Stat ()
154154 if err != nil {
155155 log .Fatal ("Could not get wav file stats" , err )
156156 }
157- err = coremedia .WriteWavHeader (int (stat .Size ()), audioFile )
157+ err = coremedia .WriteWavHeader (int (stat .Size ()), wavFile )
158158 if err != nil {
159- log .Fatalf ("Error writing wave header %s might be invalid. %s" , outFilePathAudio , err .Error ())
159+ log .Fatalf ("Error writing wave header %s might be invalid. %s" , wavFilePath , err .Error ())
160160 }
161- err = audioFile .Close ()
161+ err = wavFile .Close ()
162162 if err != nil {
163- log .Fatalf ("Error closing wave file. '%s' might be invalid. %s" , outFilePathAudio , err .Error ())
163+ log .Fatalf ("Error closing wave file. '%s' might be invalid. %s" , wavFilePath , err .Error ())
164164 }
165- err = file .Close ()
165+ err = h264File .Close ()
166166 if err != nil {
167- log .Fatalf ("Error closing h264 file '%s'. %s" , outFilePath , err .Error ())
167+ log .Fatalf ("Error closing h264File '%s'. %s" , h264FilePath , err .Error ())
168168 }
169169
170170 }()
0 commit comments