Commit Graph

632 Commits

Author SHA1 Message Date
FeRD (Frank Dana)
f3c35da5c8 Don't break older cmake with new policy 2019-04-05 00:49:27 -04:00
FeRD (Frank Dana)
3d8c2412f0 Bindings build in CMake 3.1-3.14+ 2019-04-05 00:07:59 -04:00
Jonathan Thomas
9dbb063ded Persist any error returned by JUCE during initialise() method, such as sample rate issues on Windows (when playback and recording sample rates do not match, which breaks WASAPI) 2019-04-04 00:55:47 -05:00
Jonathan Thomas
3f17601db6 Invalid SetMaxSize Logic and Invalid CRF q settings in FFmpegWriter (#198)
* Limit max size of preview to the timeline size (this renders very small profiles correctly)

* Fixing CRF quality setting to allow "low" quality without breaking
2019-03-09 13:19:07 -06:00
Jonathan Thomas
8f385c112a Improved Keyframe Performance (#197)
* Refactor of Coorindate and Keyframe optimized for performance (much faster than previously). Also refactored FrameMapper to not use a Keyframe, and to only process frame mapping when needed... speeding up Json loading of project files.

* Fixing FrameMapper linear calculation to match existing Keyframe calculation

* Fixing Keyframe to pass original unit tests, and correctly calculate the Keyframe repeat fractions and deltas.

* Small refactor of time mapped logic in Clip.cpp
2019-03-06 15:35:03 -06:00
Jonathan Thomas
728e0022a2 MP3 Special Handling & Missing Frame Refactor (#196)
* Handle MP3 files with special logic, since they typically only have 1 frame of video

* Better support for missing frames (handling of missing audio and missing video data separated), and fixed a missing audio regression.
2019-02-27 23:25:54 -06:00
Jonathan Thomas
1bf3e37567 Refactor FFmpegWriter Open() and PrepareStreams() methods, so that SetOption() is can be called between them, and allowed to adjust the codecs bit_rate and options before we call open_video(). This was primarily to allow CRF options to work. (#193) 2019-01-28 12:28:35 -06:00
Jonathan Thomas
f66ccb11c4 Set video bit rate to 0 if an invalid bit rate detected (which happens when using crf) (#191) 2019-01-26 17:56:15 -06:00
Jonathan Thomas
0587ada6dc Integrate Constant Rate Factor (CRF) for FFmpegWriter (#186)
* First implementation of CRF (Constant Rate Factor)

* Include AV1 in the codecs that can use crf

* First version that uses SetOption to set crf quality

* Clarify comments

* Delete setting the bitrate for crf in SetVideoOption because it
is not needed, it is set later with SetOptions.
2019-01-25 00:15:07 -06:00
Frank Dana
c4321f3f8e Some polishing for the cmake ReSVG discovery (#187)
* Search for libresvg.so in RESVGDIR also

This means that RESVGDIR can be pointed to the `target/release` dir 
where resvg was built, and both `libresvg.so` and `include/resvg.h` will 
be found.

* ReSVG: Fix up discovery module

`find_package_handle_standard_args` is supposed to set the `_FOUND` 
variable automatically (as the comment right above it says), as well as 
handling things like REQUIRED, QUIETLY, etc. It should always be run at 
the end of a module, for this reason.

This change removes the conditionals around the call, lets it handle 
what it's meant to handle, and defines a custom failure message for 
discovery that replaces the one in `src/CMakeList.txt`. 

In addition, the `REQRUIRED` is removed from `tests/CMakeLists.txt`, 
since it's _supposed_ to mark the module as required (which ReSVG is 
not), and was only working due to the aforementioned improper 
conditional wrapping of the module's cleanup.

* FindRESVG.cmake does not set RESVG_DEFINITIONS

Remove the comment that claims it does.
2019-01-24 13:43:40 -06:00
Jonathan Thomas
f009b0f46c Fix default sizes on readers without MAX_WIDTH and MAX_HEIGHT settings (#188) 2019-01-22 22:14:30 -06:00
Jonathan Thomas
7b6eb9c21b Integration of resvg SVG library (optional during build) (#185)
* Integration of libresvg SVG library (optional during build)

* Major refactor of max_width and max_height for preview optimization

* Fixed many bugs related to preview resizing, with regards to cached frames

* Updating gitlab CI to find RESVGDIR correctly for windows, and adding svgz support

* Updating cmake findresvg module to search for windows locations first, to prevent an issue on our windows builders and updating some CMake output.

* Removing folder path from resvg header, since it could be installed in different named folders. This is an attempt to fix Windows include issues.

* Making call to AV_FREE_FRAME conditional for non windows systems (because it crashes on Windows for seemingly no reason). Needs more investigation.
2019-01-19 02:18:52 -06:00
Jonathan Thomas
13bd272ead Adding new settings class to be used for changing realtime settings used by libopenshot, such as scaling mode for preview vs final render, or hardware decode, etc... 2019-01-09 16:50:40 -06:00
Jonathan Thomas
e0ec603965 Fixing Scale Mode (None) in previews (#182)
* Handle SCALE_NONE mode when optimized for previews (previews are often smaller than the project size)

* Fixing 2 memory leaks (thanks PeterM)
2019-01-09 00:56:49 -06:00
Jonathan Thomas
4ed7847fa9 Improving cache performance by preventing the cache from getting behind the currently displaying frame # 2018-12-14 14:38:33 -06:00
Jonathan Thomas
031c415c5f Protect effects with critical (prevents crashing and freezing around transitions). Thanks Peter! 2018-09-21 17:11:56 -05:00
Jonathan Thomas
b63a63ceb2 Fix many bugs around FPS and video length calculation (especially for MP3 and streaming WEBM formats). Also protecting samples_per_frame calculation to keep from crashing on undetected FPS. 2018-09-17 00:27:30 -05:00
Jonathan Thomas
6b37ad7e1d Limiting threads for both FFmpeg and OpenMP (attempting to find a good balance of parallel performance, while not spawning too many threads). Sometimes more is not always better. 2018-09-11 10:48:30 -05:00
Jonathan Thomas
e879188a7d FFmpeg 3 & 4 support, Travis CI support, OpenMP schedule change (#160)
* FFmpeg4 support. Compile warnings fixes. Credit goes to many people, including ferdnyc, peterM, and other awesome folks!

* Adding environment checking to enable/disable omp taskwait after each video/audio frame is processed. This is experimental for some users with crashes.

* Moving `omp taskwait` to after the ProcessVideoPacket() method, since that is the only place it is useful.

* Fixing crashes on missing Clip source file, and changing FFmpeg scaling algorthm from SWS_BILINEAR to  SWS_LANCZOS (for higher quality scaling)

* Update FindFFmpeg.cmake module, and updating build script. Also enabling debug builds.

* Updating experimental travis build script

* Fixed unit test for newer version of FFmpeg (audio resampling)

* Experimental travis multiple jobs

* Adding OMP schedule hint (thanks PeterM), which prevents crashes in some circumstances.
2018-09-11 00:40:31 -05:00
Jonathan Thomas
526be42a8d Merge branch 'develop' into fix-install-paths 2018-08-08 02:19:09 -05:00
Jonathan Thomas
d11f14b0dc Merge branch 'develop' into fix-install-paths 2018-08-08 02:15:11 -05:00
Jonathan Thomas
7a20aae58f Merge branch 'develop' into fix-ffmpeg3_2-empty-frames 2018-08-08 02:11:34 -05:00
Jonathan Thomas
da01a2c4cb Adding "reader" property for Mask effect, to allow the user to adjust the image or video used by the mask effect. 2018-08-02 00:42:14 -05:00
Jonathan Thomas
435932f415 Fixing another issue where larger FPS files are incorrectly changed to a different FPS 2018-08-02 00:40:44 -05:00
Jonathan Thomas
93c1e2eb49 Fixing bitrate calculation (to be in bytes instead of bits), and adding in FPS detection for files which don't have valid FPS. In those cases (streaming files for example), we iterate through all packets, and average the # of frames, duration, bit rate, etc... Not idealy, but a better fallback. 2018-07-25 02:24:01 -05:00