Verify ffmpeg and other image and video libraries use optimal build flags #70529

Closed
opened 2019-10-04 16:41:00 +02:00 by Brecht Van Lommel · 16 comments

For example, we build ffmpeg with --disable-sse, which seems like a wasted opportunity.

This task involves going over libraries in build_files/build_environment/cmake/ and verifying that:

  • SSE and SSE2 are enabled, since those are always supported by x86-64.
  • Check if SSE3/SSE4/AVX/AVX2 can be enabled, for libraries that can detect CPU capabilities and use them only when supported.
  • Check if multithreading is enabled where possible.
  • Test that the functionality still works correctly.
For example, we build ffmpeg with `--disable-sse`, which seems like a wasted opportunity. This task involves going over libraries in `build_files/build_environment/cmake/` and verifying that: - [x] SSE and SSE2 are enabled, since those are always supported by x86-64. - [x] Check if SSE3/SSE4/AVX/AVX2 can be enabled, for libraries that can detect CPU capabilities and use them only when supported. - [x] Check if multithreading is enabled where possible. - [x] Test that the functionality still works correctly.
Author
Owner

Added subscriber: @brecht

Added subscriber: @brecht

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Added subscriber: @tintwotin

Added subscriber: @tintwotin

This ffmpeg setting will enable hardware acceleration -hwaccel auto and this one -tune fastdecode will allow a much faster playback in Blender(going from 20 fps to 30 fps on my low spec computer with a h.264 encoded file): https:*trac.ffmpeg.org/wiki/HWAccelIntro Some code for building ffmpeg with NVENC and VAAPI hardware-accelerated support: https:*gist.github.com/Brainiarc7/3f7695ac2a0905b05c5b Several builds of ffmpeg with hardware acceleration: https://github.com/Brainiarc7

This ffmpeg setting will enable hardware acceleration `-hwaccel auto` and this one `-tune fastdecode` will allow a much faster playback in Blender(going from 20 fps to 30 fps on my low spec computer with a h.264 encoded file): https:*trac.ffmpeg.org/wiki/HWAccelIntro Some code for building ffmpeg with NVENC and VAAPI hardware-accelerated support: https:*gist.github.com/Brainiarc7/3f7695ac2a0905b05c5b Several builds of ffmpeg with hardware acceleration: https://github.com/Brainiarc7

Added subscriber: @Ja_cko

Added subscriber: @Ja_cko

Might it be possible to add support for HAP (free, open-source) codecs to ffmpeg within Blender? I believe it would only require adding --with-snappy build flag (see https://hap.video/using-hap.html). HAP has becomes very popular in stage productions / VJ circles because of its playback performance. I'm not sure if this is the right place to ask this, but at least the topic is relevant! Please advise if there's better place to ask. Thanks!

Might it be possible to add support for HAP (free, open-source) codecs to ffmpeg within Blender? I believe it would only require adding `--with-snappy` build flag (see https://hap.video/using-hap.html). HAP has becomes very popular in stage productions / VJ circles because of its playback performance. I'm not sure if this is the right place to ask this, but at least the topic is relevant! Please advise if there's better place to ask. Thanks!

This issue was referenced by 5b2bfb2fed

This issue was referenced by 5b2bfb2fed03274bd0bc2007c66118ca33c9f1ca

Currently, the VSE ffmpeg lib can't decode AV1. Ex: https://www.youtube.com/watch?v=PVGeM40dABA
Ffmpeg 4.2 includes a AV1 decoder: https://hub.packtpub.com/ffmpeg-4-2-releases-with-av1-decoding-support-through-libdav1d-decoding-of-hevc-444-content-and-more/
And an AV1 encoder: https://trac.ffmpeg.org/wiki/Encode/AV1

Other new ffmpeg supported codecs: hevc-444 and Cineform(GoPro - edit friendly).

Currently, the VSE ffmpeg lib can't decode AV1. Ex: https://www.youtube.com/watch?v=PVGeM40dABA Ffmpeg 4.2 includes a AV1 decoder: https://hub.packtpub.com/ffmpeg-4-2-releases-with-av1-decoding-support-through-libdav1d-decoding-of-hevc-444-content-and-more/ And an AV1 encoder: https://trac.ffmpeg.org/wiki/Encode/AV1 Other new ffmpeg supported codecs: hevc-444 and Cineform(GoPro - edit friendly).

There is a new ffmpeg gui which includes options for all the new HDR 10 bit formats and Nvidia based hardware encoding here:
https://github.com/CineEncoder/cine-encoder
It may be useful to generate test files to detect what codecs currently aren't supported by by the Blender built-in ffmpeg and also compare render times with and without hardware acceleration, in order the check the necessary build flags are being set.
All the new hardware settings in ffmpeg explained: https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/#disqus_thread

There is a new ffmpeg gui which includes options for all the new HDR 10 bit formats and Nvidia based hardware encoding here: https://github.com/CineEncoder/cine-encoder It may be useful to generate test files to detect what codecs currently aren't supported by by the Blender built-in ffmpeg and also compare render times with and without hardware acceleration, in order the check the necessary build flags are being set. All the new hardware settings in ffmpeg explained: https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/#disqus_thread

Compiling FFmpeg with NVIDIA hardware accelerated settings: https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/index.html

Compiling FFmpeg with NVIDIA hardware accelerated settings: https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/index.html

Added subscriber: @clayhands

Added subscriber: @clayhands

This issue was referenced by 88604b79b7

This issue was referenced by 88604b79b7d15f8aa86fbd2d23d58541aa927313

This issue was referenced by 1614795ae2

This issue was referenced by 1614795ae2bfc6369f28ff82811b432fceb57eb0

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Richard Antalik self-assigned this 2021-04-01 12:12:04 +02:00

Added my commits that seems to be relevant.

Since all parts of task have been resolved, closing task as resolved.

Added my commits that seems to be relevant. Since all parts of task have been resolved, closing task as resolved.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
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
7 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#70529
No description provided.