-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade FFmpeg from 4.4 to 6.1 #3217
Conversation
@@ -1,12 +0,0 @@ | |||
# Include static libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this and just did this in the Makefile since it's simpler and this was giving me issues.
@@ -177,11 +177,6 @@ func (ctxt *Context) Close() int { | |||
return int(C.avcodec_close((*C.struct_AVCodecContext)(ctxt))) | |||
} | |||
|
|||
// Free frees the AVPacket | |||
func (p *Packet) Free() { | |||
C.av_free_packet((*C.struct_AVPacket)(p)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From https://github.com/FFmpeg/FFmpeg/blob/96d2a40b9ee0ddd1844b82c23a074804c316caa5/doc/APIchanges#L1512
2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h
xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement,
it resets the packet in a more consistent way.
C.av_register_all() | ||
C.avcodec_register_all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From leandromoreira/ffmpeg-libav-tutorial#29
You can just omit this function call in ffmpeg 4.0 and later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Wow, minimal changes (only removing free) from 4 to 6. FFMPEG is amazingly stable :)
Code Coverage
|
This updates the version of FFmpeg we depend on from 4.4 to 6.1 (latest). I only had to delete three deprecated functions to upgrade. The only thing you need to look at are the handful of changes in the Makefile, avcodec.go, and avutil.go. It should be straightforward. I tested on RPi and a Linux amd64.
Important
No need to review FFmpeg source files.