Commit Graph

328 Commits

Author SHA1 Message Date
Jonathan Thomas
1c2786de35 SCALE_NONE was incorrectly sizing SVG, Image, and Video files. Since OpenShot changes the preview window size during editing, the SCALE_NONE clips should always be scaled to the ratio: preview / timeline... so they stay relative sized to the timeline size.
For example, if an SVG is 500px wide, and the project is 1000px wide... the SVG in SCALE_NONE mode should always be 50% with width of the video, regardless of how small you make the preview window.
2021-08-11 12:10:46 -05:00
Jonathan Thomas
9ca63b321a Reverting video_timestamp increment logic which used pkt.duration. In some codecs (such as vp8), this approach breaks due to differences in the timebase vs the framerate. For example, if the timebase is an inverse of the FPS, everything works. But if the timebase is not, for example 1/1000000, this approach breaks. 2021-07-03 17:01:55 -05:00
Frank Dana
8a81452bdf Move FFmpeg hwaccel checks to CMake, eliminate #pragma messages (#645)
* Rename HAVE_HW_ACCEL to USE_HW_ACCEL
* CMake: Add USE_HW_ACCEL option, default on
* CMake: #define USE_HW_ACCEL, display as build feature
2021-06-04 21:32:29 -04:00
Frank Dana
3f9b402ea4 FFmpegReader: Throw correct exception (#647)
The only reason an `AV_ALLOCATE_FRAME()` could fail is because
there wasn't enough memory to allocate the necessary buffers,
so if it returns a `nullptr` then throwing `OutOfMemory` makes
far more sense than throwing `OutOfBoundsFrame`.
2021-03-31 19:44:48 -04:00
Jonathan Thomas
8280e20aa5 Implementing Codacy improvements, removing some unused or pointless code 2021-02-18 18:07:07 -06:00
Jonathan Thomas
3daa5bdb7b Large refactor of OpenMP integration (or rather the removal of OpenMP on the Timeline and FFmpeg-related classes). The logic behind this decision, was based on profiling libopenshot and the amount of wasted CPU idle time on all the various threads. The slow code is still synchronous, and all the threads must wait on each other, adding additional overhead. So, removing lots of unneeded threads, and simplifying the underlying Timeline->Clip->FFmpegReader flow. Also, removed 2 calls to QPainter::drawImage, by improving the flexibility of Clip->GetFrame. 2021-02-17 19:44:44 -06:00
Jonathan Thomas
0c4e1bcce4 Improving performance after working with google-prof, to profile CPU. Calling OMP_MP_NUM_PROCESSORS less often, since it's quite expensive according to profiling. Adjusting Timeline final_cache to match the video caching thread max_frames, so one doesn't clobber the other. Also, fixing an issue with openshot-player, where a video file with no audio skips horribly. 2021-02-04 17:28:07 -06:00
Jonathan Thomas
47afa205c7 Merge pull request #585 from OpenShot/opencv
3 New OpenCV Effects (Tracker, Stabilization, and Object Detection)
2021-01-28 17:28:15 -06:00
Frank Dana
b5c3d0b598 Merge pull request #618 from ferdnyc/deprecate-TooManySeeks
Deprecate TooManySeeks, instead of removing
2021-01-26 22:59:06 -05:00
Jonathan Thomas
ec3123477c Merge pull request #390 from PhysSong/albumartfixes
Fix crashes and failures on decoding some types of album art images
2021-01-26 21:44:49 -06:00
FeRD (Frank Dana)
2f3615f706 Move Exceptions.h includes to .cpp files 2021-01-26 10:52:04 -05:00
FeRD (Frank Dana)
0cb9286da3 Merge branch 'fix-swig-flags' into opencv_build_config 2021-01-13 09:20:35 -05:00
Jonathan Thomas
75c4dbbaaa Fixing alpha videos, by handling the conversion to premultiplied RGBA separately 2020-12-31 17:35:49 -06:00
Hyunjin Song
c0db2609e8 Add a comment explaining FFmpegReader::HasAlbumArt()'s behavior 2020-10-20 11:01:42 +09:00
Brenno
1626e1eeba Merge branch 'clip-refactor-keyframes' into opencv 2020-10-19 22:29:48 -03:00
FeRD (Frank Dana)
04bcab42da Merge branch 'develop' into albumartfixes 2020-10-19 16:40:47 -04:00
FeRD (Frank Dana)
a1e44edad4 Merge branch 'develop' into clip-refactor-keyframes 2020-10-19 16:28:49 -04:00
FeRD (Frank Dana)
aa40ea29e0 Update include paths in all source/header files 2020-10-18 07:43:37 -04:00
Jonathan Thomas
1dfbb0e771 Merge branch 'develop' into clip-refactor-keyframes
# Conflicts:
#	src/CacheDisk.cpp
#	src/Clip.cpp
#	src/Frame.cpp
#	src/QtHtmlReader.cpp
#	src/QtImageReader.cpp
#	src/QtTextReader.cpp
#	src/effects/Bars.cpp
#	src/effects/Crop.cpp
2020-10-16 15:32:43 -05:00
Jonathan Thomas
8f6c64215e Merge pull request #556 from ferdnyc/use-make-shared
Use std::make_shared to allocate shared ptrs, instead of std::shared_ptr constructors
2020-10-16 14:48:14 -05:00
Jonathan Thomas
ef80439b62 Merge pull request #530 from ferdnyc/omp-and-ffmpeg-classes
Move off deprecated OpenMP API, fix FFmpeg code paths
2020-10-16 14:45:20 -05:00
Jonathan Thomas
6bd7fb7235 Replacing ARGB32_Premultiplied with Format_RGBA8888_Premultiplied, which still seems to benefit from performance, but keeps the byte order the same as before. win win 2020-10-14 03:06:30 -05:00
Jonathan Thomas
94059828d5 Converting RGB8888 to ARGB32_Premultiplied (for performance reasons) 2020-10-13 18:18:10 -05:00
Jonathan Thomas
fb879a4e46 Merge branch 'develop' into clip-refactor-keyframes
# Conflicts:
#	include/Clip.h
#	include/ReaderBase.h
#	include/Timeline.h
#	src/Clip.cpp
#	src/FFmpegReader.cpp
#	src/QtImageReader.cpp
#	src/ReaderBase.cpp
2020-10-05 23:14:44 -05:00
Jonathan Thomas
f9a717ef4b Large refactor of Timeline, TimelineBase, ClipBase, and Clip, to allow a Clip access to the parent timeline instance (if available), and thus, certain properties (preview size, timeline FPS, etc...). This allows for a simpler rendering of Clip keyframes (during the Clip::GetFrame method), and a simpler Timeline class, that can change the preview window size dynamically and no longer requires a Singleton Settings class.
- Also removed "crop" from Clip class, as it was never implmeneted correctly, and we have a fully functional "crop" effect when needed
 - Added caching to Clip class, to optimize previewing of cached frames (much faster than previous)
2020-10-04 16:59:21 -05:00