mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-05 07:37:20 +08:00
2023-10-19 14:31:46 CST W42D4
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
ffmpeg "github.com/qrtc/ffmpeg-dev-go"
|
||||
)
|
||||
|
||||
func encode(encCtx *ffmpeg.AvCodecContext, frame *ffmpeg.AvFrame, pkt *ffmpeg.AvPacket, outfile *os.File) {
|
||||
func encode(encCtx *ffmpeg.AVCodecContext, frame *ffmpeg.AVFrame, pkt *ffmpeg.AVPacket, outfile *os.File) {
|
||||
if frame != nil {
|
||||
fmt.Fprintf(os.Stdout, "Send frame %3d\n", frame.GetPts())
|
||||
}
|
||||
@@ -22,7 +22,7 @@ func encode(encCtx *ffmpeg.AvCodecContext, frame *ffmpeg.AvFrame, pkt *ffmpeg.Av
|
||||
|
||||
for ret >= 0 {
|
||||
ret = ffmpeg.AvCodecReceivePacket(encCtx, pkt)
|
||||
if ret == ffmpeg.AVERROR(int32(syscall.EAGAIN)) || ret == ffmpeg.AVERROR_EOF {
|
||||
if ret == ffmpeg.AVERROR(syscall.EAGAIN) || ret == ffmpeg.AVERROR_EOF {
|
||||
return
|
||||
} else if ret < 0 {
|
||||
fmt.Fprintf(os.Stderr, "Error during encoding\n")
|
||||
|
Reference in New Issue
Block a user