This commit is contained in:
tinyzimmer
2020-10-04 17:09:30 +03:00
parent 084e997cec
commit c41729e844

View File

@@ -57,23 +57,6 @@ func encodeGif(mainLoop *gst.MainLoop) error {
// dynamically. For more information on why this is needed, see the decodebin // dynamically. For more information on why this is needed, see the decodebin
// example. // example.
decodebin.Connect("pad-added", func(self *gst.Element, srcPad *gst.Pad) { decodebin.Connect("pad-added", func(self *gst.Element, srcPad *gst.Pad) {
// // Make sure the user provided a valid video stream
// caps := srcPad.GetCurrentCaps()
// var haveVideo bool
// for i := 0; i < caps.GetSize(); i++ {
// if strings.HasPrefix(caps.GetStructureAt(i).Name(), "video/") {
// haveVideo = true
// }
// }
// if !haveVideo {
// // If we do not have any valid video send a fatal error to the pipeline.
// err := gst.NewGError(1, errors.New("No video stream detected from the input file"))
// pipeline.GetPipelineBus().
// Post(gst.NewErrorMessage(self, err, fmt.Sprintf("Received caps: %s", caps.String()), nil))
// return
// }
// Build out the rest of the elements for the pipeline pipeline. // Build out the rest of the elements for the pipeline pipeline.
elements, err := gst.NewElementMany("queue", "videoconvert", "videoscale", "videorate", "jpegenc") elements, err := gst.NewElementMany("queue", "videoconvert", "videoscale", "videorate", "jpegenc")
if err != nil { if err != nil {