mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-08 09:30:23 +08:00
Fixed transcoding example timebase
This commit is contained in:
@@ -226,6 +226,9 @@ func openInputFile() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set time base
|
||||||
|
s.decCodecContext.SetTimeBase(is.TimeBase())
|
||||||
|
|
||||||
// Allocate frame
|
// Allocate frame
|
||||||
s.decFrame = astiav.AllocFrame()
|
s.decFrame = astiav.AllocFrame()
|
||||||
c.Add(s.decFrame.Free)
|
c.Add(s.decFrame.Free)
|
||||||
@@ -302,7 +305,7 @@ func openOutputFile() (err error) {
|
|||||||
s.encCodecContext.SetPixelFormat(s.decCodecContext.PixelFormat())
|
s.encCodecContext.SetPixelFormat(s.decCodecContext.PixelFormat())
|
||||||
}
|
}
|
||||||
s.encCodecContext.SetSampleAspectRatio(s.decCodecContext.SampleAspectRatio())
|
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())
|
s.encCodecContext.SetWidth(s.decCodecContext.Width())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user