Projects
Multimedia
ffmpeg2theora
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 11
View file
ffmpeg2theora.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Sat Feb 11 13:55:11 UTC 2017 - olaf@aepfle.de + +- Update to 0.30 + +------------------------------------------------------------------- Tue Aug 20 07:27:10 UTC 2013 - i@margueirte.su - fix ffmpeg 2.0 build
View file
ffmpeg2theora.spec
Changed
@@ -17,17 +17,14 @@ Name: ffmpeg2theora -Version: 0.29 +Version: 0.30 Release: 0 License: GPL-2.0+ Summary: A simple converter to create Ogg Theora files Url: http://v2v.cc/~j/ffmpeg2theora/index.html Group: Productivity/Multimedia/Other -Source: http://v2v.cc/~j/ffmpeg2theora/%{name}-%{version}.tar.bz2 -# PATCH-FIX-UPSTREAM marugerite@opensuse.org - port ffmpeg to 2.0 -Patch: ffmpeg2theora-ffmpeg-2.0.patch -# PATCH-FIX-UPSTREAM marguerite@opensuse.org - fix implicit declarations -Patch1: ffmpeg2theora-implicit-declaration.patch +Source0: http://v2v.cc/~j/ffmpeg2theora/%{name}-%{version}.tar.bz2 +Patch0: ffmpeg2theora.sort.patch BuildRequires: pkg-config BuildRequires: pkgconfig(libavcodec) = 56.60.100 BuildRequires: pkgconfig(libavdevice) = 56.4.100 @@ -38,10 +35,10 @@ BuildRequires: pkgconfig(libswresample) = 1.2.101 BuildRequires: pkgconfig(libswscale) = 3.1.101 BuildRequires: pkgconfig(vorbis) -BuildRequires: libkate-devel -BuildRequires: libmp3lame-devel -BuildRequires: libtheora-devel -BuildRequires: scons +BuildRequires: libkate-devel +BuildRequires: libmp3lame-devel +BuildRequires: libtheora-devel +BuildRequires: scons BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -49,14 +46,18 @@ %prep %setup -q -%patch -p1 -%patch1 -p1 +%patch0 -p1 %build -scons prefix=%{_prefix} APPEND_CCFLAGS="%{optflags}" APPEND_LINKFLAGS="-lm" %install -scons prefix=%{_prefix} mandir=%{_mandir} destdir=%{buildroot} APPEND_CCFLAGS="%{optflags}" APPEND_LINKFLAGS="-lm" install +scons \ + prefix=%{_prefix} \ + mandir=%{_mandir} \ + destdir=%{buildroot} \ + APPEND_CCFLAGS="%{optflags} -Wno-unused-variable -Wno-unused-but-set-variable" \ + APPEND_LINKFLAGS="-lm" \ + install install -D -m 0644 ffmpeg2theora.1 %{buildroot}%{_mandir}/man1/ffmpeg2theora.1 %files
View file
ffmpeg2theora-ffmpeg-2.0.patch
Deleted
@@ -1,58 +0,0 @@ -Index: ffmpeg2theora-0.29/src/ffmpeg2theora.c -=================================================================== ---- ffmpeg2theora-0.29.orig/src/ffmpeg2theora.c -+++ ffmpeg2theora-0.29/src/ffmpeg2theora.c -@@ -24,18 +24,19 @@ - #include <getopt.h> - #include <math.h> - #include <errno.h> -+#include <ctype.h> - --#include "libavformat/avformat.h" --#include "libavdevice/avdevice.h" -+#include <libavformat/avformat.h> -+#include <libavdevice/avdevice.h> - #ifdef HAVE_FRAMEHOOK --#include "libavformat/framehook.h" -+#include <libavformat/framehook.h> - #endif --#include "libswscale/swscale.h" --#include "libpostproc/postprocess.h" -+#include <libswscale/swscale.h> -+#include <libpostproc/postprocess.h> - --#include "theora/theoraenc.h" --#include "vorbis/codec.h" --#include "vorbis/vorbisenc.h" -+#include <theora/theoraenc.h> -+#include <vorbis/codec.h> -+#include <vorbis/vorbisenc.h> - - #ifdef WIN32 - #include "fcntl.h" -@@ -48,6 +49,7 @@ - #include "avinfo.h" - - #define LENGTH(x) (sizeof(x) / sizeof(*x)) -+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 19200 // 1 second of 48khz 32bit audio - - enum { - NULL_FLAG, -@@ -1424,7 +1426,7 @@ void ff2theora_output(ff2theora this) { - - if (venc_pix_fmt != this->pix_fmt) { - sws_scale(this->sws_colorspace_ctx, -- frame->data, frame->linesize, 0, display_height, -+ (const uint8_t * const*)frame->data, frame->linesize, 0, display_height, - output_tmp->data, output_tmp->linesize); - } - else{ -@@ -1468,7 +1470,7 @@ void ff2theora_output(ff2theora this) { - } - if (this->sws_scale_ctx) { - sws_scale(this->sws_scale_ctx, -- output_cropped->data, -+ (const uint8_t * const*)output_cropped->data, - output_cropped->linesize, 0, - display_height - (this->frame_topBand + this->frame_bottomBand), - output_resized->data,
View file
ffmpeg2theora-implicit-declaration.patch
Deleted
@@ -1,22 +0,0 @@ -Index: ffmpeg2theora-0.29/src/iso639.c -=================================================================== ---- ffmpeg2theora-0.29.orig/src/iso639.c -+++ ffmpeg2theora-0.29/src/iso639.c -@@ -1,4 +1,5 @@ - #include <stddef.h> -+#include <string.h> - #include "iso639.h" - - static const struct { -Index: ffmpeg2theora-0.29/src/avinfo.c -=================================================================== ---- ffmpeg2theora-0.29.orig/src/avinfo.c -+++ ffmpeg2theora-0.29/src/avinfo.c -@@ -40,6 +40,7 @@ - #include <math.h> - #include <errno.h> - #include <sys/stat.h> -+#include <ctype.h> - - #include "libavformat/avformat.h" - #include "libavutil/pixdesc.h"
View file
ffmpeg2theora.sort.patch
Added
@@ -0,0 +1,11 @@ +--- a/SConstruct ++++ b/SConstruct +@@ -228,7 +228,7 @@ env = conf.Finish() + + # ffmpeg2theora + ffmpeg2theora = env.Clone() +-ffmpeg2theora_sources = glob('src/*.c') ++ffmpeg2theora_sources = sorted(glob('src/*.c')) + ffmpeg2theora.Program('ffmpeg2theora', ffmpeg2theora_sources) + + ffmpeg2theora.Install(bin_dir, 'ffmpeg2theora')
View file
ffmpeg2theora-0.29.tar.bz2/patches
Deleted
-(directory)
View file
ffmpeg2theora-0.30.tar.bz2/.gitignore
Added
@@ -0,0 +1,5 @@ +/.sconf_temp +/.sconsign.dblite +/config.log +/ffmpeg2theora +/src/*.o
View file
ffmpeg2theora-0.29.tar.bz2/ChangeLog -> ffmpeg2theora-0.30.tar.bz2/ChangeLog
Changed
@@ -1,3 +1,7 @@ +0.30 2014-12-12 + - various bugfixes + - update to compile with ffmpeg 2.9 + 0.29 2012-06-25 - use GPL 2 or later, to make use of some decoders only available in GPL 2 version of ffmpeg
View file
ffmpeg2theora-0.29.tar.bz2/Makefile -> ffmpeg2theora-0.30.tar.bz2/Makefile
Changed
@@ -8,6 +8,5 @@ scons install $(PREFIX) dist: - svn export . ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2` - tar cjf ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`.tar.bz2 ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2` - rm -r ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2` + git archive --format=tar --prefix=ffmpeg2theora-`./version.sh`/ master | bzip2 >ffmpeg2theora-`./version.sh`.tar.bz2 + ls -lah ffmpeg2theora-`./version.sh`.tar.bz2
View file
ffmpeg2theora-0.29.tar.bz2/SConstruct -> ffmpeg2theora-0.30.tar.bz2/SConstruct
Changed
@@ -6,12 +6,13 @@ import SCons def version(): + #return "0.29" f = os.popen("./version.sh") version = f.read().strip() f.close() return version -pkg_version="0.29" +pkg_version=version() pkg_name="ffmpeg2theora" @@ -161,6 +162,19 @@ env.Append(CCFLAGS= '-Iffmpeg' ) + for lib in FFMPEG_LIBS: + lib = lib.split(' ')0 + env.Append(LINKFLAGS= + '-Lffmpeg/' + lib + ) + + if conf.CheckPKG('libswresample'): + FFMPEG_LIBS.append('libswresample') + env.Append(CCFLAGS= + '-DUSE_SWRESAMPLE' + ) + elif conf.CheckPKG('libavresample'): + FFMPEG_LIBS.append('libavresample') if not conf.CheckPKG(' '.join(FFMPEG_LIBS)): print """
View file
ffmpeg2theora-0.29.tar.bz2/build_ffmpeg.sh -> ffmpeg2theora-0.30.tar.bz2/build_ffmpeg.sh
Changed
@@ -21,5 +21,5 @@ uname | grep MINGW && options="$common --enable-memalign-hack --enable-mingw32 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib $extra" #configure and build ffmpeg -cd $FFMPEG_CO_DIR && ./configure $options && make +cd $FFMPEG_CO_DIR && ./configure $options && make -j8
View file
ffmpeg2theora-0.29.tar.bz2/ffmpeg2theora.pmdoc/01ffmpeg.xml -> ffmpeg2theora-0.30.tar.bz2/ffmpeg2theora.pmdoc/01ffmpeg.xml
Changed
@@ -1,1 +1,1 @@ -<pkgref spec="1.12" uuid="01291888-CCA4-41A5-AAB3-BC2E3CFE6477"><config><identifier>cc.v2v.ffmpeg2theora</identifier><version>0.28</version><description/><post-install type="none"/><requireAuthorization/><installFrom mod="true">/tmp/ffmpeg2theora/</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>installTo.isRelativeType</mod><mod>installTo</mod><mod>installTo.isAbsoluteType</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod></config><contents><file-list>01ffmpeg-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass</filter></contents></pkgref> \ No newline at end of file +<pkgref spec="1.12" uuid="01291888-CCA4-41A5-AAB3-BC2E3CFE6477"><config><identifier>cc.v2v.ffmpeg2theora</identifier><version>0.29</version><description></description><post-install type="none"/><requireAuthorization/><installFrom mod="true">/tmp/ffmpeg2theora/</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.isRelativeType</mod><mod>installTo</mod><mod>installFrom.path</mod><mod>installTo.isAbsoluteType</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod></config><contents><file-list>01ffmpeg-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass</filter></contents></pkgref> \ No newline at end of file
View file
ffmpeg2theora-0.29.tar.bz2/ffmpeg2theora.pmdoc/index.xml -> ffmpeg2theora-0.30.tar.bz2/ffmpeg2theora.pmdoc/index.xml
Changed
@@ -1,1 +1,1 @@ -<pkmkdoc spec="1.12"><properties><title>ffmpeg2theora</title><build>/Users/build/ffmpeg2theora-0.28.pkg</build><organization>org.xiph</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Commandline tool to encode video in Ogg Theora</description><contents><choice title="ffmpeg2theora" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="cc.v2v.ffmpeg2theora"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01ffmpeg.xml</item></pkmkdoc> +<pkmkdoc spec="1.12"><properties><title>ffmpeg2theora</title><build>/Users/build/ffmpeg2theora-0.29.pkg</build><organization>org.xiph</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Commandline tool to encode video in Ogg Theora</description><contents><choice title="ffmpeg2theora" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="cc.v2v.ffmpeg2theora"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01ffmpeg.xml</item></pkmkdoc>
View file
ffmpeg2theora-0.29.tar.bz2/src/avinfo.c -> ffmpeg2theora-0.30.tar.bz2/src/avinfo.c
Changed
@@ -36,6 +36,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <ctype.h> #include <getopt.h> #include <math.h> #include <errno.h> @@ -107,7 +108,7 @@ char *p, *p_str = str, *p_buffer = (char *)buffer; int len = strlen(str); strncpy(p_buffer, str, len); - while (p = strstr(p_str, orig)) { + while ((p = strstr(p_str, orig))) { strncpy(p_buffer, p_str, p-p_str); p_buffer += (p-p_str); len = len - strlen(orig) + strlen(rep); @@ -143,6 +144,9 @@ p = (char *)value; p = replace_str_all(p, "\\", "\\\\"); p = replace_str_all(p, "\"", "\\\""); + p = replace_str_all(p, "\n", ""); + p = replace_str_all(p, "\f", ""); + p = replace_str_all(p, "\r", ""); fprintf(output, "\"%s\": \"%s\"", key, p); free(p); break; @@ -165,42 +169,17 @@ void json_codec_info(FILE *output, AVCodecContext *enc, int indent) { const char *codec_name; - AVCodec *p; char buf132; int bitrate; AVRational display_aspect_ratio; - p = avcodec_find_decoder(enc->codec_id); - - if (p) { - codec_name = p->name; - } else if (enc->codec_id == CODEC_ID_MPEG2TS) { - /* fake mpeg2 transport stream codec (currently not - registered) */ - codec_name = "mpeg2ts"; - } else if (enc->codec_name0 != '\0') { - codec_name = enc->codec_name; - } else { - /* output avi tags */ - if( isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF) - && isprint((enc->codec_tag>>16)&0xFF) && isprint((enc->codec_tag>>24)&0xFF)){ - snprintf(buf1, sizeof(buf1), "%c%c%c%c / 0x%04X", - enc->codec_tag & 0xff, - (enc->codec_tag >> 8) & 0xff, - (enc->codec_tag >> 16) & 0xff, - (enc->codec_tag >> 24) & 0xff, - enc->codec_tag); - } else { - snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag); - } - codec_name = buf1; - } + codec_name = avcodec_get_name(enc->codec_id); switch(enc->codec_type) { case AVMEDIA_TYPE_VIDEO: codec_name = fix_codec_name(codec_name); json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent); - if (enc->pix_fmt != PIX_FMT_NONE) { + if (enc->pix_fmt != AV_PIX_FMT_NONE) { json_add_key_value(output, "pixel_format", (void *)av_get_pix_fmt_name(enc->pix_fmt), JSON_STRING, 0, indent); } if (enc->width) { @@ -235,37 +214,37 @@ /* for PCM codecs, compute bitrate directly */ switch(enc->codec_id) { - case CODEC_ID_PCM_F64BE: - case CODEC_ID_PCM_F64LE: + case AV_CODEC_ID_PCM_F64BE: + case AV_CODEC_ID_PCM_F64LE: bitrate = enc->sample_rate * enc->channels * 64; break; - case CODEC_ID_PCM_S32LE: - case CODEC_ID_PCM_S32BE: - case CODEC_ID_PCM_U32LE: - case CODEC_ID_PCM_U32BE: - case CODEC_ID_PCM_F32BE: - case CODEC_ID_PCM_F32LE: + case AV_CODEC_ID_PCM_S32LE: + case AV_CODEC_ID_PCM_S32BE: + case AV_CODEC_ID_PCM_U32LE: + case AV_CODEC_ID_PCM_U32BE: + case AV_CODEC_ID_PCM_F32BE: + case AV_CODEC_ID_PCM_F32LE: bitrate = enc->sample_rate * enc->channels * 32; break; - case CODEC_ID_PCM_S24LE: - case CODEC_ID_PCM_S24BE: - case CODEC_ID_PCM_U24LE: - case CODEC_ID_PCM_U24BE: - case CODEC_ID_PCM_S24DAUD: + case AV_CODEC_ID_PCM_S24LE: + case AV_CODEC_ID_PCM_S24BE: + case AV_CODEC_ID_PCM_U24LE: + case AV_CODEC_ID_PCM_U24BE: + case AV_CODEC_ID_PCM_S24DAUD: bitrate = enc->sample_rate * enc->channels * 24; break; - case CODEC_ID_PCM_S16LE: - case CODEC_ID_PCM_S16BE: - case CODEC_ID_PCM_S16LE_PLANAR: - case CODEC_ID_PCM_U16LE: - case CODEC_ID_PCM_U16BE: + case AV_CODEC_ID_PCM_S16LE: + case AV_CODEC_ID_PCM_S16BE: + case AV_CODEC_ID_PCM_S16LE_PLANAR: + case AV_CODEC_ID_PCM_U16LE: + case AV_CODEC_ID_PCM_U16BE: bitrate = enc->sample_rate * enc->channels * 16; break; - case CODEC_ID_PCM_S8: - case CODEC_ID_PCM_U8: - case CODEC_ID_PCM_ALAW: - case CODEC_ID_PCM_MULAW: - case CODEC_ID_PCM_ZORK: + case AV_CODEC_ID_PCM_S8: + case AV_CODEC_ID_PCM_U8: + case AV_CODEC_ID_PCM_ALAW: + case AV_CODEC_ID_PCM_MULAW: + case AV_CODEC_ID_PCM_ZORK: bitrate = enc->sample_rate * enc->channels * 8; break; default: @@ -300,54 +279,6 @@ } } - -static void json_stream_format(FILE *output, AVFormatContext *ic, int i, int indent, int first, int type_filter) { - static int _first = 1; - char buf132; - - AVStream *st = ic->streamsi; - - if (first) - _first = 1; - - if(st->codec->codec_type == type_filter){ - if (!_first) - fprintf(output, ", "); - _first = 0; - fprintf(output, "{\n"); - - json_codec_info(output, st->codec, indent + 1); - if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ - if (st->time_base.den && st->time_base.num && av_q2d(st->time_base) > 0.001) { - snprintf(buf1, sizeof(buf1), "%d:%d", - st->time_base.den, st->time_base.num); - json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1); - } else { - snprintf(buf1, sizeof(buf1), "%d:%d", - st->r_frame_rate.num, st->r_frame_rate.den); - json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1); - } - if (st->sample_aspect_ratio.num && // default - av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) { - AVRational display_aspect_ratio; - av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, - st->codec->width*st->sample_aspect_ratio.num, - st->codec->height*st->sample_aspect_ratio.den, - 1024*1024); - snprintf(buf1, sizeof(buf1), "%d:%d", - st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); - json_add_key_value(output, "pixel_aspect_ratio", buf1, JSON_STRING, 0, indent+1); - snprintf(buf1, sizeof(buf1), "%d:%d", - display_aspect_ratio.num, display_aspect_ratio.den); - json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent+1); - } - } - json_add_key_value(output, "id", &i, JSON_INT, 1, indent + 1); - do_indent(output, indent-1); - fprintf(output, "}"); - } -} - static int utf8_validate (char *s, int n) { int i; int extra_bytes; @@ -387,38 +318,79 @@ error: return i == n; } -int _json_metadata(FILE *output, AVDictionary *m, int first, int indent) + + +void json_metadata(FILE *output, AVDictionary *m, int indent) { - int i = 0; + int first = 1; AVDictionaryEntry *tag = NULL;
View file
ffmpeg2theora-0.29.tar.bz2/src/ffmpeg2theora.c -> ffmpeg2theora-0.30.tar.bz2/src/ffmpeg2theora.c
Changed
@@ -21,6 +21,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <ctype.h> #include <getopt.h> #include <math.h> #include <errno.h> @@ -33,6 +34,11 @@ #include "libswscale/swscale.h" #include "libpostproc/postprocess.h" +#include "libavutil/opt.h" +#include "libavutil/channel_layout.h" +#include "libavutil/samplefmt.h" +#include "libswresample_compat.h" + #include "theora/theoraenc.h" #include "vorbis/codec.h" #include "vorbis/vorbisenc.h" @@ -47,6 +53,9 @@ #include "ffmpeg2theora.h" #include "avinfo.h" +#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio + + #define LENGTH(x) (sizeof(x) / sizeof(*x)) enum { @@ -140,13 +149,13 @@ uint8_t *picture_buf; int size; - picture = avcodec_alloc_frame(); + picture = av_frame_alloc(); if (!picture) return NULL; size = avpicture_get_size (pix_fmt, width, height); picture_buf = av_malloc (size); if (!picture_buf) { - av_free (picture); + av_frame_free (&picture); return NULL; } avpicture_fill((AVPicture *) picture, picture_buf, pix_fmt, width, height); @@ -159,7 +168,7 @@ static void frame_dealloc(AVFrame *frame) { if (frame) { avpicture_free((AVPicture*)frame); - av_free(frame); + av_frame_free(&frame); } } @@ -223,7 +232,7 @@ this->kate_streams=NULL; this->ignore_non_utf8 = 0; - this->pix_fmt = PIX_FMT_YUV420P; + this->pix_fmt = AV_PIX_FMT_YUV420P; // ffmpeg2theora --nosound -f dv -H 32000 -S 0 -v 8 -x 384 -y 288 -G 1.5 input.dv this->video_gamma = 0.0; @@ -347,14 +356,14 @@ AVCodecContext *enc = this->context->streamsidx->codec; if (enc->codec_type != AVMEDIA_TYPE_SUBTITLE) return 0; switch (enc->codec_id) { - case CODEC_ID_TEXT: - case CODEC_ID_SSA: - case CODEC_ID_MOV_TEXT: + case AV_CODEC_ID_TEXT: + case AV_CODEC_ID_SSA: + case AV_CODEC_ID_MOV_TEXT: if (included_subtitles & INCSUB_TEXT) return "SUB"; else return NULL; - case CODEC_ID_DVD_SUBTITLE: + case AV_CODEC_ID_DVD_SUBTITLE: if (included_subtitles & INCSUB_SPU) return "K-SPU"; else @@ -513,6 +522,74 @@ return lang; } +static void delete_filter_graph(ff2theora this) { + if (this->filter_graph) { + av_frame_free(&this->filter_frame); + avfilter_graph_free(&this->filter_graph); + } +} + +static int init_filter_graph(ff2theora this, enum AVPixelFormat pixfmt, int width, int height) { + AVFilterInOut *inputs = NULL, *outputs = NULL; + char args512; + int res; + + delete_filter_graph(this); + this->filter_graph = avfilter_graph_alloc(); + snprintf(args, sizeof(args), + "buffer=video_size=%dx%d:pix_fmt=%d:time_base=1/1:pixel_aspect=0/1in;" + "inyadifout;" + "outbuffersink", + width, height, pixfmt); + res = avfilter_graph_parse2(this->filter_graph, args, &inputs, &outputs); + if (res < 0) + return res; + if(inputs || outputs) + return -1; + res = avfilter_graph_config(this->filter_graph, NULL); + if (res < 0) + return res; + + this->buffersrc_ctx = avfilter_graph_get_filter(this->filter_graph, "Parsed_buffer_0"); + this->buffersink_ctx = avfilter_graph_get_filter(this->filter_graph, "Parsed_buffersink_2"); + if (!this->buffersrc_ctx || !this->buffersink_ctx) + return -1; + this->filter_frame = av_frame_alloc(); + this->last_width = width; + this->last_height = height; + this->last_pixfmt = pixfmt; + + return 0; +} + +static int process_filter_graph(ff2theora this, AVPicture *dst, const AVPicture *src, + enum AVPixelFormat pixfmt, int width, int height) { + int res; + + if (!this->filter_graph || width != this->last_width || + height != this->last_height || pixfmt != this->last_pixfmt) { + res = init_filter_graph(this, pixfmt, width, height); + if (res < 0) + return res; + } + + memcpy(this->filter_frame->data, src->data, sizeof(src->data)); + memcpy(this->filter_frame->linesize, src->linesize, sizeof(src->linesize)); + this->filter_frame->width = width; + this->filter_frame->height = height; + this->filter_frame->format = pixfmt; + res = av_buffersrc_add_frame(this->buffersrc_ctx, this->filter_frame); + if (res < 0) + return res; + res = av_buffersink_get_frame(this->buffersink_ctx, this->filter_frame); + if (res < 0) + return res; + av_picture_copy(dst, (const AVPicture *) this->filter_frame, pixfmt, width, height); + av_frame_unref(this->filter_frame); + + return 0; +} + void ff2theora_output(ff2theora this) { unsigned int i; AVCodecContext *aenc = NULL; @@ -534,6 +611,11 @@ int synced = this->start_time == 0.0; AVRational display_aspect_ratio, sample_aspect_ratio; + struct SwrContext *swr_ctx; + uint8_t **dst_audio_data = NULL; + int dst_linesize; + int src_nb_samples = 1024, dst_nb_samples, max_dst_nb_samples; + if (this->audiostream >= 0 && this->context->nb_streams > this->audiostream) { AVCodecContext *enc = this->context->streamsthis->audiostream->codec; if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { @@ -590,11 +672,12 @@ vstream_fps.num = venc->time_base.den; vstream_fps.den = venc->time_base.num * venc->ticks_per_frame; } - if (av_q2d(vstream->r_frame_rate) < av_q2d(vstream_fps)) { - vstream_fps = vstream->r_frame_rate; + if (av_q2d(vstream->avg_frame_rate) < av_q2d(vstream_fps)) { + vstream_fps = vstream->avg_frame_rate; } this->fps = fps = av_q2d(vstream_fps); + venc->thread_count = 1; if (vcodec == NULL || avcodec_open2 (venc, vcodec, NULL) < 0) { this->video_index = -1; } @@ -885,8 +968,8 @@ /*Force the offsets to be even so that chroma samples line up like we expect.*/ - this->frame_x_offset = this->frame_width-this->picture_width>>1&~1; - this->frame_y_offset = this->frame_height-this->picture_height>>1&~1; + this->frame_x_offset = (this->frame_width-this->picture_width)>>1&~1; + this->frame_y_offset = (this->frame_height-this->picture_height)>>1&~1; //Bicubic (best for upscaling), if (sws_flags < 0) { @@ -954,26 +1037,47 @@ if (this->channels > aenc->channels) this->channels = aenc->channels; }
View file
ffmpeg2theora-0.29.tar.bz2/src/ffmpeg2theora.h -> ffmpeg2theora-0.30.tar.bz2/src/ffmpeg2theora.h
Changed
@@ -2,6 +2,9 @@ #define _F2T_FFMPEG2THEORA_H_ #include "subtitles.h" +#include <libavfilter/avfilter.h> +#include <libavfilter/buffersrc.h> +#include <libavfilter/buffersink.h> typedef struct ff2theora_subtitle{ char *text; @@ -62,7 +65,6 @@ double fps; struct SwsContext *sws_colorspace_ctx; /* for image resampling/resizing */ struct SwsContext *sws_scale_ctx; /* for image resampling/resizing */ - ReSampleContext *audio_resample_ctx; ogg_int32_t aspect_numerator; ogg_int32_t aspect_denominator; int colorspace; @@ -118,6 +120,13 @@ unsigned char y_lut256; unsigned char uv_lut256; + AVFilterContext *buffersink_ctx; + AVFilterContext *buffersrc_ctx; + AVFilterGraph *filter_graph; + AVFrame *filter_frame; + int last_width; + int last_height; + enum AVPixelFormat last_pixfmt; } *ff2theora;
View file
ffmpeg2theora-0.29.tar.bz2/src/iso639.c -> ffmpeg2theora-0.30.tar.bz2/src/iso639.c
Changed
@@ -1,4 +1,5 @@ #include <stddef.h> +#include <strings.h> #include "iso639.h" static const struct {
View file
ffmpeg2theora-0.30.tar.bz2/src/libswresample_compat.h
Added
@@ -0,0 +1,21 @@ +// This header serves to smooth out the differences in FFmpeg and LibAV. + +#ifdef USE_SWRESAMPLE + + #include <libswresample/swresample.h> + +#else + + #include <libavresample/avresample.h> + #include <libavutil/mathematics.h> + + #define SwrContext AVAudioResampleContext + #define swr_init(ctx) avresample_open(ctx) + #define swr_close(ctx) avresample_close(ctx) + #define swr_free(ctx) avresample_free(ctx) + #define swr_alloc() avresample_alloc_context() + #define swr_get_delay(ctx, ...) avresample_get_delay(ctx) + #define swr_convert(ctx, out, out_count, in, in_count) \ + avresample_convert(ctx, out, 0, out_count, (uint8_t **)in, 0, in_count) + +#endif
View file
ffmpeg2theora-0.29.tar.bz2/src/theorautils.c -> ffmpeg2theora-0.30.tar.bz2/src/theorautils.c
Changed
@@ -1219,17 +1219,16 @@ /** * adds audio samples to encoding sink * @param buffer pointer to buffer - * @param bytes bytes in buffer * @param samples samples in buffer * @param e_o_s 1 indicates end of stream. */ -void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int samples, int e_o_s) { +void oggmux_add_audio (oggmux_info *info, uint8_t **buffer, int samples, int e_o_s) { ogg_packet op; int i, j, k, count = 0; float **vorbis_buffer; - if (bytes <= 0 && samples <= 0) { + if (samples <= 0) { /* end of audio stream */ if (e_o_s) vorbis_analysis_wrote (&info->vd, 0); @@ -1252,7 +1251,7 @@ default: k = j; } } - vorbis_bufferki = buffercount++ / 32768.f; + vorbis_bufferki = ((const float *)bufferj)i; } } vorbis_analysis_wrote (&info->vd, samples); @@ -1291,8 +1290,8 @@ if (op.packetno != 4) { /* We only expect negative start granule in the first content packet, not any of the others... */ - fprintf(stderr, "WARNING: vorbis packet %lld has calculated start" - " granule of %lld, but it should be non-negative!", + fprintf(stderr, "WARNING: vorbis packet %" PRId64 " has calculated start" + " granule of %" PRId64 ", but it should be non-negative!", op.packetno, start_granule); } start_granule = 0; @@ -1302,7 +1301,7 @@ allowed by the specification in the last packet only, and the trailing samples should be discarded and not played/indexed. */ if (!op.e_o_s) { - fprintf(stderr, "WARNING: vorbis packet %lld (granulepos %lld) starts before" + fprintf(stderr, "WARNING: vorbis packet %" PRId64 " (granulepos %" PRId64 ") starts before" " the end of the preceeding packet!", op.packetno, op.granulepos); } start_granule = info->vorbis_granulepos;
View file
ffmpeg2theora-0.29.tar.bz2/src/theorautils.h -> ffmpeg2theora-0.30.tar.bz2/src/theorautils.h
Changed
@@ -168,7 +168,7 @@ extern void oggmux_setup_kate_streams(oggmux_info *info, int n_kate_streams); extern void oggmux_init (oggmux_info *info); extern void oggmux_add_video (oggmux_info *info, th_ycbcr_buffer ycbcr, int e_o_s); -extern void oggmux_add_audio (oggmux_info *info, int16_t * readbuffer, int bytesread, int samplesread,int e_o_s); +extern void oggmux_add_audio (oggmux_info *info, uint8_t **buffer, int samples,int e_o_s); #ifdef HAVE_KATE extern void oggmux_add_kate_text (oggmux_info *info, int idx, double t0, double t1, const char *text, size_t len, int x1, int x2, int y1, int y2); extern void oggmux_add_kate_image (oggmux_info *info, int idx, double t0, double t1, const kate_region *kr, const kate_palette *kp, const kate_bitmap *kb);
View file
ffmpeg2theora-0.29.tar.bz2/version.sh -> ffmpeg2theora-0.30.tar.bz2/version.sh
Changed
@@ -1,11 +1,8 @@ #!/bin/bash cd `dirname $0` version='0.29' -test -e .svn && svnversion=`which svnversion` -echo -n $version -if "x$svnversion" != "x" ; then - echo -n "+svn" - svnversion -else - echo +test -e .git && git=`which git` +if "x$git" != "x" ; then + version=$(cd "$1" && git describe --tags 2> /dev/null) fi +echo $version
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.