Update Audaspace to 1.5.0 for FFmpeg 7.0 #121948

Closed
Robert-Andre-Mauchin wants to merge 1 commits from Robert-Andre-Mauchin/blender:update_audaspace into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

This commit:

  • imports Audaspace 1.5.0, which allows compatibility with FFmpeg 7.0
  • cherry-picks upstream commit 5efc5c45e1c6608b32d73055b6ecec5825da004c
    which is a patch I sent to fix some variable assignation in the new
    code.
  • keeps upstream bugfixes backported in a5ba4032e0
This commit: - imports Audaspace 1.5.0, which allows compatibility with FFmpeg 7.0 - cherry-picks upstream commit 5efc5c45e1c6608b32d73055b6ecec5825da004c which is a patch I sent to fix some variable assignation in the new code. - keeps upstream bugfixes backported in a5ba4032e0dd581776704ca1f15a8264578a1f27
Robert-Andre-Mauchin added 1 commit 2024-05-18 16:44:08 +02:00
This commit:

 - imports Audaspace 1.5.0, which allows compatibility with FFmpeg 7.0
 - cherry-picks upstream commit 5efc5c45e1c6608b32d73055b6ecec5825da004c
   which is a patch I sent to fix some variable assignation in the new
   code.
 - keeps upstream bugfixes backported in a5ba4032e0

CC @neXyon for Audaspace in general and maybe @ZedDB to see if dropping ffmpeg < 6 is going to be ok?

CC @neXyon for Audaspace in general and maybe @ZedDB to see if dropping ffmpeg < 6 is going to be ok?
Member

The minimum supported ffmpeg version for blender is according to ffmpeg_compat.h is 3.2.0 i don't see suddenly supporting only the latest version being inline with with this long history of making older version work, also i've had no request from the vse module to bump our ffmpeg from version 6.1.1

The minimum supported ffmpeg version for blender is according to `ffmpeg_compat.h` is 3.2.0 i don't see suddenly supporting only the latest version being inline with with this long history of making older version work, also i've had no request from the vse module to bump our ffmpeg from version 6.1.1
Author
First-time contributor

CC @neXyon for Audaspace in general and maybe @ZedDB to see if dropping ffmpeg < 6 is going to be ok?

Upstream says < 6, but according to my analysis of the function used, it will be compatible with 5.1+. There is one function which signature has changed in 6+, but a NULL value is passed to that parameter.

> CC @neXyon for Audaspace in general and maybe @ZedDB to see if dropping ffmpeg < 6 is going to be ok? Upstream says < 6, but according to my analysis of the function used, it will be compatible with 5.1+. There is one function which signature has changed in 6+, but a NULL value is passed to that parameter.
Author
First-time contributor

Closing in favor of #121960

Closing in favor of #121960
Member

The minimum supported ffmpeg version for blender is according to ffmpeg_compat.h is 3.2.0 i don't see suddenly supporting only the latest version being inline with with this long history of making older version work, also i've had no request from the vse module to bump our ffmpeg from version 6.1.1

Since we are using 6.1.1, is there any reason to still support lower versions @LazyDodo? Is anyone actually using a new blender version with an old ffmpeg version (i.e., older than 6.0)? The advantage of not supporting the old versions anymore is that all this define clutter can be removed which makes for easier to maintain code.

> The minimum supported ffmpeg version for blender is according to `ffmpeg_compat.h` is 3.2.0 i don't see suddenly supporting only the latest version being inline with with this long history of making older version work, also i've had no request from the vse module to bump our ffmpeg from version 6.1.1 Since we are using 6.1.1, is there any reason to still support lower versions @LazyDodo? Is anyone actually using a new blender version with an old ffmpeg version (i.e., older than 6.0)? The advantage of not supporting the old versions anymore is that all this define clutter can be removed which makes for easier to maintain code.
Member

Unsure, hard to say what downstream users like distro's are doing, pretty sure we could drop support for really old versions like 3.x without causing too much discomfort for downstream users, requiring 7.0 when even even blender themselves isn't shipping it yet seems a bit excessive though, ultimately it's the VSE module's choice what we support as they are maintaining the compat layer. Feels like a topic for the VSE module meetings.

Unsure, hard to say what downstream users like distro's are doing, pretty sure we could drop support for really old versions like 3.x without causing too much discomfort for downstream users, requiring 7.0 when even even blender themselves isn't shipping it yet seems a bit excessive though, ultimately it's the VSE module's choice what we support as they are maintaining the compat layer. Feels like a topic for the VSE module meetings.
Member

Unsure, hard to say what downstream users like distro's are doing, pretty sure we could drop support for really old versions like 3.x without causing too much discomfort for downstream users, requiring 7.0 when even even blender themselves isn't shipping it yet seems a bit excessive though, ultimately it's the VSE module's choice what we support as they are maintaining the compat layer. Feels like a topic for the VSE module meetings.

I fear there is a misunderstanding. This code does not require 7.0 it just supports it, because the old code uses deprecated functions that were removed now with 7.0. 6.0 is definitely supported and apparently so is 5.1 according to @Robert-Andre-Mauchin. Also, it would be weird if a distro supports a new version of blender but not a somewhat recent version of ffmpeg. Disscussing this in a VSE module meeting is a good idea. We should wait with merging either PR then.

> Unsure, hard to say what downstream users like distro's are doing, pretty sure we could drop support for really old versions like 3.x without causing too much discomfort for downstream users, requiring 7.0 when even even blender themselves isn't shipping it yet seems a bit excessive though, ultimately it's the VSE module's choice what we support as they are maintaining the compat layer. Feels like a topic for the VSE module meetings. I fear there is a misunderstanding. This code does **not require** 7.0 it just supports it, because the old code uses deprecated functions that were removed now with 7.0. 6.0 is definitely supported and apparently so is 5.1 according to @Robert-Andre-Mauchin. Also, it would be weird if a distro supports a new version of blender but not a somewhat recent version of ffmpeg. Disscussing this in a VSE module meeting is a good idea. We should wait with merging either PR then.
Author
First-time contributor

Unsure, hard to say what downstream users like distro's are doing, pretty sure we could drop support for really old versions like 3.x without causing too much discomfort for downstream users, requiring 7.0 when even even blender themselves isn't shipping it yet seems a bit excessive though, ultimately it's the VSE module's choice what we support as they are maintaining the compat layer. Feels like a topic for the VSE module meetings.

I have been patching projects for FFmpeg 7.0 for the past 20 days, the minimum supported version I have seen is 4.1.x, no one use 3.x or below. The new API for ch_layout started in 5.1. Audaspace 1.5.0 may be affected by 2a68d945cd, which is 7.0 only but uses a NULL value where the const was added.

From my analysis of 1.5.0, FFmpeg functions and their last signature change/introduction :

AVFMT_GLOBALHEADER 0.6.1
AVIO_FLAG_WRITE 0.7.1
AVMEDIA_TYPE_AUDIO 0.6.1
AVPacket 0.6.1
AVRational 0.6.1
AVSEEK_SIZE 0.7.1
AVSampleFormat 0.7.1
AV_CH_LAYOUT_MONO 1.1
AV_CODEC_FLAG_GLOBAL_HEADER 2.8
AV_NOPTS_VALUE 1.0
LIBAVUTIL_VERSION_INT 1.0
av_frame_alloc 2.0
av_free 0.6.1
av_get_alt_sample_fmt 0.9
av_get_packed_sample_fmt 0.11
av_packet_alloc 3.0
av_packet_unref 2.1
av_q2d 0.6.1
av_rescale_q 0.6.1
av_sample_fmt_is_planar 0.9
av_samples_get_buffer_size 0.9
av_seek_frame 2.2
av_write_frame 4.3
avcodec_alloc_context3 1.0
avcodec_fill_audio_frame 0.10
avcodec_find_decoder 5.0
avcodec_find_encoder 5.0
avcodec_flush_buffers 0.6.1
avcodec_free_context 2.3
avcodec_open2 0.9
avcodec_parameters_to_context 3.1
avcodec_receive_frame 3.1
avcodec_receive_packet 3.1
avcodec_send_frame 3.1
avcodec_send_packet 3.1
avformat_alloc_context 5.0
avformat_alloc_output_context2 5.0
avformat_close_input 0.10
avformat_find_stream_info 0.9
avformat_open_input 0.7.1
avio_alloc_context -> changed in 7.0 but Audaspace uses NULL for write_packet, so previous siganture was 0.7.1
avio_closep 1.1
codecpar 4.0
streams 4.0

And ch_layout introduced in 5.1, channel_layout definitely removed in 7.0.

So for Audaspace 1.50, if you guard the use of ch_layout, you can go as old as 5.0 because of avcodec_find_decoder / avcodec_find_encoder. If you keep the old code, I'm not sure.

5.1 is 2022-07-22

Debian Buster, the oldest Debian stable, has 4.1.11, the 4.1.x started in 2018-11-05.
For Centos/RHEL 8, RPMFusion provides FFmpeg 4.2.9.

> Unsure, hard to say what downstream users like distro's are doing, pretty sure we could drop support for really old versions like 3.x without causing too much discomfort for downstream users, requiring 7.0 when even even blender themselves isn't shipping it yet seems a bit excessive though, ultimately it's the VSE module's choice what we support as they are maintaining the compat layer. Feels like a topic for the VSE module meetings. > > I have been patching projects for FFmpeg 7.0 for the past 20 days, the minimum supported version I have seen is 4.1.x, no one use 3.x or below. The new API for ch_layout started in 5.1. Audaspace 1.5.0 may be affected by https://github.com/FFmpeg/FFmpeg/commit/2a68d945cd74265bb71c3d38b7a2e7f7d7e87be5, which is 7.0 only but uses a NULL value where the const was added. From my analysis of 1.5.0, FFmpeg functions and their last signature change/introduction : AVFMT_GLOBALHEADER 0.6.1 AVIO_FLAG_WRITE 0.7.1 AVMEDIA_TYPE_AUDIO 0.6.1 AVPacket 0.6.1 AVRational 0.6.1 AVSEEK_SIZE 0.7.1 AVSampleFormat 0.7.1 AV_CH_LAYOUT_MONO 1.1 AV_CODEC_FLAG_GLOBAL_HEADER 2.8 AV_NOPTS_VALUE 1.0 LIBAVUTIL_VERSION_INT 1.0 av_frame_alloc 2.0 av_free 0.6.1 av_get_alt_sample_fmt 0.9 av_get_packed_sample_fmt 0.11 av_packet_alloc 3.0 av_packet_unref 2.1 av_q2d 0.6.1 av_rescale_q 0.6.1 av_sample_fmt_is_planar 0.9 av_samples_get_buffer_size 0.9 av_seek_frame 2.2 av_write_frame 4.3 avcodec_alloc_context3 1.0 avcodec_fill_audio_frame 0.10 avcodec_find_decoder 5.0 avcodec_find_encoder 5.0 avcodec_flush_buffers 0.6.1 avcodec_free_context 2.3 avcodec_open2 0.9 avcodec_parameters_to_context 3.1 avcodec_receive_frame 3.1 avcodec_receive_packet 3.1 avcodec_send_frame 3.1 avcodec_send_packet 3.1 avformat_alloc_context 5.0 avformat_alloc_output_context2 5.0 avformat_close_input 0.10 avformat_find_stream_info 0.9 avformat_open_input 0.7.1 avio_alloc_context -> changed in 7.0 but Audaspace uses NULL for write_packet, so previous siganture was 0.7.1 avio_closep 1.1 codecpar 4.0 streams 4.0 And ch_layout introduced in 5.1, channel_layout definitely removed in 7.0. So for Audaspace 1.50, if you guard the use of ch_layout, you can go as old as 5.0 because of avcodec_find_decoder / avcodec_find_encoder. If you keep the old code, I'm not sure. 5.1 is 2022-07-22 Debian Buster, the oldest Debian stable, has 4.1.11, the 4.1.x started in 2018-11-05. For Centos/RHEL 8, RPMFusion provides FFmpeg 4.2.9.
Member

Thanks for that thorough investigation! That should help with the decision. Maybe one more question: do you know which versions of blender these distros ship?

Thanks for that thorough investigation! That should help with the decision. Maybe one more question: do you know which versions of blender these distros ship?

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#121948
No description provided.