Open sttyru opened 6 years ago
@sttyru I do something like this:
decoder, err := ffmpeg.NewVideoDecoder(vstream)
decoder.Setup()
pkt, err := demuxer.ReadPacket()
frame, err := decoder.Decode(pkt.Data)
if err != nil {
return err
}
defer frame.Free()
frame.Image
func encodeImg(img image.Image) bytes.Buffer {
var b bytes.Buffer
jpeg.Encode(&b, img, nil)
return b
}
jpegImg := encodeImg(frame.Image)
@thenrich, very thank you!
As this issue is still open, I have one question: Does a packet only contain a single frame? If not, why does the video decoder only return one frame for a whole packet instead of, e.g., a channel or array of frames?
Hello!
Thank you for awesome library!
I have a trivial question, maybe. I want to write very easy monitoring tool for IP-cameras (above 50 devices). The main criteria of avalability of devices is an ability of getting an image. I mean that I need more than simple check by ICMP or TCP/UDP. In this case I want to fetch (programmly) of the frame and checking that this image is non-empty, e.g. Can I do that using of your library? I found sources of RTSP-client software but I don't know how fetch the frame.