Skip to content

Commit

Permalink
Merge remote-tracking branch 'qatar/master'
Browse files Browse the repository at this point in the history
* qatar/master: (21 commits)
  Warn about avserver being broken.
  avconv: drop code for special handling of avserver streams.
  rawdec: don't set codec timebase.
  lavf doxy: add muxing stuff to lavf_encoding group
  lavf doxy: add demuxing stuff to lavf_decoding group
  lavf doxy: expand/reword metadata API doxy.
  lavf doxy: add installed headers to groups.
  lavf doxy: add avio groups into the lavf_io group.
  lavf doxy: rename lavf I/O group to lavf_io.
  lavf doxy: add metadata docs to the main lavf group
  ttadec: check channel count as read from extradata.
  Add CLJR encoding and decoding regression tests
  cljr: remove unused code
  flacdec: Support for tracks in cuesheet metadata block
  ptx: fix inverted check for sufficient data
  flac muxer: fix writing of file header and STREAMINFO header from extradata
  ptx: emit a warning on insufficient picture data
  utvideo: add fate tests covering all codec variants
  doc: update to refer to avconv
  doc: remove some stale entries from the faq
  ...

Conflicts:
	Changelog
	avconv.c
	doc/avconv.texi
	doc/faq.texi
	doc/ffplay.texi
	doc/ffprobe.texi
	doc/ffserver.texi
	libavcodec/avcodec.h
	libavcodec/cljr.c
	libavformat/avformat.h
	libavformat/riff.c

Merged-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Dec 11, 2011
2 parents cdba9b6 + 2e87b4c commit 964912a
Show file tree
Hide file tree
Showing 31 changed files with 342 additions and 229 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ easier to use. The changes are:
- PCM format support in OMA demuxer
- CLJR encoder
- new option: -report
- Dxtory capture format decoder


version 0.8:
Expand Down
46 changes: 1 addition & 45 deletions avconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3635,41 +3635,6 @@ static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
return 0;
}

static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const char *filename)
{
int i, err;
AVFormatContext *ic = avformat_alloc_context();

ic->interrupt_callback = int_cb;
err = avformat_open_input(&ic, filename, NULL, NULL);
if (err < 0)
return err;
/* copy stream format */
for(i=0;i<ic->nb_streams;i++) {
AVStream *st;
OutputStream *ost;
AVCodec *codec;

codec = avcodec_find_encoder(ic->streams[i]->codec->codec_id);
ost = new_output_stream(o, s, codec->type);
st = ost->st;

// FIXME: a more elegant solution is needed
memcpy(st, ic->streams[i], sizeof(AVStream));
st->info = av_malloc(sizeof(*st->info));
memcpy(st->info, ic->streams[i]->info, sizeof(*st->info));
avcodec_copy_context(st->codec, ic->streams[i]->codec);

if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !ost->stream_copy)
choose_sample_fmt(st, codec);
else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && !ost->stream_copy)
choose_pixel_fmt(st, codec);
}

av_close_input_file(ic);
return 0;
}

static void opt_output_file(void *optctx, const char *filename)
{
OptionsContext *o = optctx;
Expand All @@ -3691,16 +3656,7 @@ static void opt_output_file(void *optctx, const char *filename)
file_oformat= oc->oformat;
oc->interrupt_callback = int_cb;

if (!strcmp(file_oformat->name, "ffm") &&
av_strstart(filename, "http:", NULL)) {
/* special case for files sent to ffserver: we get the stream
parameters from ffserver */
int err = read_ffserver_streams(o, oc, filename);
if (err < 0) {
print_error(filename, err);
exit_program(1);
}
} else if (!o->nb_stream_maps) {
if (!o->nb_stream_maps) {
/* pick the "best" stream of each type */
#define NEW_STREAM(type, index)\
if (index >= 0) {\
Expand Down
3 changes: 2 additions & 1 deletion doc/avconv.texi
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Set the number of video frames to record. This is an alias for @code{-frames:v}.
@item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
Set frame rate (Hz value, fraction or abbreviation), (default = 25).
@item -s[:@var{stream_specifier}] @var{size} (@emph{input/output,per-stream})
Set frame size. The format is @samp{wxh} (ffserver default = 160x128, avconv default = same as source).
Set frame size. The format is @samp{wxh} (default - same as source).
The following abbreviations are recognized:
@table @samp
@item sqcif
Expand Down Expand Up @@ -1029,6 +1029,7 @@ the input file in reverse order.
@c man begin SEEALSO
ffplay(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation
@c man end
@c man begin AUTHORS
Expand Down
144 changes: 16 additions & 128 deletions doc/faq.texi
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@

@chapter General Questions

@section When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?

Like most open source projects FFmpeg suffers from a certain lack of
manpower. For this reason the developers have to prioritize the work
they do and putting out releases is not at the top of the list, fixing
bugs and reviewing patches takes precedence. Please don't complain or
request more timely and/or frequent releases unless you are willing to
help out creating them.

@section I have a problem with an old version of FFmpeg; where should I report it?
Nowhere. We do not support old FFmpeg versions in any way, we simply lack
the time, motivation and manpower to do so. If you have a problem with an
old version of FFmpeg, upgrade to the latest git snapshot. If you
still experience the problem, then you can report it according to the
guidelines in @url{http://ffmpeg.org/bugreports.html}.

@section Why doesn't FFmpeg support feature [xyz]?

Because no one has taken on that task yet. FFmpeg development is
Expand All @@ -40,30 +24,6 @@ No. Windows DLLs are not portable, bloated and often slow.
Moreover FFmpeg strives to support all codecs natively.
A DLL loader is not conducive to that goal.

@section My bug report/mail to ffmpeg-devel/user has not received any replies.

Likely reasons
@itemize
@item We are busy and haven't had time yet to read your report or
investigate the issue.
@item You didn't follow @url{http://ffmpeg.org/bugreports.html}.
@item You didn't use git master.
@item You reported a segmentation fault without gdb output.
@item You describe a problem but not how to reproduce it.
@item It's unclear if you use ffmpeg as command line tool or use
libav* from another application.
@item You speak about a video having problems on playback but
not what you use to play it.
@item We have no faint clue what you are talking about besides
that it is related to FFmpeg.
@end itemize

@section Is there a forum for FFmpeg? I do not like mailing lists.

You may view our mailing lists with a more forum-alike look here:
@url{http://dir.gmane.org/gmane.comp.video.ffmpeg.user},
but, if you post, please remember that our mailing list rules still apply there.

@section I cannot read this file although this format seems to be supported by ffmpeg.

Even if ffmpeg can read the container format, it may not support all its
Expand Down Expand Up @@ -175,15 +135,15 @@ The @file{movie.mpg} used as input will be converted to

Instead of relying on file format self-recognition, you may also use
@table @option
@item -vcodec ppm
@item -vcodec png
@item -vcodec mjpeg
@item -c:v ppm
@item -c:v png
@item -c:v mjpeg
@end table
to force the encoding.

Applying that to the previous example:
@example
ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
@end example

Beware that there is no "jpeg" codec. Use "mjpeg" instead.
Expand All @@ -205,56 +165,18 @@ Try '-f image2 test%d.jpg'.
@section Why can I not change the frame rate?

Some codecs, like MPEG-1/2, only allow a small number of fixed frame rates.
Choose a different codec with the -vcodec command line option.
Choose a different codec with the -c:v command line option.

@section How do I encode Xvid or DivX video with ffmpeg?

Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
standard (note that there are many other coding formats that use this
same standard). Thus, use '-vcodec mpeg4' to encode in these formats. The
same standard). Thus, use '-c:v mpeg4' to encode in these formats. The
default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
force the fourcc 'xvid' to be stored as the video fourcc rather than the
default.

@section How do I encode videos which play on the iPod?

@table @option
@item needed stuff
-acodec libfaac -vcodec mpeg4 width<=320 height<=240
@item working stuff
mv4, title
@item non-working stuff
B-frames
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4
@end table

@section How do I encode videos which play on the PSP?

@table @option
@item needed stuff
-acodec libfaac -vcodec mpeg4 width*height<=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp
@item working stuff
mv4, title
@item non-working stuff
B-frames
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -ar 24000 -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4
@item needed stuff for H.264
-acodec libfaac -vcodec libx264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
@item working stuff for H.264
title, loop filter
@item non-working stuff for H.264
CAVLC
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -vcodec libx264 -b 1200k -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
@item higher resolution for newer PSP firmwares, width<=480, height<=272
-vcodec libx264 -level 21 -coder 1 -f psp
@item example command line
ffmpeg -i input -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640k -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 output.mp4
@end table

@section Which are good parameters for encoding high quality MPEG-4?

'-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2',
Expand Down Expand Up @@ -300,13 +222,13 @@ equally humble @code{copy} under Windows), and finally transcoding back to your
format of choice.

@example
ffmpeg -i input1.avi -sameq intermediate1.mpg
ffmpeg -i input2.avi -sameq intermediate2.mpg
ffmpeg -i input1.avi -same_quant intermediate1.mpg
ffmpeg -i input2.avi -same_quant intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -sameq output.avi
ffmpeg -i intermediate_all.mpg -same_quant output.avi
@end example

Notice that you should either use @code{-sameq} or set a reasonably high
Notice that you should either use @code{-same_quant} or set a reasonably high
bitrate for your intermediate and output files, if you want to preserve
video quality.

Expand All @@ -316,10 +238,10 @@ of named pipes, should your platform support it:
@example
mkfifo intermediate1.mpg
mkfifo intermediate2.mpg
ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
ffmpeg -i input1.avi -same_quant -y intermediate1.mpg < /dev/null &
ffmpeg -i input2.avi -same_quant -y intermediate2.mpg < /dev/null &
cat intermediate1.mpg intermediate2.mpg |\
ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
ffmpeg -f mpeg -i - -same_quant -c:v mpeg4 -acodec libmp3lame output.avi
@end example

Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
Expand All @@ -346,28 +268,10 @@ cat temp1.a temp2.a > all.a &
cat temp1.v temp2.v > all.v &
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v \
-sameq -y output.flv
-same_quant -y output.flv
rm temp[12].[av] all.[av]
@end example

@section The ffmpeg program does not respect the -maxrate setting, some frames are bigger than maxrate/fps.

Read the MPEG spec about video buffer verifier.

@section I want CBR, but no matter what I do frame sizes differ.

You do not understand what CBR is, please read the MPEG spec.
Read about video buffer verifier and constant bitrate.
The one sentence summary is that there is a buffer and the input rate is
constant, the output can vary as needed.

@section How do I check if a stream is CBR?

To quote the MPEG-2 spec:
"There is no way to tell that a bitstream is constant bitrate without
examining all of the vbv_delay values and making complicated computations."


@chapter Development

@section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?
Expand Down Expand Up @@ -414,7 +318,7 @@ the FFmpeg Windows Help Forum at

No. These tools are too bloated and they complicate the build.

@section Why not rewrite ffmpeg in object-oriented C++?
@section Why not rewrite FFmpeg in object-oriented C++?

FFmpeg is already organized in a highly modular manner and does not need to
be rewritten in a formal object language. Further, many of the developers
Expand All @@ -433,15 +337,7 @@ Yes, as long as the code is optional and can easily and cleanly be placed
under #if CONFIG_GPL without breaking anything. So, for example, a new codec
or filter would be OK under GPL while a bug fix to LGPL code would not.

@section I want to compile xyz.c alone but my compiler produced many errors.

Common code is in its own files in libav* and is used by the individual
codecs. They will not work without the common parts, you have to compile
the whole libav*. If you wish, disable some parts with configure switches.
You can also try to hack it and remove more, but if you had problems fixing
the compilation failure then you are probably not qualified for this.

@section I'm using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.
@section I'm using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.

FFmpeg is a pure C project, so to use the libraries within your C++ application
you need to explicitly state that you are using a C library. You can do this by
Expand All @@ -459,14 +355,6 @@ to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
You have to implement a URLProtocol, see @file{libavformat/file.c} in
FFmpeg and @file{libmpdemux/demux_lavf.c} in MPlayer sources.

@section I get "No compatible shell script interpreter found." in MSys.

The standard MSys bash (2.04) is broken. You need to install 2.05 or later.

@section I get "./configure: line <xxx>: pr: command not found" in MSys.

The standard MSys install doesn't come with pr. You need to get it from the coreutils package.

@section Where can I find libav* headers for Pascal/Delphi?

see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
Expand Down
1 change: 1 addition & 0 deletions doc/ffserver.texi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ffserver [options]
@c man begin DESCRIPTION

ffserver is a streaming server for both audio and video. It supports

several live feeds, streaming from files and time shifting on live feeds
(you can seek to positions in the past on each live feed, provided you
specify a big enough feed storage in ffserver.conf).
Expand Down
1 change: 1 addition & 0 deletions doc/general.texi
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ following image formats are supported:
@item Duck TrueMotion 2.0 @tab @tab X
@tab fourcc: TM20
@item DV (Digital Video) @tab X @tab X
@item Dxtory capture format @tab @tab X
@item Feeble Files/ScummVM DXA @tab @tab X
@tab Codec originally used in Feeble Files game.
@item Electronic Arts CMV video @tab @tab X
Expand Down
1 change: 1 addition & 0 deletions libavcodec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o ac3enc.o ac3enc_float.o \
ac3tab.o ac3.o kbdwin.o eac3_data.o
Expand Down
1 change: 1 addition & 0 deletions libavcodec/allcodecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void avcodec_register_all(void)
REGISTER_DECODER (DSICINVIDEO, dsicinvideo);
REGISTER_ENCDEC (DVVIDEO, dvvideo);
REGISTER_DECODER (DXA, dxa);
REGISTER_DECODER (DXTORY, dxtory);
REGISTER_DECODER (EACMV, eacmv);
REGISTER_DECODER (EAMAD, eamad);
REGISTER_DECODER (EATGQ, eatgq);
Expand Down
1 change: 1 addition & 0 deletions libavcodec/avcodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ enum CodecID {
CODEC_ID_UTVIDEO_DEPRECATED,
CODEC_ID_BMV_VIDEO,
CODEC_ID_VBLE,
CODEC_ID_DXTORY,
CODEC_ID_UTVIDEO = 0x800,
CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),

Expand Down
2 changes: 0 additions & 2 deletions libavcodec/cljr.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

typedef struct CLJRContext {
AVClass *avclass;
AVCodecContext *avctx;
AVFrame picture;
int dither_type;
} CLJRContext;
Expand All @@ -42,7 +41,6 @@ static av_cold int common_init(AVCodecContext *avctx)

avcodec_get_frame_defaults(&a->picture);
avctx->coded_frame = &a->picture;
a->avctx = avctx;

return 0;
}
Expand Down
Loading

0 comments on commit 964912a

Please sign in to comment.