Codebase list ffmpeg2theora / upstream/0.29_git+20140316
Imported Upstream version 0.29~git+20140316 Tiago Bortoletto Vaz 10 years ago
25 changed file(s) with 169 addition(s) and 537 deletion(s). Raw diff Collapse all Expand all
77 scons install $(PREFIX)
88
99 dist:
10 svn export . ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
11 tar cjf ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`.tar.bz2 ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
12 rm -r ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
10 git archive --format=tar --prefix=ffmpeg2theora-`./version.sh`/ master | bzip2 >ffmpeg2theora-`./version.sh`.tar.bz2
11 ls -lah ffmpeg2theora-`./version.sh`.tar.bz2
55 import SCons
66
77 def version():
8 #return "0.29"
89 f = os.popen("./version.sh")
910 version = f.read().strip()
1011 f.close()
1112 return version
1213
13 pkg_version="0.29"
14 pkg_version=version()
1415
1516 pkg_name="ffmpeg2theora"
1617
150151 "libavcodec >= 52.30.0",
151152 "libpostproc",
152153 "libswscale",
153 "libswresample",
154154 "libavutil",
155155 ]
156156 if os.path.exists("./ffmpeg"):
159159 os.environ['PKG_CONFIG_PATH'] = ':'.join(pkg_path)
160160 env.Append(CCFLAGS=[
161161 '-Iffmpeg'
162 ])
163 for lib in FFMPEG_LIBS:
164 lib = lib.split(' ')[0]
165 env.Append(LINKFLAGS=[
166 '-Lffmpeg/' + lib
167 ])
168
169 if conf.CheckPKG('libavresample'):
170 FFMPEG_LIBS.append('libavresample')
171 else:
172 FFMPEG_LIBS.append('libswresample')
173 env.Append(CCFLAGS=[
174 '-DUSE_SWRESAMPLE'
162175 ])
163176
164177 if not conf.CheckPKG(' '.join(FFMPEG_LIBS)):
2020 uname | grep MINGW && options="$common --enable-memalign-hack --enable-mingw32 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib $extra"
2121
2222 #configure and build ffmpeg
23 cd $FFMPEG_CO_DIR && ./configure $options && make
23 cd $FFMPEG_CO_DIR && ./configure $options && make -j8
2424
+0
-120
debian/changelog less more
0 ffmpeg2theora (0.29-2) unstable; urgency=low
1
2 * Pushing 0.29 to unstable fixes FTBFS. (Closes: #713716)
3 * Remove obsolete DM-Upload-Allowed field.
4 * Replace uncanonical URI from VCS-* fields.
5 * Update Standards-Version.
6
7 -- Tiago Bortoletto Vaz <tiago@debian.org> Sat, 22 Jun 2013 11:37:44 -0400
8
9 ffmpeg2theora (0.29-1) experimental; urgency=low
10
11 * Migrate source to pkg-multimedia git repository tree.
12 * Add pkg-multimedia as maintainer
13 * New upstream version. (Closes: #692914, #652705)
14
15 -- Tiago Bortoletto Vaz <tiago@debian.org> Thu, 15 Nov 2012 15:05:50 -0500
16
17 ffmpeg2theora (0.27-2) unstable; urgency=low
18
19 * Switch to dpkg-source 3.0 (quilt) format
20 * Add ubuntu patch to build against libav/0.7. Last upstream version (0.28)
21 fails to build so let's use this patch for now. (Closes: #638245)
22 * Now we have 0.27 in unstable, so close "New version 0.25 out" whishlist.
23 (Closes: #549967)
24
25 -- Tiago Bortoletto Vaz <tiago@debian.org> Thu, 29 Sep 2011 00:41:10 -0300
26
27 ffmpeg2theora (0.27-1) experimental; urgency=low
28
29 * New upstream version
30 * debian/control:
31 - add myself as uploader
32 - Standards-Version 3.8.4
33
34 -- Tiago Bortoletto Vaz <tiago@debian.org> Tue, 22 Jun 2010 21:14:40 -0300
35
36 ffmpeg2theora (0.24-2) unstable; urgency=low
37
38 * debian/control: section changed (graphics -> video)
39 * debian/control: fix Vcs-* fields
40
41 -- RISKO Gergely <risko@debian.org> Fri, 20 Mar 2009 02:01:52 +0200
42
43 ffmpeg2theora (0.24-1) unstable; urgency=low
44
45 * New Upstream Version
46 Closes: #510826, #404646, #418701, #420232, #461421, #517470
47 * debian/rules:
48 - removed simple-patchsys
49 - removed autotools support
50 - added scons support (with debian/cdbs/scons* files)
51 * debian/control:
52 - updated build-dependencies
53 - Standards-Version 3.8.1
54 - added Vcs-* fields
55 * ffmpeg2theora.1:
56 - adapting changes from Kapil, thanks
57
58 -- RISKO Gergely <risko@debian.org> Fri, 20 Mar 2009 02:01:52 +0200
59
60 ffmpeg2theora (0.21-0.1) unstable; urgency=low
61
62 * Non-maintainer upload to fix RC bugs.
63 * New upstream release (0.21).
64 Closes: #484813, #482218, #487911.
65 * debian/control:
66 - added libavutil-dev, libavdevice-dev, libfaad-dev, libx11-dev,
67 libxext-dev to dependencies.
68 - added Homepage field
69 - Standards-Version 3.8.0
70 * debian/rules:
71 - added cdbs simple-patchsys include.
72 - added "as-needed" and "no-undefined" flags for linker
73 to reduce dependencies.
74 * debian/patches/01-fix_includes.patch: point the include
75 directives in ffmpeg2theora.c to the correct directories.
76 * debian/patches/02-fix_hyphen-used-as-minus_in_manpage.patch:
77 replaced incorrect uses of hyphen as minus in ffmpeg2theora.1.
78
79 -- Kapil Hari Paranjape <kapil@debian.org> Thu, 26 Jun 2008 06:47:53 +0530
80
81 ffmpeg2theora (0.19-1) unstable; urgency=low
82
83 * New upstream release (closes: #429937, #368588)
84 * removed now unneeded libdc1394-dev dependecy (closes: #413663)
85 * new build with new version of libavformat0d (closes: #430037)
86 * added libswscale-dev new dependency
87
88 -- RISKO Gergely <risko@debian.org> Sat, 28 Jul 2007 19:14:08 +0200
89
90 ffmpeg2theora (0.16-2) unstable; urgency=low
91
92 * added libgsm-dev and libdc1394-dev to build-depends (closes: #366025)
93
94 -- RISKO Gergely <risko@debian.org> Tue, 30 May 2006 16:43:46 +0200
95
96 ffmpeg2theora (0.16-1) unstable; urgency=low
97
98 * New upstream release
99 - fixes segfault when permission denied on output (closes: #352272)
100 - fixes misleading error message for wrong input format (closes: #338872)
101 * ftbfs fixed, i was silly when added -lgsm -ldc1394_control the day
102 before yesterday (closes: #352547)
103
104 -- RISKO Gergely <risko@debian.org> Mon, 13 Feb 2006 01:16:25 +0100
105
106 ffmpeg2theora (0.15-1) unstable; urgency=low
107
108 * New upstream release (closes: #335854)
109 * '-ldc1394_control -lgsm' added to LDFLAGS in rules (closes: #333636)
110 * changed FSF's postal address (thanks lintian!)
111
112 -- RISKO Gergely <risko@debian.org> Sat, 11 Feb 2006 14:20:15 +0100
113
114 ffmpeg2theora (0.13+svn20050704-1) unstable; urgency=low
115
116 * initial upload (closes: #279503)
117
118 -- RISKO Gergely <risko@debian.org> Mon, 4 Jul 2005 23:10:00 +0200
119
+0
-1
debian/compat less more
0 5
+0
-20
debian/control less more
0 Source: ffmpeg2theora
1 Section: video
2 Priority: optional
3 Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
4 Uploaders: Tiago Bortoletto Vaz <tiago@debian.org>, RISKO Gergely <risko@debian.org>
5 Vcs-Browser: http://anonscm.debian.org/git/pkg-multimedia/ffmpeg2theora.git
6 Vcs-Git: git://anonscm.debian.org/git/pkg-multimedia/ffmpeg2theora.git
7 Build-Depends: quilt, debhelper (>= 7.0.50~), libavcodec-dev (>= 4:0.6), libavutil-dev, libpostproc-dev (>= 4:0.6),
8 libswscale-dev (>= 4:0.6), libavformat-dev (>= 4:0.6), libavdevice-dev (>= 4:0.6), libogg-dev, libvorbis-dev,
9 libtheora-dev, scons, pkg-config, libkate-dev, liboggkate-dev, libavfilter-dev
10 Homepage: http://v2v.cc/~j/ffmpeg2theora/
11 Standards-Version: 3.9.4
12
13 Package: ffmpeg2theora
14 Architecture: any
15 Depends: ${shlibs:Depends}, ${misc:Depends}
16 Description: Theora video encoder using ffmpeg
17 This package provides a command-line tool to encode/recode various
18 video formats (basically everything that ffmpeg can read) into Theora,
19 the free video codec.
+0
-31
debian/copyright less more
0 This package was debianized by RISKO Gergely <risko@debian.org> on
1 Thu, 09 Jun 2005 15:55:02 +0200.
2
3 It was downloaded from http://www.v2v.cc/~j/ffmpeg2theora/index.html
4
5 Upstream Author: jan gerber <j@v2v.cc>
6
7 Copyright as mentioned in ffmpeg2theora.c source file:
8 /* -*- tab-width:4;c-file-style:"cc-mode"; -*- */
9 /*
10 * ffmpeg2theora.c -- Convert ffmpeg supported a/v files to Ogg Theora
11 * Copyright (C) 2003-2004 <j@v2v.cc>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software Foundation,
25 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26 *
27 */
28
29 You can find the mentioned GNU General Public License (GPL) (on a
30 Debian system) in the file /usr/share/common-licenses/GPL.
+0
-2
debian/docs less more
0 README
1 TODO
+0
-240
debian/patches/001-build-with-libav-0.7.patch less more
0 diff -pruN 0.27-1.1/src/avinfo.c 0.27-1.1ubuntu1/src/avinfo.c
1 --- 0.27-1.1/src/avinfo.c 2010-06-23 01:07:49.000000000 +0100
2 +++ 0.27-1.1ubuntu1/src/avinfo.c 2011-07-14 09:06:37.000000000 +0100
3 @@ -196,7 +196,7 @@ void json_codec_info(FILE *output, AVCod
4 }
5
6 switch(enc->codec_type) {
7 - case CODEC_TYPE_VIDEO:
8 + case AVMEDIA_TYPE_VIDEO:
9 codec_name = fix_codec_name(codec_name);
10 json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent);
11 if (enc->pix_fmt != PIX_FMT_NONE) {
12 @@ -224,7 +224,7 @@ void json_codec_info(FILE *output, AVCod
13 json_add_key_value(output, "bitrate", &t, JSON_FLOAT, 0, indent);
14 }
15 break;
16 - case CODEC_TYPE_AUDIO:
17 + case AVMEDIA_TYPE_AUDIO:
18 codec_name = fix_codec_name(codec_name);
19 json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent);
20 if (enc->sample_rate) {
21 @@ -277,15 +277,15 @@ void json_codec_info(FILE *output, AVCod
22 }
23 break;
24 /*
25 - case CODEC_TYPE_DATA:
26 + case AVMEDIA_TYPE_DATA:
27 fprintf(output, "datacodec: %s\n", codec_name);
28 bitrate = enc->bit_rate;
29 break;
30 - case CODEC_TYPE_SUBTITLE:
31 + case AVMEDIA_TYPE_SUBTITLE:
32 fprintf(output, "subtitle: %s\n", codec_name);
33 bitrate = enc->bit_rate;
34 break;
35 - case CODEC_TYPE_ATTACHMENT:
36 + case AVMEDIA_TYPE_ATTACHMENT:
37 fprintf(output, "attachment: : %s\n", codec_name);
38 bitrate = enc->bit_rate;
39 break;
40 @@ -330,7 +330,7 @@ static void json_stream_format(FILE *out
41 display_aspect_ratio.num, display_aspect_ratio.den);
42 json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent + 1);
43 }
44 - if(st->codec->codec_type == CODEC_TYPE_VIDEO){
45 + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
46 if (st->time_base.den && st->time_base.num && av_q2d(st->time_base) > 0.001) {
47 snprintf(buf1, sizeof(buf1), "%d:%d",
48 st->time_base.den, st->time_base.num);
49 @@ -340,6 +340,20 @@ static void json_stream_format(FILE *out
50 st->r_frame_rate.num, st->r_frame_rate.den);
51 json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1);
52 }
53 + if (st->sample_aspect_ratio.num && // default
54 + av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
55 + AVRational display_aspect_ratio;
56 + av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
57 + st->codec->width*st->sample_aspect_ratio.num,
58 + st->codec->height*st->sample_aspect_ratio.den,
59 + 1024*1024);
60 + snprintf(buf1, sizeof(buf1), "%d:%d",
61 + st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
62 + json_add_key_value(output, "pixel_aspect_ratio", buf1, JSON_STRING, 0, indent+1);
63 + snprintf(buf1, sizeof(buf1), "%d:%d",
64 + display_aspect_ratio.num, display_aspect_ratio.den);
65 + json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent+1);
66 + }
67 }
68 json_add_key_value(output, "id", &i, JSON_INT, 1, indent + 1);
69 do_indent(output, indent-1);
70 @@ -484,11 +498,11 @@ void json_format_info(FILE* output, AVFo
71 int j, k;
72 for(j=0; j<ic->nb_programs; j++) {
73 for(k=0; k<ic->programs[j]->nb_stream_indexes; k++)
74 - json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_VIDEO);
75 + json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_VIDEO);
76 }
77 } else {
78 for(i=0;i<ic->nb_streams;i++) {
79 - json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_VIDEO);
80 + json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_VIDEO);
81 }
82 }
83 fprintf(output, "],\n");
84 @@ -499,11 +513,11 @@ void json_format_info(FILE* output, AVFo
85 int j, k;
86 for(j=0; j<ic->nb_programs; j++) {
87 for(k=0; k<ic->programs[j]->nb_stream_indexes; k++)
88 - json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_AUDIO);
89 + json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_AUDIO);
90 }
91 } else {
92 for(i=0;i<ic->nb_streams;i++) {
93 - json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_AUDIO);
94 + json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_AUDIO);
95 }
96 }
97 fprintf(output, "],\n");
98 diff -pruN 0.27-1.1/src/ffmpeg2theora.c 0.27-1.1ubuntu1/src/ffmpeg2theora.c
99 --- 0.27-1.1/src/ffmpeg2theora.c 2010-06-23 01:07:49.000000000 +0100
100 +++ 0.27-1.1ubuntu1/src/ffmpeg2theora.c 2011-07-14 09:06:37.000000000 +0100
101 @@ -341,7 +341,7 @@ static void prepare_ycbcr_buffer(ff2theo
102 static const char *find_category_for_subtitle_stream (ff2theora this, int idx, int included_subtitles)
103 {
104 AVCodecContext *enc = this->context->streams[idx]->codec;
105 - if (enc->codec_type != CODEC_TYPE_SUBTITLE) return 0;
106 + if (enc->codec_type != AVMEDIA_TYPE_SUBTITLE) return 0;
107 switch (enc->codec_id) {
108 case CODEC_ID_TEXT:
109 case CODEC_ID_SSA:
110 @@ -500,9 +500,11 @@ static void extra_info_from_ssa(AVPacket
111
112 static const char *find_language_for_subtitle_stream(const AVStream *s)
113 {
114 - const char *lang=find_iso639_1(s->language);
115 + AVMetadataTag *language = av_metadata_get(s->metadata, "language", NULL, 0);
116 + const char *lang=find_iso639_1(language->value);
117 if (!lang) {
118 - fprintf(stderr,"WARNING - unrecognized ISO 639-2 language code: %s\n",s->language);
119 + fprintf(stderr, "WARNING - unrecognized ISO 639-2 language code: %s\n",
120 + language->value);
121 }
122 return lang;
123 }
124 @@ -516,8 +518,8 @@ void ff2theora_output(ff2theora this) {
125 AVStream *vstream = NULL;
126 AVCodec *acodec = NULL;
127 AVCodec *vcodec = NULL;
128 - pp_mode_t *ppMode = NULL;
129 - pp_context_t *ppContext = NULL;
130 + pp_mode *ppMode = NULL;
131 + pp_context *ppContext = NULL;
132 int sws_flags;
133 float frame_aspect = 0;
134 double fps = 0.0;
135 @@ -530,7 +532,7 @@ void ff2theora_output(ff2theora this) {
136
137 if (this->audiostream >= 0 && this->context->nb_streams > this->audiostream) {
138 AVCodecContext *enc = this->context->streams[this->audiostream]->codec;
139 - if (enc->codec_type == CODEC_TYPE_AUDIO) {
140 + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
141 this->audio_index = this->audiostream;
142 fprintf(stderr, " Using stream #0.%d as audio input\n",this->audio_index);
143 }
144 @@ -540,7 +542,7 @@ void ff2theora_output(ff2theora this) {
145 }
146 if (this->videostream >= 0 && this->context->nb_streams > this->videostream) {
147 AVCodecContext *enc = this->context->streams[this->videostream]->codec;
148 - if (enc->codec_type == CODEC_TYPE_VIDEO) {
149 + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
150 this->video_index = this->videostream;
151 fprintf(stderr, " Using stream #0.%d as video input\n",this->video_index);
152 }
153 @@ -552,11 +554,11 @@ void ff2theora_output(ff2theora this) {
154 for (i = 0; i < this->context->nb_streams; i++) {
155 AVCodecContext *enc = this->context->streams[i]->codec;
156 switch (enc->codec_type) {
157 - case CODEC_TYPE_VIDEO:
158 + case AVMEDIA_TYPE_VIDEO:
159 if (this->video_index < 0 && !this->disable_video)
160 this->video_index = i;
161 break;
162 - case CODEC_TYPE_AUDIO:
163 + case AVMEDIA_TYPE_AUDIO:
164 if (this->audio_index < 0 && !this->disable_audio)
165 this->audio_index = i;
166 break;
167 @@ -980,7 +982,7 @@ void ff2theora_output(ff2theora this) {
168 AVStream *stream = this->context->streams[i];
169 AVCodecContext *enc = stream->codec;
170 const char *category;
171 - if (enc->codec_type == CODEC_TYPE_SUBTITLE) {
172 + if (enc->codec_type == AVMEDIA_TYPE_SUBTITLE) {
173 AVCodec *codec = avcodec_find_decoder (enc->codec_id);
174 if (codec && avcodec_open (enc, codec) >= 0) {
175 subtitles_opened[i] = 1;
176 @@ -1451,9 +1453,11 @@ void ff2theora_output(ff2theora this) {
177 }
178 if (this->sws_scale_ctx) {
179 sws_scale(this->sws_scale_ctx,
180 - output_cropped->data, output_cropped->linesize, 0,
181 - display_height - (this->frame_topBand + this->frame_bottomBand),
182 - output_resized->data, output_resized->linesize);
183 + output_cropped->data,
184 + output_cropped->linesize, 0,
185 + display_height - (this->frame_topBand + this->frame_bottomBand),
186 + output_resized->data,
187 + output_resized->linesize);
188 }
189 else{
190 output_resized = output_cropped;
191 @@ -1512,7 +1516,7 @@ void ff2theora_output(ff2theora this) {
192 int samples=0;
193 int samples_out=0;
194 int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE;
195 - int bytes_per_sample = av_get_bits_per_sample_format(aenc->sample_fmt)/8;
196 + int bytes_per_sample = av_get_bits_per_sample_fmt(aenc->sample_fmt)/8;
197
198 if (avpkt.size > 0) {
199 len1 = avcodec_decode_audio3(astream->codec, audio_buf, &data_size, &avpkt);
200 @@ -2726,8 +2730,7 @@ int main(int argc, char **argv) {
201
202 for(info.passno=(info.twopass==3?1:info.twopass);info.passno<=(info.twopass==3?2:info.twopass);info.passno++){
203 //detect image sequences and set framerate if provided
204 - if (av_guess_image2_codec(inputfile_name) != CODEC_ID_NONE || \
205 - (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0)) {
206 + if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) {
207 formatParams = &params;
208 memset(formatParams, 0, sizeof(*formatParams));
209 if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) {
210 @@ -2748,7 +2751,6 @@ int main(int argc, char **argv) {
211 formatParams->time_base.den = convert->framerate_new.num;
212 formatParams->time_base.num = convert->framerate_new.den;
213 }
214 - formatParams->video_codec_id = av_guess_image2_codec(inputfile_name);
215 }
216 if (av_open_input_file(&convert->context, inputfile_name, input_fmt, 0, formatParams) >= 0) {
217 if (av_find_stream_info(convert->context) >= 0) {
218 @@ -2760,9 +2762,9 @@ int main(int argc, char **argv) {
219 for (i = 0; i < convert->context->nb_streams; i++) {
220 AVCodecContext *enc = convert->context->streams[i]->codec;
221 switch (enc->codec_type) {
222 - case CODEC_TYPE_VIDEO: has_video = 1; break;
223 - case CODEC_TYPE_AUDIO: has_audio = 1; break;
224 - case CODEC_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break;
225 + case AVMEDIA_TYPE_VIDEO: has_video = 1; break;
226 + case AVMEDIA_TYPE_AUDIO: has_audio = 1; break;
227 + case AVMEDIA_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break;
228 default: break;
229 }
230 }
231 @@ -2828,7 +2830,7 @@ int main(int argc, char **argv) {
232
233 if (!info.frontend) {
234 if (info.twopass!=3 || info.passno==1) {
235 - dump_format(convert->context, 0,inputfile_name, 0);
236 + av_dump_format(convert->context, 0,inputfile_name, 0);
237 }
238 }
239 if (convert->disable_audio) {
+0
-11
debian/patches/002-Makefile.patch less more
0 --- ffmpeg2theora-0.27.orig/Makefile
1 +++ ffmpeg2theora-0.27/Makefile
2 @@ -5,7 +5,7 @@ clean:
3 scons -c
4
5 install:
6 - scons install $(PREFIX)
7 + scons install destdir=$(CURDIR)/debian/ffmpeg2theora prefix=/usr mandir=$(CURDIR)/debian/ffmpeg2theora/usr/share/man
8
9 dist:
10 svn export . ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
+0
-10
debian/patches/003-libswresample.patch less more
0 --- a/SConstruct
1 +++ b/SConstruct
2 @@ -151,7 +151,6 @@
3 "libavcodec >= 52.30.0",
4 "libpostproc",
5 "libswscale",
6 - "libswresample",
7 "libavutil",
8 ]
9 if os.path.exists("./ffmpeg"):
+0
-3
debian/patches/series less more
0 #001-build-with-libav-0.7.patch
1 002-Makefile.patch
2 003-libswresample.patch
+0
-18
debian/rules less more
0 #!/usr/bin/make -f
1
2 #DEB_SCONS_OPTIONS := prefix=/usr destdir=$(DEB_DESTDIR) mandir=PREFIX/share/man
3
4 #PREFIX="prefix=$(CURDIR)/debian/ffmpeg2theora/usr destdir=$(CURDIR)/debian/ffmpeg2theora mandir=$(CURDIR)/debian/usr/share/man"
5
6 %:
7 dh $@ --with quilt
8
9 #override_dh_auto_build:
10 # scons
11 #
12 #override_dh_auto_install:
13 # PREFIX="destdir=$(CURDIR)/debian/ffmpeg2theora prefix=/usr mandir=$(CURDIR)/debian/usr/share/man"; make install
14
15 override_dh_auto_clean:
16 dh_auto_clean
17 rm -rf .sconf_temp/ .sconsign.dblite config.log
+0
-1
debian/source/format less more
0 3.0 (quilt)
+0
-1
debian/source/local-options less more
0 unapply-patches
+0
-3
debian/watch less more
0 # watch control file for uscan
1 version=2
2 http://www.v2v.cc/~j/ffmpeg2theora/download.html ffmpeg2theora-([\d\.]*)\.tar\.bz2
0 <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>
0 <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>
0 <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>
0 <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>
461461 char hash[32];
462462 #ifdef WIN32
463463 sprintf(hash,"%016I64x", gen_oshash(filename));
464 #elif defined (__SVR4) && defined (__sun)
465 sprintf(hash,"%016llx", gen_oshash(filename));
464466 #else
465467 sprintf(hash,"%016qx", gen_oshash(filename));
466468 #endif
3232 #include "libswscale/swscale.h"
3333 #include "libpostproc/postprocess.h"
3434
35 #include "libavutil/opt.h"
36 #include "libavutil/channel_layout.h"
37 #include "libavutil/samplefmt.h"
38 #include "libswresample_compat.h"
39
3540 #include "theora/theoraenc.h"
3641 #include "vorbis/codec.h"
3742 #include "vorbis/vorbisenc.h"
4550 #include "subtitles.h"
4651 #include "ffmpeg2theora.h"
4752 #include "avinfo.h"
53
54 #define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
55
4856
4957 #define LENGTH(x) (sizeof(x) / sizeof(*x))
5058
533541 int synced = this->start_time == 0.0;
534542 AVRational display_aspect_ratio, sample_aspect_ratio;
535543
544 struct SwrContext *swr_ctx;
545 uint8_t **dst_audio_data = NULL;
546 int dst_linesize;
547 int src_nb_samples = 1024, dst_nb_samples, max_dst_nb_samples;
548
536549 if (this->audiostream >= 0 && this->context->nb_streams > this->audiostream) {
537550 AVCodecContext *enc = this->context->streams[this->audiostream]->codec;
538551 if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
594607 }
595608 this->fps = fps = av_q2d(vstream_fps);
596609
610 venc->thread_count = 1;
597611 if (vcodec == NULL || avcodec_open2 (venc, vcodec, NULL) < 0) {
598612 this->video_index = -1;
599613 }
953967 if (this->channels > aenc->channels)
954968 this->channels = aenc->channels;
955969 }
956
970 aenc->thread_count = 1;
957971 if (acodec != NULL && avcodec_open2 (aenc, acodec, NULL) >= 0) {
958972 if (this->sample_rate != sample_rate
959973 || this->channels != aenc->channels
960 || aenc->sample_fmt != AV_SAMPLE_FMT_S16) {
961 // values take from libavcodec/resample.c
962 this->audio_resample_ctx = av_audio_resample_init(this->channels, aenc->channels,
963 this->sample_rate, sample_rate,
964 AV_SAMPLE_FMT_S16, aenc->sample_fmt,
965 16, 10, 0, 0.8);
966 if (!this->audio_resample_ctx) {
967 this->channels = aenc->channels;
968 }
974 || aenc->sample_fmt != AV_SAMPLE_FMT_FLTP) {
975 swr_ctx = swr_alloc();
976 /* set options */
977 if (aenc->channel_layout) {
978 av_opt_set_int(swr_ctx, "in_channel_layout", aenc->channel_layout, 0);
979 } else {
980 av_opt_set_int(swr_ctx, "in_channel_layout", av_get_default_channel_layout(aenc->channels), 0);
981 }
982 av_opt_set_int(swr_ctx, "in_sample_rate", aenc->sample_rate, 0);
983 av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", aenc->sample_fmt, 0);
984
985 av_opt_set_int(swr_ctx, "out_channel_layout", av_get_default_channel_layout(this->channels), 0);
986 av_opt_set_int(swr_ctx, "out_sample_rate", this->sample_rate, 0);
987 av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
988
989 /* initialize the resampling context */
990 if (swr_init(swr_ctx) < 0) {
991 fprintf(stderr, "Failed to initialize the resampling context\n");
992 exit(1);
993 }
994
995 max_dst_nb_samples = dst_nb_samples =
996 av_rescale_rnd(src_nb_samples, this->sample_rate, sample_rate, AV_ROUND_UP);
997
998 if (av_samples_alloc_array_and_samples(&dst_audio_data, &dst_linesize, this->channels,
999 dst_nb_samples, AV_SAMPLE_FMT_FLTP, 0) < 0) {
1000 fprintf(stderr, "Could not allocate destination samples\n");
1001 exit(1);
1002 }
1003
9691004 if (!info.frontend && this->sample_rate!=sample_rate)
9701005 fprintf(stderr, " Resample: %dHz => %dHz\n", sample_rate,this->sample_rate);
9711006 if (!info.frontend && this->channels!=aenc->channels)
9721007 fprintf(stderr, " Channels: %d => %d\n",aenc->channels,this->channels);
9731008 }
9741009 else{
975 this->audio_resample_ctx=NULL;
1010 swr_ctx = NULL;
9761011 }
9771012 }
9781013 else{
10631098 AVPacket pkt;
10641099 AVPacket avpkt;
10651100 int len1;
1066 int got_picture;
1101 int got_frame;
10671102 int first = 1;
10681103 int audio_eos = 0, video_eos = 0, audio_done = 0, video_done = 0;
10691104 int ret;
1070 int16_t *audio_buf=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
1071 int16_t *resampled=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
1072 int16_t *audio_p=NULL;
1105 AVFrame *audio_frame = NULL;
1106 uint8_t **audio_p = NULL;
10731107 int no_frames;
10741108 int no_samples;
10751109
13651399 first frame decodec in case its not a keyframe
13661400 */
13671401 if (pkt.stream_index == this->video_index) {
1368 avcodec_decode_video2(venc, frame, &got_picture, &pkt);
1402 avcodec_decode_video2(venc, frame, &got_frame, &pkt);
13691403 }
13701404 av_free_packet (&pkt);
13711405 continue;
13841418 while(video_eos || avpkt.size > 0) {
13851419 int dups = 0;
13861420 static th_ycbcr_buffer ycbcr;
1387 len1 = avcodec_decode_video2(venc, frame, &got_picture, &avpkt);
1421 len1 = avcodec_decode_video2(venc, frame, &got_frame, &avpkt);
13881422 if (len1>=0) {
1389 if (got_picture) {
1423 if (got_frame) {
13901424 // this is disabled by default since it does not work
13911425 // for all input formats the way it should.
13921426 if (this->sync == 1 && pkt.dts != AV_NOPTS_VALUE) {
14231457
14241458 if (venc_pix_fmt != this->pix_fmt) {
14251459 sws_scale(this->sws_colorspace_ctx,
1426 frame->data, frame->linesize, 0, display_height,
1460 (const uint8_t * const*)frame->data, frame->linesize, 0, display_height,
14271461 output_tmp->data, output_tmp->linesize);
14281462 }
14291463 else{
14671501 }
14681502 if (this->sws_scale_ctx) {
14691503 sws_scale(this->sws_scale_ctx,
1470 output_cropped->data,
1504 (const uint8_t * const*)output_cropped->data,
14711505 output_cropped->linesize, 0,
14721506 display_height - (this->frame_topBand + this->frame_bottomBand),
14731507 output_resized->data,
14951529 //now output_resized
14961530
14971531 if (!first) {
1498 if (got_picture || video_eos) {
1532 if (got_frame || video_eos) {
14991533 prepare_ycbcr_buffer(this, ycbcr, output_buffered);
15001534 if(dups>0) {
15011535 //this only works if dups < keyint,
15151549 info.videotime = this->frame_count / av_q2d(this->framerate);
15161550 }
15171551 }
1518 if (got_picture) {
1552 if (got_frame) {
15191553 first=0;
15201554 av_picture_copy((AVPicture *)output_buffered, (AVPicture *)output_padded, this->pix_fmt, this->frame_width, this->frame_height);
15211555 }
1522 if (!got_picture) {
1556 if (!got_frame) {
15231557 break;
15241558 }
15251559 }
15271561 if (info.passno!=1)
15281562 if ((audio_eos && !audio_done) || (ret >= 0 && pkt.stream_index == this->audio_index)) {
15291563 while((audio_eos && !audio_done) || avpkt.size > 0 ) {
1530 int samples=0;
1531 int samples_out=0;
1532 int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE;
15331564 int bytes_per_sample = av_get_bytes_per_sample(aenc->sample_fmt);
15341565
15351566 if (avpkt.size > 0) {
1536 len1 = avcodec_decode_audio3(astream->codec, audio_buf, &data_size, &avpkt);
1567 if (!audio_frame && !(audio_frame = avcodec_alloc_frame())) {
1568 fprintf(stderr, "Failed to allocate memory\n");
1569 exit(1);
1570 }
1571 len1 = avcodec_decode_audio4(astream->codec, audio_frame, &got_frame, &avpkt);
15371572 if (len1 < 0) {
15381573 /* if error, we skip the frame */
15391574 break;
1575 }
1576 /* Some audio decoders decode only part of the packet, and have to be
1577 * called again with the remainder of the packet data.
1578 * Sample: http://fate-suite.libav.org/lossless-audio/luckynight-partial.shn
1579 * Also, some decoders might over-read the packet. */
1580 len1 = FFMIN(len1, avpkt.size);
1581 if (got_frame) {
1582 dst_nb_samples = audio_frame->nb_samples;
1583 if (swr_ctx) {
1584 dst_nb_samples = av_rescale_rnd(audio_frame->nb_samples,
1585 this->sample_rate, aenc->sample_rate, AV_ROUND_UP);
1586 if (dst_nb_samples > max_dst_nb_samples) {
1587 av_free(dst_audio_data[0]);
1588 if (av_samples_alloc(dst_audio_data, &dst_linesize, this->channels,
1589 dst_nb_samples, AV_SAMPLE_FMT_FLTP, 1) < 0) {
1590 fprintf(stderr, "Error while converting audio\n");
1591 exit(1);
1592 }
1593 max_dst_nb_samples = dst_nb_samples;
1594 }
1595 if (swr_convert(swr_ctx, dst_audio_data, dst_nb_samples,
1596 (const uint8_t**)audio_frame->extended_data, audio_frame->nb_samples) < 0) {
1597 fprintf(stderr, "Error while converting audio\n");
1598 exit(1);
1599 }
1600 audio_p = dst_audio_data;
1601 } else {
1602 audio_p = audio_frame->extended_data;
1603 }
15401604 }
15411605 avpkt.size -= len1;
15421606 avpkt.data += len1;
1543 if (data_size >0) {
1544 samples = data_size / (aenc->channels * bytes_per_sample);
1545 samples_out = samples;
1546 if (this->audio_resample_ctx) {
1547 samples_out = audio_resample(this->audio_resample_ctx, resampled, audio_buf, samples);
1548 audio_p = resampled;
1549 }
1550 else
1551 audio_p = audio_buf;
1607 }
1608 if(got_frame || audio_eos) {
1609 if (no_samples > 0 && this->sample_count + dst_nb_samples > no_samples) {
1610 audio_eos = 1;
1611 dst_nb_samples = no_samples - this->sample_count;
1612 if (dst_nb_samples <= 0) {
1613 break;
1614 }
15521615 }
1616 oggmux_add_audio(&info, audio_p, dst_nb_samples, audio_eos);
1617 avcodec_free_frame(&audio_frame);
1618 this->sample_count += dst_nb_samples;
15531619 }
1554
1555 if (no_samples > 0 && this->sample_count + samples_out > no_samples) {
1556 audio_eos = 1;
1557 samples_out = no_samples - this->sample_count;
1558 if (samples_out <= 0) {
1559 break;
1560 }
1561 }
1562
1563 oggmux_add_audio(&info, audio_p,
1564 samples_out * (this->channels), samples_out, audio_eos);
1565 this->sample_count += samples_out;
15661620 if(audio_eos) {
15671621 audio_done = 1;
15681622 }
17471801 avcodec_close(venc);
17481802 }
17491803 if (this->audio_index >= 0) {
1750 if (this->audio_resample_ctx)
1751 audio_resample_close(this->audio_resample_ctx);
1804 if (swr_ctx)
1805 swr_free(&swr_ctx);
17521806 avcodec_close(aenc);
17531807 }
17541808
17691823 frame_dealloc(output_cropped_p);
17701824 frame_dealloc(output_padded_p);
17711825 }
1772 av_free(audio_buf);
1773 av_free(resampled);
1826 if (dst_audio_data)
1827 av_freep(&dst_audio_data[0]);
1828 av_freep(&dst_audio_data);
1829 if(swr_ctx) {
1830 swr_close(swr_ctx);
1831 }
17741832 }
17751833 else{
17761834 fprintf(stderr, "No video or audio stream found.\n");
27682826 outputfile_set=1;
27692827 }
27702828 optind++;
2829 } else {
2830 fprintf(stderr, "ERROR: no input specified\n");
2831 exit(1);
27712832 }
27722833 if(optind<argc) {
27732834 fprintf(stderr, "WARNING: Only one input file supported, others will be ignored\n");
6161 double fps;
6262 struct SwsContext *sws_colorspace_ctx; /* for image resampling/resizing */
6363 struct SwsContext *sws_scale_ctx; /* for image resampling/resizing */
64 ReSampleContext *audio_resample_ctx;
6564 ogg_int32_t aspect_numerator;
6665 ogg_int32_t aspect_denominator;
6766 int colorspace;
0 // This header serves to smooth out the differences in FFmpeg and LibAV.
1
2 #ifdef USE_SWRESAMPLE
3
4 #include <libswresample/swresample.h>
5
6 //swr does not have the equivalent so this does nothing
7 void swr_close(SwrContext *ctx) {};
8
9 #else
10
11 #include <libavresample/avresample.h>
12
13 #define SwrContext AVAudioResampleContext
14 #define swr_init(ctx) avresample_open(ctx)
15 #define swr_close(ctx) avresample_close(ctx)
16 #define swr_free(ctx) avresample_free(ctx)
17 #define swr_alloc() avresample_alloc_context()
18 #define swr_get_delay(ctx, ...) avresample_get_delay(ctx)
19 #define swr_convert(ctx, out, out_count, in, in_count) \
20 avresample_convert(ctx, out, 0, out_count, (uint8_t **)in, 0, in_count)
21
22 #endif
12181218 /**
12191219 * adds audio samples to encoding sink
12201220 * @param buffer pointer to buffer
1221 * @param bytes bytes in buffer
12221221 * @param samples samples in buffer
12231222 * @param e_o_s 1 indicates end of stream.
12241223 */
1225 void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int samples, int e_o_s) {
1224 void oggmux_add_audio (oggmux_info *info, uint8_t **buffer, int samples, int e_o_s) {
12261225 ogg_packet op;
12271226
12281227 int i, j, k, count = 0;
12291228 float **vorbis_buffer;
12301229
1231 if (bytes <= 0 && samples <= 0) {
1230 if (samples <= 0) {
12321231 /* end of audio stream */
12331232 if (e_o_s)
12341233 vorbis_analysis_wrote (&info->vd, 0);
12511250 default: k = j;
12521251 }
12531252 }
1254 vorbis_buffer[k][i] = buffer[count++] / 32768.f;
1253 vorbis_buffer[k][i] = ((const float *)buffer[j])[i];
12551254 }
12561255 }
12571256 vorbis_analysis_wrote (&info->vd, samples);
12901289 if (op.packetno != 4) {
12911290 /* We only expect negative start granule in the first content
12921291 packet, not any of the others... */
1293 fprintf(stderr, "WARNING: vorbis packet %lld has calculated start"
1294 " granule of %lld, but it should be non-negative!",
1292 fprintf(stderr, "WARNING: vorbis packet %" PRId64 " has calculated start"
1293 " granule of %" PRId64 ", but it should be non-negative!",
12951294 op.packetno, start_granule);
12961295 }
12971296 start_granule = 0;
13011300 allowed by the specification in the last packet only, and the
13021301 trailing samples should be discarded and not played/indexed. */
13031302 if (!op.e_o_s) {
1304 fprintf(stderr, "WARNING: vorbis packet %lld (granulepos %lld) starts before"
1303 fprintf(stderr, "WARNING: vorbis packet %" PRId64 " (granulepos %" PRId64 ") starts before"
13051304 " the end of the preceeding packet!", op.packetno, op.granulepos);
13061305 }
13071306 start_granule = info->vorbis_granulepos;
167167 extern void oggmux_setup_kate_streams(oggmux_info *info, int n_kate_streams);
168168 extern void oggmux_init (oggmux_info *info);
169169 extern void oggmux_add_video (oggmux_info *info, th_ycbcr_buffer ycbcr, int e_o_s);
170 extern void oggmux_add_audio (oggmux_info *info, int16_t * readbuffer, int bytesread, int samplesread,int e_o_s);
170 extern void oggmux_add_audio (oggmux_info *info, uint8_t **buffer, int samples,int e_o_s);
171171 #ifdef HAVE_KATE
172172 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);
173173 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);
00 #!/bin/bash
11 cd `dirname $0`
22 version='0.29'
3 test -e .svn && svnversion=`which svnversion`
4 echo -n $version
5 if [ "x$svnversion" != "x" ]; then
6 echo -n "+svn"
7 svnversion
8 else
9 echo
3 test -e .git && git=`which git`
4 if [ "x$git" != "x" ]; then
5 version=$(cd "$1" && git describe --tags 2> /dev/null)
106 fi
7 echo $version