diff -Nru libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/debian/changelog libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/debian/changelog --- libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/debian/changelog 2020-06-01 22:47:44.000000000 +0000 +++ libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/debian/changelog 2020-06-02 22:47:05.000000000 +0000 @@ -1,8 +1,8 @@ -libopenshot (0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1) focal; urgency=low +libopenshot (0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1) focal; urgency=low * Auto build. - -- Jonathan Thomas Mon, 01 Jun 2020 22:47:44 +0000 + -- OpenShot Code Tue, 02 Jun 2020 22:47:05 +0000 libopenshot (0.2.5-1) UNRELEASED; urgency=medium diff -Nru libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/debian/git-build-recipe.manifest libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/debian/git-build-recipe.manifest --- libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/debian/git-build-recipe.manifest 2020-06-01 22:47:44.000000000 +0000 +++ libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/debian/git-build-recipe.manifest 2020-06-02 22:47:05.000000000 +0000 @@ -1,3 +1,3 @@ -# git-build-recipe format 0.4 deb-version {debupstream}+dfsg2+907+202006012247+daily -lp:libopenshot git-commit:45b68cee687dcb09c33c770a793cab8f58c3babf +# git-build-recipe format 0.4 deb-version {debupstream}+dfsg2+910+202006022247+daily +lp:libopenshot git-commit:2834e7731b721e519a4d92c874f6ba93412656e3 nest-part packaging lp:openshot-packaging libopenshot/debian debian git-commit:6b3544e56c7d7430300970d144ff6e0a81595645 diff -Nru libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/src/bindings/ruby/CMakeLists.txt libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/src/bindings/ruby/CMakeLists.txt --- libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/src/bindings/ruby/CMakeLists.txt 2020-06-01 22:47:29.000000000 +0000 +++ libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/src/bindings/ruby/CMakeLists.txt 2020-06-02 22:46:56.000000000 +0000 @@ -48,13 +48,15 @@ if (${RUBY_VERSION} VERSION_GREATER 2.6.9 AND ${SWIG_VERSION} VERSION_LESS 4.0.3) if (NOT ${SILENCE_RUBY_VERSION_WARNING}) - message(WARNING " + message(WARNING "\ Ruby 2.7.0+ detected, building the libopenshot Ruby API bindings \ -requires a pre-release version of SWIG 4.0.3 with this commit: \ -https://github.com/swig/swig/commit/5542cc228ad10bdc5c91107afb77c808c43bf2a4") - message(STATUS " -To disable this warning, add -DSILENCE_RUBY_VERSION_WARNING:BOOL=1 to the cmake \ -command line, or enable the option in the CMake GUI.") +requires either SWIG 4.0.3 or an older version patched with this commit: \ +https://github.com/swig/swig/commit/5542cc228ad10bdc5c91107afb77c808c43bf2a4 \ +(Recent Fedora and Ubuntu distro packages of SWIG 4.0.1 have already been \ +patched.)") + message(STATUS "To disable the previous warning, add \ +-DSILENCE_RUBY_VERSION_WARNING:BOOL=1 to the cmake command line, \ +or enable the option in the CMake GUI.") endif() endif() diff -Nru libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/src/FFmpegWriter.cpp libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/src/FFmpegWriter.cpp --- libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/src/FFmpegWriter.cpp 2020-06-01 22:47:29.000000000 +0000 +++ libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/src/FFmpegWriter.cpp 2020-06-02 22:46:56.000000000 +0000 @@ -255,7 +255,7 @@ } if (bit_rate >= 1000) // bit_rate is the bitrate in b/s info.video_bit_rate = bit_rate; - if ((bit_rate >= 0) && (bit_rate < 64)) // bit_rate is the bitrate in crf + if ((bit_rate >= 0) && (bit_rate < 256)) // bit_rate is the bitrate in crf info.video_bit_rate = bit_rate; info.interlaced_frame = interlaced; @@ -358,7 +358,7 @@ // Was option found? if (option || (name == "g" || name == "qmin" || name == "qmax" || name == "max_b_frames" || name == "mb_decision" || name == "level" || name == "profile" || name == "slices" || name == "rc_min_rate" || name == "rc_max_rate" || - name == "rc_buffer_size" || name == "crf" || name == "cqp")) { + name == "rc_buffer_size" || name == "crf" || name == "cqp" || name == "qp")) { // Check for specific named options if (name == "g") // Set gop_size @@ -479,6 +479,15 @@ case AV_CODEC_ID_AV1 : c->bit_rate = 0; av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value),63), 0); + if (strstr(info.vcodec.c_str(), "svt_av1") != NULL) { + av_opt_set_int(c->priv_data, "preset", 6, 0); + av_opt_set_int(c->priv_data, "forced-idr",1,0); + } + if (strstr(info.vcodec.c_str(), "rav1e") != NULL) { + av_opt_set_int(c->priv_data, "speed", 7, 0); + av_opt_set_int(c->priv_data, "tile-rows", 2, 0); + av_opt_set_int(c->priv_data, "tile-columns", 4, 0); + } break; #endif case AV_CODEC_ID_VP8 : @@ -500,7 +509,14 @@ } break; case AV_CODEC_ID_HEVC : - av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value), 51), 0); // 0-51 + if (strstr(info.vcodec.c_str(), "svt_hevc") != NULL) { + av_opt_set_int(c->priv_data, "preset", 7, 0); + av_opt_set_int(c->priv_data, "forced-idr",1,0); + av_opt_set_int(c->priv_data, "qp",std::min(std::stoi(value), 51),0); + } + else { + av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value), 51), 0); // 0-51 + } if (std::stoi(value) == 0) { av_opt_set(c->priv_data, "preset", "veryslow", 0); av_opt_set_int(c->priv_data, "lossless", 1, 0); @@ -521,6 +537,48 @@ } } #endif + } else if (name == "qp") { + // encode quality and special settings like lossless + // This might be better in an extra methods as more options + // and way to set quality are possible +#if (LIBAVCODEC_VERSION_MAJOR >= 58) + switch (c->codec_id) { + case AV_CODEC_ID_AV1 : + c->bit_rate = 0; + if (strstr(info.vcodec.c_str(), "svt_av1") != NULL) { + av_opt_set_int(c->priv_data, "qp", std::min(std::stoi(value),63), 0); + av_opt_set_int(c->priv_data, "preset", 6, 0); + av_opt_set_int(c->priv_data, "forced-idr",1,0); + } + else if (strstr(info.vcodec.c_str(), "rav1e") != NULL) { + // Set number of tiles to a fixed value + // TODO Let user choose number of tiles + av_opt_set_int(c->priv_data, "qp", std::min(std::stoi(value),255), 0); + av_opt_set_int(c->priv_data, "speed", 7, 0); + av_opt_set_int(c->priv_data, "tile-rows", 2, 0); // number of rows + av_opt_set_int(c->priv_data, "tile-columns", 4, 0); // number of columns + } + else if (strstr(info.vcodec.c_str(), "aom") != NULL) { + // Set number of tiles to a fixed value + // TODO Let user choose number of tiles + // libaom doesn't have qp only crf + av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value),63), 0); + av_opt_set_int(c->priv_data, "tile-rows", 1, 0); // log2 of number of rows + av_opt_set_int(c->priv_data, "tile-columns", 2, 0); // log2 of number of columns + } + else { + av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value),63), 0); + } + case AV_CODEC_ID_HEVC : + c->bit_rate = 0; + if (strstr(info.vcodec.c_str(), "svt_hevc") != NULL) { + av_opt_set_int(c->priv_data, "qp", std::min(std::stoi(value),51), 0); + av_opt_set_int(c->priv_data, "preset", 7, 0); + av_opt_set_int(c->priv_data, "forced-idr",1,0); + } + break; + } +#endif } else { // Set AVOption AV_OPTION_SET(st, c->priv_data, name.c_str(), value.c_str(), c); @@ -801,6 +859,9 @@ #if (LIBAVFORMAT_VERSION_MAJOR < 58) if (info.has_video && video_codec && AV_GET_CODEC_TYPE(video_st) == AVMEDIA_TYPE_VIDEO && (oc->oformat->flags & AVFMT_RAWPICTURE) && AV_FIND_DECODER_CODEC_ID(video_st) == AV_CODEC_ID_RAWVIDEO) return; +#else + if (info.has_video && video_codec && AV_GET_CODEC_TYPE(video_st) == AVMEDIA_TYPE_VIDEO && AV_FIND_DECODER_CODEC_ID(video_st) == AV_CODEC_ID_RAWVIDEO) + return; #endif int error_code = 0; @@ -1222,6 +1283,13 @@ st->avg_frame_rate = av_inv_q(c->time_base); st->time_base.num = info.video_timebase.num; st->time_base.den = info.video_timebase.den; +#if (LIBAVFORMAT_VERSION_MAJOR >= 58) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + st->codec->time_base.num = info.video_timebase.num; + st->codec->time_base.den = info.video_timebase.den; + #pragma GCC diagnostic pop +#endif c->gop_size = 12; /* TODO: add this to "info"... emit one intra frame every twelve frames at most */ c->max_b_frames = 10; @@ -1962,10 +2030,13 @@ bool FFmpegWriter::write_video_packet(std::shared_ptr frame, AVFrame *frame_final) { #if (LIBAVFORMAT_VERSION_MAJOR >= 58) ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::write_video_packet", "frame->number", frame->number, "oc->oformat->flags", oc->oformat->flags); + + if (AV_GET_CODEC_TYPE(video_st) == AVMEDIA_TYPE_VIDEO && AV_FIND_DECODER_CODEC_ID(video_st) == AV_CODEC_ID_RAWVIDEO) { #else ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::write_video_packet", "frame->number", frame->number, "oc->oformat->flags & AVFMT_RAWPICTURE", oc->oformat->flags & AVFMT_RAWPICTURE); if (oc->oformat->flags & AVFMT_RAWPICTURE) { +#endif // Raw video case. AVPacket pkt; av_init_packet(&pkt); @@ -1990,7 +2061,6 @@ AV_FREE_PACKET(&pkt); } else -#endif { AVPacket pkt; diff -Nru libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/.travis.yml libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/.travis.yml --- libopenshot-0.2.5+dfsg2+907+202006012247+daily~ubuntu20.04.1/.travis.yml 2020-06-01 22:47:29.000000000 +0000 +++ libopenshot-0.2.5+dfsg2+910+202006022247+daily~ubuntu20.04.1/.travis.yml 2020-06-02 22:46:56.000000000 +0000 @@ -57,19 +57,17 @@ - lcov - binutils-common # For c++filt - - name: "FFmpeg 4 GCC (Ubuntu 18.04 Bionic)" + - name: "FFmpeg 4 GCC (Ubuntu 20.04 Focal)" env: - BUILD_VERSION=ffmpeg4 - CMAKE_EXTRA_ARGS="" - TEST_TARGET=test os: linux - dist: bionic + dist: focal addons: apt: sources: - sourceline: 'ppa:openshot.developers/libopenshot-daily' - - sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic' - - sourceline: 'ppa:jonathonf/ffmpeg-4' packages: - *p_common - qt5-default