| 204 | } |
| 205 | |
| 206 | func printExamples() { |
| 207 | |
| 208 | examples := `Examples: |
| 209 | |
| 210 | Writing an MP4 file |
| 211 | This pipeline will save the recording in video.mp4 with h264 and aac format. The default settings |
| 212 | of this pipeline will create a compressed video that takes up way less space than raw h264. |
| 213 | Note that you need to set "ignore-length" on the wavparse because we are streaming and do not know the length in advance. |
| 214 | |
| 215 | Write MP4 file Mac OSX: |
| 216 | vtdec is the hardware accelerated decoder on the mac. |
| 217 | |
| 218 | qvh gstreamer --pipeline "mp4mux name=mux ! filesink location=video.mp4 \ |
| 219 | queue name=audio_target ! wavparse ignore-length=true ! audioconvert ! faac ! aacparse ! mux. \ |
| 220 | queue name=video_target ! h264parse ! vtdec ! videoconvert ! x264enc tune=zerolatency ! mux." |
| 221 | |
| 222 | Write MP4 file Linux: |
| 223 | note that I am using software en and decoding, if you have intel VAAPI available, maybe use those. |
| 224 | |
| 225 | gstreamer --pipeline "mp4mux name=mux ! filesink location=video.mp4 \ |
| 226 | queue name=audio_target ! wavparse ignore-length=true ! audioconvert ! avenc_aac ! aacparse ! mux. \ |
| 227 | queue name=video_target ! h264parse ! avdec_h264 ! videoconvert ! x264enc tune=zerolatency ! mux." |
| 228 | ` |
| 229 | fmt.Print(examples) |
| 230 | } |
| 231 | |
| 232 | func recordAudioGst(outfile string, device screencapture.IosDevice, audiotype string) { |
| 233 | log.Debug("Starting Gstreamer with audio pipeline") |