You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
531 B
23 lines
531 B
package ffmpeg
|
|
|
|
import (
|
|
"ycmediakit/internal/pkg/server/ffmpegServer"
|
|
"ycmediakit/internal/pkg/unit/result"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func ProbeStream(c *gin.Context) {
|
|
target := c.Query("target")
|
|
target, ok := ffmpegServer.PrepareUrl(target)
|
|
if !ok {
|
|
result.InvalidParams.WithVoidData().Failure(c)
|
|
return
|
|
}
|
|
jsonStr, err := ffmpegServer.ProbeStreamsWithTimeout(target, cfg.Timeout)
|
|
if err != nil {
|
|
result.Wrong.WithVoidData().WithMsg(err.Error()).Error(c)
|
|
return
|
|
}
|
|
result.Ok.WithData(jsonStr).Success(c)
|
|
}
|
|
|