Skip to content

Commit

Permalink
Fixed transcoding example timebase
Browse files Browse the repository at this point in the history
  • Loading branch information
asticode committed Nov 17, 2024
1 parent a8a037c commit 592d8ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/transcoding/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ func openInputFile() (err error) {
return
}

// Set time base
s.decCodecContext.SetTimeBase(is.TimeBase())

// Allocate frame
s.decFrame = astiav.AllocFrame()
c.Add(s.decFrame.Free)
Expand Down Expand Up @@ -302,7 +305,7 @@ func openOutputFile() (err error) {
s.encCodecContext.SetPixelFormat(s.decCodecContext.PixelFormat())
}
s.encCodecContext.SetSampleAspectRatio(s.decCodecContext.SampleAspectRatio())
s.encCodecContext.SetTimeBase(s.decCodecContext.Framerate().Invert())
s.encCodecContext.SetTimeBase(s.decCodecContext.TimeBase())
s.encCodecContext.SetWidth(s.decCodecContext.Width())
}

Expand Down

0 comments on commit 592d8ea

Please sign in to comment.