Lines 1-24
Link Here
|
1 |
--- src/FFmpegWriter.cpp.orig 2021-02-18 07:59:16 UTC |
1 |
--- src/FFmpegWriter.cpp.orig 2021-06-07 02:42:27 UTC |
2 |
+++ src/FFmpegWriter.cpp |
2 |
+++ src/FFmpegWriter.cpp |
3 |
@@ -181,7 +181,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std |
3 |
@@ -169,7 +169,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std |
4 |
AVCodec *new_codec; |
4 |
AVCodec *new_codec; |
5 |
// Check if the codec selected is a hardware accelerated codec |
5 |
// Check if the codec selected is a hardware accelerated codec |
6 |
#if HAVE_HW_ACCEL |
6 |
#if USE_HW_ACCEL |
7 |
-#if defined(__linux__) |
7 |
-#if defined(__linux__) |
8 |
+#if defined(__unix__) |
8 |
+#if defined(__unix__) |
9 |
if (strstr(codec.c_str(), "_vaapi") != NULL) { |
9 |
if (strstr(codec.c_str(), "_vaapi") != NULL) { |
10 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
10 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
11 |
hw_en_on = 1; |
11 |
hw_en_on = 1; |
12 |
@@ -231,7 +231,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std |
12 |
@@ -219,7 +219,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std |
13 |
} |
13 |
} |
14 |
#else // unknown OS |
14 |
#else // unknown OS |
15 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
15 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
16 |
-#endif //__linux__/_WIN32/__APPLE__ |
16 |
-#endif //__linux__/_WIN32/__APPLE__ |
17 |
+#endif //__unix__/_WIN32/__APPLE__ |
17 |
+#endif //__unix__/_WIN32/__APPLE__ |
18 |
#else // HAVE_HW_ACCEL |
18 |
#else // USE_HW_ACCEL |
19 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
19 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
20 |
#endif // HAVE_HW_ACCEL |
20 |
#endif // USE_HW_ACCEL |
21 |
@@ -580,6 +580,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::s |
21 |
@@ -568,6 +568,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::s |
22 |
else { |
22 |
else { |
23 |
av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value),63), 0); |
23 |
av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value),63), 0); |
24 |
} |
24 |
} |
Lines 26-32
Link Here
|
26 |
case AV_CODEC_ID_HEVC : |
26 |
case AV_CODEC_ID_HEVC : |
27 |
c->bit_rate = 0; |
27 |
c->bit_rate = 0; |
28 |
if (strstr(info.vcodec.c_str(), "svt_hevc") != NULL) { |
28 |
if (strstr(info.vcodec.c_str(), "svt_hevc") != NULL) { |
29 |
@@ -588,6 +589,8 @@ void FFmpegWriter::SetOption(StreamType stream, std::s |
29 |
@@ -576,6 +577,8 @@ void FFmpegWriter::SetOption(StreamType stream, std::s |
30 |
av_opt_set_int(c->priv_data, "forced-idr",1,0); |
30 |
av_opt_set_int(c->priv_data, "forced-idr",1,0); |
31 |
} |
31 |
} |
32 |
break; |
32 |
break; |
Lines 35-41
Link Here
|
35 |
} |
35 |
} |
36 |
#endif // FFmpeg 4.0+ |
36 |
#endif // FFmpeg 4.0+ |
37 |
} else { |
37 |
} else { |
38 |
@@ -1438,21 +1441,25 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS |
38 |
@@ -1413,21 +1416,25 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS |
39 |
adapter_num = openshot::Settings::Instance()->HW_EN_DEVICE_SET; |
39 |
adapter_num = openshot::Settings::Instance()->HW_EN_DEVICE_SET; |
40 |
std::clog << "Encoding Device Nr: " << adapter_num << "\n"; |
40 |
std::clog << "Encoding Device Nr: " << adapter_num << "\n"; |
41 |
if (adapter_num < 3 && adapter_num >=0) { |
41 |
if (adapter_num < 3 && adapter_num >=0) { |