commit 1d575ad5c11614847cea1cf73a0dfce2e9d5d322
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Wed Jan 17 22:50:24 2018 +0000
Rebuilt for ffmpeg-3.5 git
ffmpeg35_buildfix.patch | 90 +++++++++++++++++++++++++++++++++++++++++++++++++
libopenshot.spec | 8 +++--
2 files changed, 96 insertions(+), 2 deletions(-)
---
diff --git a/ffmpeg35_buildfix.patch b/ffmpeg35_buildfix.patch
new file mode 100644
index 0000000..2ce1171
--- /dev/null
+++ b/ffmpeg35_buildfix.patch
@@ -0,0 +1,90 @@
+--- a/src/FFmpegWriter.cpp
++++ b/src/FFmpegWriter.cpp
+@@ -543,7 +543,7 @@
+ {
+ if (info.has_audio && audio_codec &&
audio_st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
audio_codec->frame_size <= 1)
+ return;
+- if (info.has_video && video_st->codec->codec_type ==
AVMEDIA_TYPE_VIDEO && (oc->oformat->flags & AVFMT_RAWPICTURE) &&
video_codec->codec->id == AV_CODEC_ID_RAWVIDEO)
++ if (info.has_video && video_st->codec->codec_type ==
AVMEDIA_TYPE_VIDEO && (oc->oformat->flags & AVFMT_NOFILE) &&
video_codec->codec->id == AV_CODEC_ID_RAWVIDEO)
+ return;
+
+ int error_code = 0;
+@@ -858,7 +858,7 @@
+
+ // some formats want stream headers to be separate
+ if (oc->oformat->flags & AVFMT_GLOBALHEADER)
+- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::add_audio_stream",
"c->codec_id", c->codec_id, "c->bit_rate", c->bit_rate,
"c->channels", c->channels, "c->sample_fmt",
c->sample_fmt, "c->channel_layout", c->channel_layout,
"c->sample_rate", c->sample_rate);
+
+@@ -931,7 +931,7 @@
+ c->mb_decision = 2;
+ // some formats want stream headers to be separate
+ if (oc->oformat->flags & AVFMT_GLOBALHEADER)
+- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ // Find all supported pixel formats for this codec
+ const PixelFormat* supported_pixel_formats = codec->pix_fmts;
+@@ -951,14 +951,14 @@
+ if (strcmp(fmt->name, "gif") != 0)
+ // If not GIF format, skip the encoding process
+ // Set raw picture flag (so we don't encode this video)
+- oc->oformat->flags |= AVFMT_RAWPICTURE;
++ oc->oformat->flags |= AVFMT_NOFILE;
+ } else {
+ // Set the default codec
+ c->pix_fmt = PIX_FMT_YUV420P;
+ }
+ }
+
+- ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::add_video_stream
(" + (string)fmt->name + " : " +
(string)av_get_pix_fmt_name(c->pix_fmt) + ")", "c->codec_id",
c->codec_id, "c->bit_rate", c->bit_rate, "c->pix_fmt",
c->pix_fmt, "oc->oformat->flags", oc->oformat->flags,
"AVFMT_RAWPICTURE", AVFMT_RAWPICTURE, "", -1);
++ ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::add_video_stream
(" + (string)fmt->name + " : " +
(string)av_get_pix_fmt_name(c->pix_fmt) + ")", "c->codec_id",
c->codec_id, "c->bit_rate", c->bit_rate, "c->pix_fmt",
c->pix_fmt, "oc->oformat->flags", oc->oformat->flags,
"AVFMT_NOFILE", AVFMT_NOFILE, "", -1);
+
+ return st;
+ }
+@@ -1018,7 +1018,7 @@
+ audio_encoder_buffer_size = AUDIO_PACKET_ENCODING_SIZE;
+ audio_encoder_buffer = new uint8_t[audio_encoder_buffer_size];
+
+- ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::open_audio",
"audio_codec->thread_count", audio_codec->thread_count,
"audio_input_frame_size", audio_input_frame_size, "buffer_size",
AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE, "", -1,
"", -1, "", -1);
++ ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::open_audio",
"audio_codec->thread_count", audio_codec->thread_count,
"audio_input_frame_size", audio_input_frame_size, "buffer_size",
AVCODEC_MAX_AUDIO_FRAME_SIZE + AV_INPUT_BUFFER_PADDING_SIZE, "", -1,
"", -1, "", -1);
+
+ }
+
+@@ -1473,9 +1473,9 @@
+ // write video frame
+ bool FFmpegWriter::write_video_packet(std::shared_ptr<Frame> frame, AVFrame*
frame_final)
+ {
+- ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::write_video_packet",
"frame->number", frame->number, "oc->oformat->flags &
AVFMT_RAWPICTURE", oc->oformat->flags & AVFMT_RAWPICTURE, "", -1,
"", -1, "", -1, "", -1);
+-
+- if (oc->oformat->flags & AVFMT_RAWPICTURE) {
++ ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::write_video_packet",
"frame->number", frame->number, "oc->oformat->flags &
AVFMT_NOFILE", oc->oformat->flags & AVFMT_NOFILE, "", -1,
"", -1, "", -1, "", -1);
++
++ if (oc->oformat->flags & AVFMT_NOFILE) {
+ // Raw video case.
+ AVPacket pkt;
+ av_init_packet(&pkt);
+
+--- a/src/FFmpegReader.cpp
++++ b/src/FFmpegReader.cpp
+@@ -903,7 +903,7 @@
+ int data_size = 0;
+
+ // re-initialize buffer size (it gets changed in the avcodec_decode_audio2 method
call)
+- int buf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE;
++ int buf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE + AV_INPUT_BUFFER_PADDING_SIZE;
+ int used = avcodec_decode_audio4(aCodecCtx, audio_frame, &frame_finished, packet);
+
+ if (frame_finished) {
+@@ -976,7 +976,7 @@
+
+
+ // Allocate audio buffer
+- int16_t *audio_buf = new int16_t[AVCODEC_MAX_AUDIO_FRAME_SIZE +
FF_INPUT_BUFFER_PADDING_SIZE];
++ int16_t *audio_buf = new int16_t[AVCODEC_MAX_AUDIO_FRAME_SIZE +
AV_INPUT_BUFFER_PADDING_SIZE];
+
+ ZmqLogger::Instance()->AppendDebugMethod("FFmpegReader::ProcessAudioPacket
(ReSample)", "packet_samples", packet_samples, "info.channels",
info.channels, "info.sample_rate", info.sample_rate,
"aCodecCtx->sample_fmt", aCodecCtx->sample_fmt,
"AV_SAMPLE_FMT_S16", AV_SAMPLE_FMT_S16, "", -1);
+
+
diff --git a/libopenshot.spec b/libopenshot.spec
index 490aff3..325b4dc 100644
--- a/libopenshot.spec
+++ b/libopenshot.spec
@@ -1,11 +1,12 @@
Name: libopenshot
Version: 0.1.9
-Release: 1%{?dist}.1
+Release: 2%{?dist}.1
Summary: Library for creating and editing videos
License: LGPLv3+
URL:
http://www.openshot.org/
Source0:
https://github.com/OpenShot/%{name}/archive/v%{version}/%{name}-%{version...
+Patch0: ffmpeg35_buildfix.patch
BuildRequires: cmake swig
BuildRequires: python%{python3_pkgversion}-devel
@@ -47,7 +48,7 @@ applications that use %{name}.
%prep
-%autosetup
+%autosetup -p1
%build
@@ -79,6 +80,9 @@ export CXXFLAGS="%{optflags} -Wl,--as-needed -Wno-error"
%changelog
+* Wed Jan 17 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 0.1.9-2.1
+- Rebuilt for ffmpeg-3.5 git
+
* Sat Jan 13 2018 Richard Shaw <hobbes1069(a)gmail.com> - 0.1.9-1.1
- Build against correct libopenshot-audio.