diff --git a/doc/HW-ACCEL.md b/doc/HW-ACCEL.md
index b8ee7b4e..cbcf5e63 100644
--- a/doc/HW-ACCEL.md
+++ b/doc/HW-ACCEL.md
@@ -7,20 +7,22 @@ our support for this in the future!
The following table summarizes our current level of support:
-| | Linux Decode | Linux Encode | Mac Decode | Mac Encode |Windows Decode| Windows Encode | Notes |
-|--------------------|------------------------|----------------------|------------------|----------------|--------------|------------------|------------------|
-| VA-API | :heavy_check_mark: | :heavy_check_mark: | - | - | - | - | *Linux Only* |
-| VDPAU | :heavy_check_mark:(+) |:white_check_mark:(++)| - | - | - | - | *Linux Only* |
-| CUDA (NVDEC/NVENC) | :x:(+++) | :heavy_check_mark: | - | - | - |:heavy_check_mark:| *Cross Platform* |
-| VideoToolBox | - | - |:heavy_check_mark:| :x:(++++) | - | - | *Mac Only* |
-| DXVA2 | - | - | - | - | :x:(+++) | - | *Windows Only* |
-| D3D11VA | - | - | - | - | :x:(+++) | - | *Windows Only* |
-| QSV | :x:(+++) | :x: | :x: | :x: | :x: | :x: | *Cross Platform* |
+| | Linux Decode | Linux Encode | Mac Decode | Mac Encode | Windows Decode | Windows Encode | Notes |
+|--------------------|:---------------:|:--------------:|:----------:|:--------------:|:--------------:|:--------------:|------------------|
+| VA-API | ✔️ | ✔️ | - | - | - | - | *Linux Only* |
+| VDPAU | ✔️ 1 | ✅ 2 | - | - | - | - | *Linux Only* |
+| CUDA (NVDEC/NVENC) | ❌ 3 | ✔️ | - | - | - | ✔️ | *Cross Platform* |
+| VideoToolBox | - | - | ✔️ | ❌ 4 | - | - | *Mac Only* |
+| DXVA2 | - | - | - | - | ❌ 3 | - | *Windows Only* |
+| D3D11VA | - | - | - | - | ❌ 3 | - | *Windows Only* |
+| QSV | ❌ 3 | ❌ | ❌ | ❌ | ❌ | ❌ | *Cross Platform* |
-* *(+) VDPAU for some reason needs a card number one higher than it really is*
-* *(++) VDPAU is a decoder only.*
-* *(+++) Green frames (pixel data not correctly tranferred back to system memory)*
-* *(++++) Crashes and burns*
+#### Notes
+
+1. VDPAU for some reason needs a card number one higher than it really is
+2. VDPAU is a decoder only
+3. Green frames (pixel data not correctly tranferred back to system memory)
+4. Crashes and burns
## Supported FFmpeg Versions
@@ -37,7 +39,7 @@ included.
The following settings are use by libopenshot to enable, disable, and control
the various hardware acceleration features.
-```
+```{cpp}
/// Use video codec for faster video decoding (if supported)
int HARDWARE_DECODER = 0;
@@ -76,9 +78,9 @@ in Ubuntu 18.04) for the AppImage to work with hardware acceleration.
An AppImage that works on both systems (supporting libva and libva2),
might be possible when no libva is included in the AppImage.
-* vaapi is working for intel and AMD
-* vaapi is working for decode only for nouveau
-* nVidia driver is working for export only
+* vaapi is working for intel and AMD
+* vaapi is working for decode only for nouveau
+* nVidia driver is working for export only
## AMD Graphics Cards (RadeonOpenCompute/ROCm)
diff --git a/include/FFmpegUtilities.h b/include/FFmpegUtilities.h
index 8a0b7705..c673305e 100644
--- a/include/FFmpegUtilities.h
+++ b/include/FFmpegUtilities.h
@@ -105,13 +105,13 @@
// Define this for compatibility
#ifndef PixelFormat
#define PixelFormat AVPixelFormat
- #endif
+ #endif
#ifndef PIX_FMT_RGBA
#define PIX_FMT_RGBA AV_PIX_FMT_RGBA
- #endif
+ #endif
#ifndef PIX_FMT_NONE
#define PIX_FMT_NONE AV_PIX_FMT_NONE
- #endif
+ #endif
#ifndef PIX_FMT_RGB24
#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
#endif
@@ -149,11 +149,12 @@
#define AV_REGISTER_ALL
#define AVCODEC_REGISTER_ALL
#define AV_FILENAME url
+ #define AV_SET_FILENAME(oc, f) oc->AV_FILENAME = av_strdup(f)
#define MY_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() av_frame_alloc()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) av_image_alloc(av_frame->data, av_frame->linesize, width, height, pix_fmt, 1)
#define AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
- #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
+ #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
#define AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
#define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
@@ -184,11 +185,12 @@
#define AV_REGISTER_ALL av_register_all();
#define AVCODEC_REGISTER_ALL avcodec_register_all();
#define AV_FILENAME filename
+ #define AV_SET_FILENAME(oc, f) snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)
#define MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() av_frame_alloc()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) av_image_alloc(av_frame->data, av_frame->linesize, width, height, pix_fmt, 1)
#define AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
- #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
+ #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
#define AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
#define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
@@ -222,11 +224,12 @@
#define AV_REGISTER_ALL av_register_all();
#define AVCODEC_REGISTER_ALL avcodec_register_all();
#define AV_FILENAME filename
+ #define AV_SET_FILENAME(oc, f) snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)
#define MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() av_frame_alloc()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) avpicture_alloc((AVPicture *) av_frame, pix_fmt, width, height)
#define AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
- #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
+ #define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
#define AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
#define AV_FREE_CONTEXT(av_context) avcodec_close(av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codec->codec_type
@@ -252,6 +255,7 @@
#define AV_REGISTER_ALL av_register_all();
#define AVCODEC_REGISTER_ALL avcodec_register_all();
#define AV_FILENAME filename
+ #define AV_SET_FILENAME(oc, f) snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", f)
#define MY_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#define AV_ALLOCATE_FRAME() avcodec_alloc_frame()
#define AV_ALLOCATE_IMAGE(av_frame, pix_fmt, width, height) avpicture_alloc((AVPicture *) av_frame, pix_fmt, width, height)
diff --git a/include/ReaderBase.h b/include/ReaderBase.h
index 0ec93ede..7ef60923 100644
--- a/include/ReaderBase.h
+++ b/include/ReaderBase.h
@@ -55,8 +55,7 @@ namespace openshot
* @brief This struct contains info about a media file, such as height, width, frames per second, etc...
*
* Each derived class of ReaderBase is responsible for updating this struct to reflect accurate information
- * about the streams. Derived classes of ReaderBase should call the InitFileInfo() method to initialize the
- * default values of this struct.
+ * about the streams.
*/
struct ReaderInfo
{
@@ -93,7 +92,7 @@ namespace openshot
*
* Readers are types of classes that read video, audio, and image files, and
* return openshot::Frame objects. The only requirements for a 'reader', are to
- * derive from this base class, implement the GetFrame method, and call the InitFileInfo() method.
+ * derive from this base class, implement the GetFrame method, and populate ReaderInfo.
*/
class ReaderBase
{
diff --git a/src/AudioReaderSource.cpp b/src/AudioReaderSource.cpp
index 4c42d2ed..8195d03b 100644
--- a/src/AudioReaderSource.cpp
+++ b/src/AudioReaderSource.cpp
@@ -66,7 +66,7 @@ void AudioReaderSource::GetMoreSamplesFromReader()
}
// Debug
- ZmqLogger::Instance()->AppendDebugMethod("AudioReaderSource::GetMoreSamplesFromReader", "amount_needed", amount_needed, "amount_remaining", amount_remaining, "", -1, "", -1, "", -1, "", -1);
+ ZmqLogger::Instance()->AppendDebugMethod("AudioReaderSource::GetMoreSamplesFromReader", "amount_needed", amount_needed, "amount_remaining", amount_remaining);
// Init estimated buffer equal to the current frame position (before getting more samples)
estimated_frame = frame_number;
@@ -149,7 +149,7 @@ juce::AudioSampleBuffer* AudioReaderSource::reverse_buffer(juce::AudioSampleBuff
int channels = buffer->getNumChannels();
// Debug
- ZmqLogger::Instance()->AppendDebugMethod("AudioReaderSource::reverse_buffer", "number_of_samples", number_of_samples, "channels", channels, "", -1, "", -1, "", -1, "", -1);
+ ZmqLogger::Instance()->AppendDebugMethod("AudioReaderSource::reverse_buffer", "number_of_samples", number_of_samples, "channels", channels);
// Reverse array (create new buffer to hold the reversed version)
AudioSampleBuffer *reversed = new juce::AudioSampleBuffer(channels, number_of_samples);
diff --git a/src/Clip.cpp b/src/Clip.cpp
index 842f789f..4d7138e7 100644
--- a/src/Clip.cpp
+++ b/src/Clip.cpp
@@ -616,7 +616,7 @@ std::shared_ptr Clip::GetOrCreateFrame(int64_t number)
try {
// Debug output
- ZmqLogger::Instance()->AppendDebugMethod("Clip::GetOrCreateFrame (from reader)", "number", number, "samples_in_frame", samples_in_frame, "", -1, "", -1, "", -1, "", -1);
+ ZmqLogger::Instance()->AppendDebugMethod("Clip::GetOrCreateFrame (from reader)", "number", number, "samples_in_frame", samples_in_frame);
// Attempt to get a frame (but this could fail if a reader has just been closed)
new_frame = reader->GetFrame(number);
@@ -634,7 +634,7 @@ std::shared_ptr Clip::GetOrCreateFrame(int64_t number)
}
// Debug output
- ZmqLogger::Instance()->AppendDebugMethod("Clip::GetOrCreateFrame (create blank)", "number", number, "samples_in_frame", samples_in_frame, "", -1, "", -1, "", -1, "", -1);
+ ZmqLogger::Instance()->AppendDebugMethod("Clip::GetOrCreateFrame (create blank)", "number", number, "samples_in_frame", samples_in_frame);
// Create blank frame
new_frame = std::make_shared(number, reader->info.width, reader->info.height, "#000000", samples_in_frame, reader->info.channels);
diff --git a/src/EffectBase.cpp b/src/EffectBase.cpp
index 8615bd69..b04c1697 100644
--- a/src/EffectBase.cpp
+++ b/src/EffectBase.cpp
@@ -32,7 +32,7 @@
using namespace openshot;
-// Initialize the values of the FileInfo struct
+// Initialize the values of the EffectInfo struct
void EffectBase::InitEffectInfo()
{
// Init clip settings
diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp
index 1dd1364d..dfeca88a 100644
--- a/src/FFmpegWriter.cpp
+++ b/src/FFmpegWriter.cpp
@@ -525,9 +525,7 @@ void FFmpegWriter::WriteHeader() {
}
// Force the output filename (which doesn't always happen for some reason)
- snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", path.c_str());
-
- // Write the stream header, if any
+ AV_SET_FILENAME(oc, path.c_str());
// Add general metadata (if any)
for (std::map::iterator iter = info.metadata.begin(); iter != info.metadata.end(); ++iter) {
@@ -543,6 +541,7 @@ void FFmpegWriter::WriteHeader() {
if (is_mp4 || is_mov)
av_dict_copy(&dict, mux_dict, 0);
+ // Write the stream header
if (avformat_write_header(oc, &dict) != 0) {
throw InvalidFile("Could not write header to file.", path);
};
@@ -1389,7 +1388,7 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVStream *st) {
av_dict_set(&st->metadata, iter->first.c_str(), iter->second.c_str(), 0);
}
- ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::open_video", "video_codec->thread_count", video_codec->thread_count, "", -1, "", -1, "", -1, "", -1, "", -1);
+ ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::open_video", "video_codec->thread_count", video_codec->thread_count);
}
diff --git a/src/ZmqLogger.cpp b/src/ZmqLogger.cpp
index 0aeeab22..89d2798a 100644
--- a/src/ZmqLogger.cpp
+++ b/src/ZmqLogger.cpp
@@ -160,6 +160,9 @@ void ZmqLogger::Path(string new_path)
void ZmqLogger::Close()
{
+ // Disable logger as it no longer needed
+ enabled = false;
+
// Close file (if already open)
if (log_file.is_open())
log_file.close();
diff --git a/tests/ReaderBase_Tests.cpp b/tests/ReaderBase_Tests.cpp
index b3be12fa..9f56cf6d 100644
--- a/tests/ReaderBase_Tests.cpp
+++ b/tests/ReaderBase_Tests.cpp
@@ -59,7 +59,6 @@ TEST(ReaderBase_Derived_Class)
TestReader t1;
// Check some of the default values of the FileInfo struct on the base class
- // If InitFileInfo() is not called in the derived class, these checks would fail.
CHECK_EQUAL(false, t1.info.has_audio);
CHECK_EQUAL(false, t1.info.has_audio);
CHECK_CLOSE(0.0f, t1.info.duration, 0.00001);