Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-03-26FFmpeg: improve threading settingsRichard Antalik
Generalize threading settings in proxy building and use them for encoding and decoding in general. Check codec capabilities, prefer FF_THREAD_FRAME threading over FF_THREAD_SLICE and automatic thread count over setting it explicitly. ffmpeg-codecs man page suggests that threads option is global and used by codecs, that supports this option. Form some tests I have done, it seems that `av_dict_set_int(&codec_opts, "threads", BLI_system_thread_count(), 0)` has same effect as ``` pCodecCtx->thread_count = BLI_system_thread_count(); pCodecCtx->thread_type = FF_THREAD_FRAME; ``` Looking at `ff_frame_thread_encoder_init()` code, these cases are not equivalent. It is probably safer to leave threading setup on libavcodec than setting up each codec threading individually. From what I have read all over the internet, frame multithreading should be faster than slice multithreading. Slice multithreading is mainly used for low latency streaming. When running Blender with --debug-ffmpeg it complains about `pCodecCtx->thread_count = BLI_system_thread_count()` that using thread count above 16 is not recommended. Using too many threads can negatively affect image quality, but I am not sure if this is the case for decoding as well - see https://streaminglearningcenter.com/blogs/ffmpeg-command-threads-how-it-affects-quality-and-performance.html This is fine for proxies but may be undesirable for final renders. Number of threads is limited by image size, because of size of motion vectors, so if it is possible let libavcodec determine optimal thread count. Performance difference: Proxy building: None Playback speed: 2x better on 1920x1080 sample h264 file Scrubbing: Hard to quantify, but it's much more responsive Rendering speed: None on 1920x1080 sample h264 file, there is improvement with codecs that do support FF_THREAD_FRAME for encoding like MPNG Reviewed By: sergey Differential Revision: https://developer.blender.org/D10791
2021-02-15FFmpeg: Improve multi-threading settingsSergey Sharybin
Allow use all system threads for frame encoding/decoding. This is very straightforward: the value of zero basically disables threading. Change threading policy to slice when decoding frames. The reason for this is because decoding happens frame-by-frame, so inter-frame threading policy will not bring any speedup. The change for threading policy to slice is less obvious and is based on benchmark of the demo files from T78986. This gives best performance so far. Rendering the following file went down from 190sec down to 160sec. https://storage.googleapis.com/institute-storage/vse_simplified_example.zip This change makes both reading and writing faster. The animation render is just easiest to get actual time metrics. Differential Revision: https://developer.blender.org/D8627
2020-10-19Fix T68343: Rendered video plays at 600fpsRichard Antalik
Field time_base of video stream must be set for some containers, otherwise avformat_write_header() will set it to default values. Rendered file in such case won't be played at desired frame rate. See init_muxer() in mux.c in ffpmeg sources. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9213
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-09-30Cleanup: convert gforge task ID's to phabricator formatValentin
Cleanup old tracker task format to the new. e.g: [#34039] to T34039 Ref D8718
2020-05-22Fix T74443: No render in VP9 lossless modePhilipp Oeser
We define Lossless as CRF 0 (which is usually the best quality and is working fine with other codecs afaict), but since WebM only allows for CRF values between 2-32 and actually has a dedicated "lossless" mode, I suggest using that (it produces large files though, so double-checking would be welcome). https://trac.ffmpeg.org/wiki/Encode/VP9#LosslessVP9 Maniphest Tasks: T74443 Differential Revision: https://developer.blender.org/D7800
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-13Cleanup: pass const args (mostly Scene & RenderData)Campbell Barton
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2019-08-01FFmpeg pixel format conversion improvementsSybren A. Stüvel
FFmpeg expects Blender to feed it pixels in the output pixel format. If the output pixel format is different than Blender's RGBA, a conversion is needed (via FFmpeg's `sws_scale()` function). There were a few issues with this conversion (and surrounding code) that are fixed in this commit: - When conversion was necessary a temporary buffer was allocated and deallocated for every frame. This is now allocated once and re-used. - Copying data to the buffer was done byte-for-byte. On little-endian machines it is now done line-by-line using `memcpy` for a little speedup. - The decision whether pixel format conversion is necessary is now correctly done based on the pixel format Blender is actually using. - The pixel format of the buffer sent to FFmpeg is no longer hard-coded incorrectly to a fixed pixel format, but uses the actual output pixel format. This is fixes T53058 properly, making RGB QTRLE export possible. - I added some comments to make it clear which pixel format is referred to (either Blender's internal format or the FFmpeg output format). Combined these improvements not only correct a bug (T53058) but also results in approximately 5% speed improvement (tested with a 117-frame shot from Spring, loaded as PNGs in the VSE, encoding to h.264 with preset 'realtime'). Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D5174
2019-07-31Fix Visual Studio compatibility in writeffmpeg.cSybren A. Stüvel
This fixes an incompatibility with Visual Studio 2019 introduced in 631d5026c7bb34320c5d9b60afa5bc44b40fc5e4. It is likely caused by using `# ifdef` inside the use of the `ELEM()` macro.
2019-07-31FFmpeg: Added writing of WebM containersSybren A. Stüvel
This commit adds support for the WebM container. Previously we only supported the WebM/VP9 video codec, but still required that it was stored in a Matroska, MP4, or other compatible container format. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5156
2019-07-31FFmpeg: Added support for writing alpha values in WebM/VP9 videoSybren A. Stüvel
The VP9 video codec supports writing alpha values; now this is available in Blender too. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5156
2019-07-31Cleanup: Simplification of `BKE_ffmpeg_alpha_channel_is_supported()`Sybren A. Stüvel
Simplified `BKE_ffmpeg_alpha_channel_is_supported()` to use `ELEM()` instead of a row consecutive `if`-statements. No functional changes. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5156
2019-07-02Fix T53058: Crash when rendering to Quicktime RLE codecSybren A. Stüvel
The root cause seems to be an assumption in [generate_video_frame()](https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/writeffmpeg.c) that we're always using 4 bytes per pixel. This is not true when using QTRLE in RGB mode, because that uses the RGB24 pixel format (so 3 bytes per pixel). Just updating the `linesize` property doesn't fix it though, but just creates a crash somewhere else. This at least fixes the crash by always forcing RGBA to be written, even when the user selects RGB.
2019-06-30Fixed compiler warningSybren A. Stüvel
`(1L << 31)` can cause an integer overflow on 32-bit systems, `(1UL << 31)` won't. Fixed as per LazyDodo's suggestion in https://developer.blender.org/rB956cb4f403dd3a6ddb379202dc1f2770b9820073#238718
2019-06-29Cleanup: Fix build warnings with MSVC.Ray Molenkamp
ffmpeg defines some of the math constants if they are not found before including any of its headers, this lead to a build warnings about M_E, M_LN2 and M_SQRT1_2 being redefined once BLI_math_base.h gets included.
2019-06-14Fix T65803: MPEG4 unsupported timebase denominatorSybren A. Stüvel
- MPEG4/DivX has a maximum value of 65535 for the timebase denominator. - MPEG1 and 2 have a list of supported frame rate ratios. These use ratios like 24000/1001 and need those exact numbers. This fixes an issue introduced in c5b1e7cd4e86f9aff010fa84192d783b895ce6c7 where the correct ratio was passed to FFmpeg, but not with the identical numbers FFmpeg has in a lookup table.
2019-06-11FFmpeg: Fix integer overflow when writing custom FPS with high denominatorSybren A. Stüvel
FFmpeg uses a fraction of integers to indicate the frame rate, whereas Blender uses `int / float`. When a custom frame rate is used with non-integer base, the FPS and Base settings were multiplied with 100000 before passing to FFmpeg as `int`. This could overflow when a high enough FPS setting was used, which is the case when importing a video of almost-but-not-quite-integer frame rate into the VSE. The overflow caused FFmpeg to return an error "The encoder timebase is not set", which is rather cryptic for users. The new solution is to take the max int and divide that by the frame rate, and use that ratio to pass to FFmpeg. This won't overflow, and thus allows exporting arbitrary frame rates.
2019-05-16Refactor: Simplify ID Property freeingJacques Lucke
This also makes `IDP_CopyProperty` the "opposite" of `IDP_FreeProperty`, which is what I'd expect. Two refactoring steps: * rename IDP_FreeProperty to IDP_FreePropertyContent * new IDP_FreeProperty function that actually frees the property Reviewers: brecht Differential Revision: https://developer.blender.org/D4872
2019-05-01ClangFormat: run with ReflowComments on source/Campbell Barton
Prepare for enabling ReflowComments.
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-22Cleanup: style, use braces for blenkernelCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2018-12-11FFmpeg: enable multi-threaded encoding of multiple frames, for a ~20% speedup.Mal Duffin
This enables ffmpeg to encode each frame in its own thread. However in most cases Blender does not pass frames to ffmpeg fast enough to actually use the more than two threads. In some tests the speed was measured to be about 20%. If other parts of the video sequencer get optimized, this should improve. Differential Revision: https://developer.blender.org/D4031
2018-11-07Cleanup: Remove 'BKE_library.h' include from 'BKE_main.h'Bastien Montagne
That kind of implicit includes should really only be done when totally, absolutely necessary, and ideally only with rather simple 'second-level' headers. Otherwise not being explicit with includes always end up biting in unexpected ways...
2018-10-18Cleanup: Remove more #if 0 blocksJacques Lucke
Continuation of https://developer.blender.org/D3802 Reviewers: brecht Differential Revision: https://developer.blender.org/D3808
2018-09-28Merge branch 'master' into blender2.8Sergey Sharybin
2018-09-28Fix T56905: unsupported channel layout error writing AAC audio.Brecht Van Lommel
This uses same mapping as Audaspace to specify channel layout, which was missing before.
2018-06-17Merge branch 'master' into blender2.8Campbell Barton
2018-06-17Cleanup: trailing space for blenkernelCampbell Barton
2018-06-05Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/blenkernel/intern/blendfile.c source/blender/blenloader/intern/readfile.h source/blender/blenloader/intern/versioning_250.c source/blender/blenloader/intern/versioning_260.c source/blender/blenloader/intern/versioning_270.c source/blender/blenloader/intern/versioning_legacy.c source/blender/editors/render/render_shading.c source/blender/makesrna/intern/rna_movieclip.c source/blender/render/intern/source/pipeline.c source/blender/render/intern/source/voxeldata.c
2018-06-05Cleanup: use new accessors to blendfile path (Main.name).Bastien Montagne
2018-06-01Merge branch 'master' into blender2.8Campbell Barton
2018-06-01Cleanup: trailing whitespace (comment blocks)Campbell Barton
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-05-08Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/modifiers/intern/MOD_dynamicpaint.c source/blender/modifiers/intern/MOD_uvproject.c
2018-05-08Fix building with latest versions of ffmpeg.Bastien Montagne
Some years-old deprecated stuff has now been removed. Correct solution is probably to use valid defines etc. in own code, but this is more FFMEPG maintainer task (since it also may change how old FFMPEG we do support...).
2018-04-19Remove Blender Internal and legacy viewport from Blender 2.8.Ton Roosendaal
Brecht authored this commit, but he gave me the honours to actually do it. Here it goes; Blender Internal. Bye bye, you did great! * Point density, voxel data, ocean, environment map textures were removed, as these only worked within BI rendering. Note that the ocean modifier and the Cycles point density shader node continue to work. * Dynamic paint using material shading was removed, as this only worked with BI. If we ever wanted to support this again probably it should go through the baking API. * GPU shader export through the Python API was removed. This only worked for the old BI GLSL shaders, which no longer exists. Doing something similar for Eevee would be significantly more complicated because it uses a lot of multiplass rendering and logic outside the shader, it's probably impractical. * Collada material import / export code is mostly gone, as it only worked for BI materials. We need to add Cycles / Eevee material support at some point. * The mesh noise operator was removed since it only worked with BI material texture slots. A displacement modifier can be used instead. * The delete texture paint slot operator was removed since it only worked for BI material texture slots. Could be added back with node support. * Not all legacy viewport features are supported in the new viewport, but their code was removed. If we need to bring anything back we can look at older git revisions. * There is some legacy viewport code that I could not remove yet, and some that I probably missed. * Shader node execution code was left mostly intact, even though it is not used anywhere now. We may eventually use this to replace the texture nodes with Cycles / Eevee shader nodes. * The Cycles Bake panel now includes settings for baking multires normal and displacement maps. The underlying code needs to be merged properly, and we plan to add back support for multires AO baking and add support to Cycles baking for features like vertex color, displacement, and other missing baking features. * This commit removes DNA and the Python API for BI material, lamp, world and scene settings. This breaks a lot of addons. * There is more DNA that can be removed or renamed, where Cycles or Eevee are reusing some old BI properties but the names are not really correct anymore. * Texture slots for materials, lamps and world were removed. They remain for brushes, particles and freestyle linestyles. * 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and other renderers use this to find all panels to show, minus a few panels that they have their own replacement for.
2018-04-09Merge branch 'master' into blender2.8Sybren A. Stüvel
2018-04-09Added support for the WEBM/VP9 video codecSybren A. Stüvel
WEBM is the codec name, and VP9 is the encoder (the older encoder "VP8" is less efficient than VP9). WEBM/VP9 and h.264 both have options to control the file size versus compression time (e.g. fast but big, or slow and small, for the same output quality). Since WEBM/VP9 only has three choices, I've chosen to map those to 3 of the 9 possible choices of h.264: - BEST → SLOWER - GOOD → MEDIUM - REALTIME → SUPERFAST The VERYSLOW and ULTRAFAST options give very little extra benefit. Reviewed by: @Severin
2018-04-05Merge branch 'master' into blender2.8Sybren A. Stüvel
2018-04-05Write StampData metadata to video filesSybren A. Stüvel
This is currently only supported by FFmpeg (so not frameserver, AVI RAW, or AVI JPEG), and only seems to work when using Matroska or Ogg Theora containers. Only metadata that doesn't change from frame to frame is written to video files. This distinction is visible in the UI by looking at the stamp checkbox tooltips (they either mention "image" or "image/video"). Part of: https://developer.blender.org/D2273 Reviewed by: @campbellbarton
2018-01-16Merge branch 'master' into blender2.8Campbell Barton
2018-01-16Cleanup: indentationCampbell Barton
2017-10-17Merge branch 'master' into blender2.8Campbell Barton
2017-10-17Cleanup: use 'e' prefix for enum typedefsCampbell Barton
Convention was only followed loosely, apply to DNA where changes aren't likely to conflict. (Skipped ModifierType for eg).
2017-09-19Merge branch 'master' into blender2.8Sergey Sharybin