Skip to content
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

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Conversation

bazile-clyde
Copy link
Contributor

@bazile-clyde bazile-clyde commented Nov 9, 2023

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.

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Nov 9, 2023
@@ -1,12 +0,0 @@
# Include static libraries
Copy link
Contributor Author

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))
Copy link
Contributor Author

@bazile-clyde bazile-clyde Nov 9, 2023

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.

Comment on lines -272 to -273
C.av_register_all()
C.avcodec_register_all()
Copy link
Contributor Author

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.

@bazile-clyde bazile-clyde added appimage Build AppImage of PR static-build Build static binaries from PR labels Nov 9, 2023
Copy link
Member

@seanavery seanavery left a 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 :)

@bazile-clyde bazile-clyde added appimage Build AppImage of PR safe to test This pull request is marked safe to test from a trusted zone static-build Build static binaries from PR and removed appimage Build AppImage of PR safe to test This pull request is marked safe to test from a trusted zone static-build Build static binaries from PR labels Nov 9, 2023
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Nov 9, 2023
@bazile-clyde bazile-clyde added appimage Build AppImage of PR safe to test This pull request is marked safe to test from a trusted zone static-build Build static binaries from PR and removed appimage Build AppImage of PR safe to test This pull request is marked safe to test from a trusted zone static-build Build static binaries from PR labels Nov 9, 2023
@bazile-clyde bazile-clyde added appimage Build AppImage of PR safe to test This pull request is marked safe to test from a trusted zone static-build Build static binaries from PR and removed static-build Build static binaries from PR safe to test This pull request is marked safe to test from a trusted zone labels Nov 9, 2023
Copy link
Contributor

Code Coverage

Code Coverage
Package Line Rate Delta Health
go.viam.com/rdk/cli 14% 0.00%
go.viam.com/rdk/components/arm 58% 0.00%
go.viam.com/rdk/components/arm/fake 27% 0.00%
go.viam.com/rdk/components/arm/universalrobots 42% 0.00%
go.viam.com/rdk/components/arm/wrapper 19% 0.00%
go.viam.com/rdk/components/arm/xarm 22% 0.00%
go.viam.com/rdk/components/audioinput 43% -0.47%
go.viam.com/rdk/components/base 60% 0.00%
go.viam.com/rdk/components/base/kinematicbase 38% 0.00%
go.viam.com/rdk/components/base/sensorcontrolled 61% 0.00%
go.viam.com/rdk/components/base/wheeled 84% 0.00%
go.viam.com/rdk/components/board 59% 0.00%
go.viam.com/rdk/components/board/customlinux 49% 0.00%
go.viam.com/rdk/components/board/fake 38% 0.00%
go.viam.com/rdk/components/board/genericlinux 8% 0.00%
go.viam.com/rdk/components/board/numato 17% 0.00%
go.viam.com/rdk/components/board/pi 50% 0.00%
go.viam.com/rdk/components/camera 55% 0.00%
go.viam.com/rdk/components/camera/align 63% 0.00%
go.viam.com/rdk/components/camera/fake 74% 0.00%
go.viam.com/rdk/components/camera/ffmpeg 82% 0.00%
go.viam.com/rdk/components/camera/replaypcd 89% 0.00%
go.viam.com/rdk/components/camera/rtsp 52% 0.00%
go.viam.com/rdk/components/camera/transformpipeline 73% 0.00%
go.viam.com/rdk/components/camera/ultrasonic 61% 0.00%
go.viam.com/rdk/components/camera/videosource 36% 0.00%
go.viam.com/rdk/components/encoder 56% 0.00%
go.viam.com/rdk/components/encoder/ams 63% 0.00%
go.viam.com/rdk/components/encoder/fake 83% 0.00%
go.viam.com/rdk/components/encoder/incremental 80% 0.00%
go.viam.com/rdk/components/encoder/single 86% 0.00%
go.viam.com/rdk/components/gantry 58% 0.00%
go.viam.com/rdk/components/gantry/multiaxis 82% 0.00%
go.viam.com/rdk/components/gantry/singleaxis 83% -1.66%
go.viam.com/rdk/components/generic 79% 0.00%
go.viam.com/rdk/components/gripper 56% 0.00%
go.viam.com/rdk/components/input 88% 0.00%
go.viam.com/rdk/components/input/fake 94% 0.00%
go.viam.com/rdk/components/input/gpio 85% 0.00%
go.viam.com/rdk/components/motor 70% 0.00%
go.viam.com/rdk/components/motor/dimensionengineering 67% 0.00%
go.viam.com/rdk/components/motor/dmc4000 70% 0.00%
go.viam.com/rdk/components/motor/fake 55% 0.00%
go.viam.com/rdk/components/motor/gpio 69% 0.00%
go.viam.com/rdk/components/motor/gpiostepper 72% 0.00%
go.viam.com/rdk/components/motor/tmcstepper 53% 0.00%
go.viam.com/rdk/components/motor/ulnstepper 52% 0.00%
go.viam.com/rdk/components/movementsensor 66% 0.00%
go.viam.com/rdk/components/movementsensor/adxl345 75% 0.00%
go.viam.com/rdk/components/movementsensor/gpsnmea 53% 0.00%
go.viam.com/rdk/components/movementsensor/gpsrtkpmtk 20% 0.00%
go.viam.com/rdk/components/movementsensor/gpsrtkserial 27% 0.00%
go.viam.com/rdk/components/movementsensor/merged 91% 0.00%
go.viam.com/rdk/components/movementsensor/mpu6050 79% 0.00%
go.viam.com/rdk/components/movementsensor/replay 88% 0.00%
go.viam.com/rdk/components/movementsensor/rtkutils 24% 0.00%
go.viam.com/rdk/components/movementsensor/wheeledodometry 76% +0.64%
go.viam.com/rdk/components/posetracker 71% 0.00%
go.viam.com/rdk/components/powersensor 58% 0.00%
go.viam.com/rdk/components/sensor 49% 0.00%
go.viam.com/rdk/components/sensor/ultrasonic 38% 0.00%
go.viam.com/rdk/components/servo 60% 0.00%
go.viam.com/rdk/components/servo/gpio 72% 0.00%
go.viam.com/rdk/config 81% 0.00%
go.viam.com/rdk/control 59% 0.00%
go.viam.com/rdk/data 73% 0.00%
go.viam.com/rdk/examples/customresources/demos/remoteserver 0% 0.00%
go.viam.com/rdk/gostream 20% 0.00%
go.viam.com/rdk/gostream/codec/x264 8% 0.00%
go.viam.com/rdk/grpc 25% 0.00%
go.viam.com/rdk/internal/cloud 65% 0.00%
go.viam.com/rdk/logging 70% 0.00%
go.viam.com/rdk/ml/inference 67% 0.00%
go.viam.com/rdk/module 75% 0.00%
go.viam.com/rdk/module/modmanager 74% 0.00%
go.viam.com/rdk/motionplan 78% +0.23%
go.viam.com/rdk/motionplan/ik 67% 0.00%
go.viam.com/rdk/motionplan/tpspace 43% 0.00%
go.viam.com/rdk/operation 83% 0.00%
go.viam.com/rdk/pointcloud 67% 0.00%
go.viam.com/rdk/protoutils 49% 0.00%
go.viam.com/rdk/referenceframe 68% 0.00%
go.viam.com/rdk/resource 78% 0.00%
go.viam.com/rdk/rimage 55% 0.00%
go.viam.com/rdk/rimage/depthadapter 94% 0.00%
go.viam.com/rdk/rimage/transform 70% -0.10%
go.viam.com/rdk/rimage/transform/cmd/extrinsic_calibration 67% 0.00%
go.viam.com/rdk/robot 85% 0.00%
go.viam.com/rdk/robot/client 82% 0.00%
go.viam.com/rdk/robot/framesystem 36% 0.00%
go.viam.com/rdk/robot/impl 82% 0.00%
go.viam.com/rdk/robot/packages 76% 0.00%
go.viam.com/rdk/robot/server 55% 0.00%
go.viam.com/rdk/robot/web 65% 0.00%
go.viam.com/rdk/robot/web/stream 87% 0.00%
go.viam.com/rdk/services/baseremotecontrol 50% 0.00%
go.viam.com/rdk/services/baseremotecontrol/builtin 81% 0.00%
go.viam.com/rdk/services/datamanager 58% 0.00%
go.viam.com/rdk/services/datamanager/builtin 81% -1.23%
go.viam.com/rdk/services/datamanager/datacapture 73% 0.00%
go.viam.com/rdk/services/datamanager/datasync 0% 0.00%
go.viam.com/rdk/services/mlmodel 81% 0.00%
go.viam.com/rdk/services/mlmodel/tflitecpu 86% 0.00%
go.viam.com/rdk/services/motion 85% 0.00%
go.viam.com/rdk/services/motion/builtin 85% 0.00%
go.viam.com/rdk/services/motion/explore 44% 0.00%
go.viam.com/rdk/services/navigation 50% 0.00%
go.viam.com/rdk/services/navigation/builtin 78% 0.00%
go.viam.com/rdk/services/sensors 81% 0.00%
go.viam.com/rdk/services/sensors/builtin 97% 0.00%
go.viam.com/rdk/services/shell 11% 0.00%
go.viam.com/rdk/services/slam 73% 0.00%
go.viam.com/rdk/services/slam/fake 82% 0.00%
go.viam.com/rdk/services/vision 35% 0.00%
go.viam.com/rdk/services/vision/colordetector 56% 0.00%
go.viam.com/rdk/services/vision/detectionstosegments 67% 0.00%
go.viam.com/rdk/services/vision/mlvision 64% -0.53%
go.viam.com/rdk/services/vision/obstaclesdepth 70% 0.00%
go.viam.com/rdk/services/vision/obstaclesdistance 73% 0.00%
go.viam.com/rdk/services/vision/obstaclespointcloud 59% 0.00%
go.viam.com/rdk/session 94% 0.00%
go.viam.com/rdk/spatialmath 81% +0.09%
go.viam.com/rdk/utils 68% 0.00%
go.viam.com/rdk/utils/contextutils 47% 0.00%
go.viam.com/rdk/vision 37% 0.00%
go.viam.com/rdk/vision/delaunay 87% 0.00%
go.viam.com/rdk/vision/keypoints 92% 0.00%
go.viam.com/rdk/vision/objectdetection 69% 0.00%
go.viam.com/rdk/vision/segmentation 55% 0.00%
go.viam.com/rdk/web/server 0% 0.00%
Summary 61% (24636 / 40604) +0.63%

@bazile-clyde bazile-clyde merged commit dd31d71 into viamrobotics:main Nov 10, 2023
44 of 57 checks passed
@bazile-clyde bazile-clyde deleted the ffmpeg branch November 10, 2023 01:10
bazile-clyde added a commit to bazile-clyde/rdk that referenced this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appimage Build AppImage of PR safe to test This pull request is marked safe to test from a trusted zone static-build Build static binaries from PR
Projects
None yet
3 participants