Commit Graph

270 Commits

Author SHA1 Message Date
Diego Elio Pettenò 5e3f9979fa Use atexit() instead of defining a custom exit_program() interface. 2012-10-01 17:17:42 -04:00
Anton Khirnov 990450c5bf cmdutils: avoid setting data pointers to invalid values in alloc_buffer()
Fixes bug 352.
2012-09-15 14:59:29 +02:00
Anton Khirnov 11d957fbd8 avtools: remove the distinction between func_arg and func2_arg.
func2_arg is the same as func_arg, except it has one additional
parameter. Change all func_arg callbacks to take that parameter (and
ignore it).
2012-08-30 13:56:25 +02:00
Anton Khirnov e2785fa728 cmdutils: make -codecs print lossy/lossless flags. 2012-08-30 13:56:00 +02:00
Anton Khirnov a1bcc76e60 cmdutils: fix a memleak when specifying an option twice. 2012-08-24 11:25:06 +02:00
Anton Khirnov f9fada2704 avconv: split printing "main options" into global and per-file. 2012-08-19 19:23:43 +02:00
Anton Khirnov 1136bd362a avtools: add -h demuxer/muxer 2012-08-19 19:22:41 +02:00
Anton Khirnov a3ad68d36c cmdutils: extend -h to allow printing codec details. 2012-08-19 19:22:08 +02:00
Anton Khirnov 7c5012127f cmdutils: change semantics of show_help_options() and document it.
Currently it takes a mask and value, such that options for which
(flags & mask) == value.

Change it to take required flags and forbidden flags instead. This is
shorter and simpler to understand.
2012-08-19 19:21:35 +02:00
Anton Khirnov dc4c24a3d3 avtools: move some newlines to show_help_options().
Don't require every caller to supply them.
2012-08-19 19:21:03 +02:00
Anton Khirnov f617135bc9 avtools: fix show_foo() signatures.
show_foo() functions are declared as void show_foo(void), but called as
int show_foo(const char*, const char*).
2012-08-19 19:07:43 +02:00
Anton Khirnov 7c10194996 cmdutils: refactor -codecs option.
Make it print a list of AVCodecDescriptors.

Add new -decoders and -encoders options that print lists of decoders and
encoders respectively.
2012-08-18 08:48:30 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Mans Rullgard 45870f8b6e Print full compiler identification, not only version number
This provides a more precise identification of the compiler used.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-19 10:21:46 +01:00
Ronald S. Bultje 66a297975d cmutils: include shellapi.h on Win32 (for CommandLineToArgvW).
This is required for CommandLineToArgvW. Normally, shellapi.h is included
implicitly by windows.h, but if we define WIN32_LEAN_AND_MEAN (or some of
the other earlier headers have included windows.h with that option),
windows.h doesn't include this one.

Thus explicitly include the headers we really need, for clarity and
compatibility.
2012-07-07 14:09:04 -07:00
Martin Storsjö d3ed1c9571 cmdutils: Pass the actual chosen encoder to filter_codec_opts
This allows passing the right options to encoders when there's more
than one encoder for a certain codec id.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-30 15:44:10 +03:00
Anton Khirnov d55c2e05b5 avtools: move buffer management code from avconv to cmdutils.
It will be used by avplay.
2012-06-05 09:35:58 +02:00
Diego Biurrun 7cf78b3476 cmdutils: Add fallback case to switch in check_stream_specifier().
This fixes the warning:
cmdutils.c:897: warning: ‘type’ may be used uninitialized in this function
2012-05-10 00:01:45 +02:00
Anton Khirnov ac71230902 lavfi: add video buffer sink, and use it in avtools
Also add the public interface libavfilter/buffersink.h.

Based on a commit by Stefano Sabatini.
2012-05-09 08:59:37 +02:00
Justin Ruggles bcb82fe1f4 avconv: use libavresample 2012-04-24 23:38:54 -04:00
Anton Khirnov b7327887ea avconv: get output pixel format from lavfi.
This way we don't require a clearly defined corresponding input stream.

The result for the xwd test changes because rgb24 is now chosen instead
of bgra.
2012-04-15 20:22:36 +02:00
Reinhard Tartler 050dc12778 Read preset files with suffix .avpreset
The preset files have been renamed some time ago.

CC: libav-stable@libav.org
2012-03-18 09:26:32 +01:00
Anton Khirnov 4138cd2907 avconv: add -cpuflags option for setting supported cpuflags.
Useful for testing.
2012-03-06 15:03:22 +01:00
Anton Khirnov 3faa141d15 cmdutils: use new avcodec_is_decoder/encoder() functions.
Fixes listing encoders.
2012-03-04 21:09:35 +01:00
Diego Biurrun b315042c8c Remove libpostproc.
This library does not fit into Libav as a whole and its code is just a
maintenance burden.  Furthermore it is now available as an external project,
which completely obviates any reason to keep it around.

URL: http://git.videolan.org/?p=libpostproc.git
2012-02-23 19:36:16 +01:00
Ronald S. Bultje 21d0d1d64f cmdutils: update copyright year to 2012. 2012-02-08 10:31:14 -08:00
Alexandra Khirnova 570f6aaab1 cmdutils: fix options starting with 'no'.
E.g. non_linear_quant mpeg2video private option.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-27 10:27:00 +01:00
Diego Biurrun abe655a472 Drop unnecessary prefix from *sink* variable and struct names. 2012-01-25 12:28:36 +01:00
Diego Biurrun 45f2908d02 cosmetics: Rename ffsink to avsink. 2012-01-19 00:19:43 +01:00
Reinhard Tartler 014f8d8106 No longer build libpostproc by default
update documentation to inform developers that it may be removed in a
later release.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-11 09:27:56 +01:00
Aneesh Dogra cbaef7d16e cmdutils: K&R reformatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-03 21:10:09 +01:00
Diego Biurrun d4b63054d9 cosmetics: Drop unnecessary parentheses around return values. 2011-12-30 22:18:07 +01:00
Stefano Sabatini b58dbb5b03 lavc: add a sample_aspect_ratio field to AVFrame
The sample aspect ratio is a per-frame property, so it makes sense to
define it in AVFrame rather than in the codec/stream context.
Simplify application-level sample aspect ratio information extraction,
and allow further simplifications.
2011-12-25 16:18:57 +01:00
Mans Rullgard 85770d6e56 Add libavutil/mathematics.h #includes for INFINITY
This fixes build errors in some environments.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-22 16:36:44 +00:00
Martin Storsjö 02170990fd cmdutils: Rename read_file to cmdutils_read_file
This symbol name clashes with a symbol in gnutls, if linking
statically to that library.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-31 16:29:29 +02:00
Janne Grunau d94c577d3c cmdutils: check fread() return value 2011-10-30 15:52:18 +01:00
Anton Khirnov 7a6cd9957d cmdutils/avtools: simplify show_help() by using av_opt_child_class_next() 2011-10-12 16:51:17 +02:00
Anton Khirnov 145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Anton Khirnov 3b3ea34655 Remove all uses of deprecated AVOptions API. 2011-10-12 16:51:16 +02:00
Mans Rullgard 8124d8ad66 avtools: add -v as alias for -loglevel
This saves a bit of typing.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-09 16:53:06 +01:00
Anton Khirnov 3ccd15803b avconv: add support for copying attachments. 2011-09-27 15:26:36 +02:00
Anton Khirnov 1c5e9551bc cmdutils: replace fprintf() by av_log()
This way, all messages can be easily disabled with -loglevel.

Behavior change -- configuration is printed with AV_LOG_VERBOSE, so it's
not shown by default.
2011-09-26 20:33:50 +02:00
Anton Khirnov 182cbe433a avtools: parse loglevel before all the other options.
This way it can be applied to cmdutils too -- e.g. showing the banner
and printing startup messages.
2011-09-26 20:33:50 +02:00
Janne Grunau e1b1015581 cmdutils: move grow_array out of #if CONFIG_AVFILTER
fixes programs linking with --disable-avfilter
2011-09-23 11:40:25 +02:00
Anton Khirnov 2c474ddbc5 cmdutils: add support for programs in check_stream_specifier()
Remove now redundant (and broken/undocumented) opt_programid.
2011-09-11 17:30:01 +02:00
Anton Khirnov 05bffc12c4 avconv: move audio_sample_fmt to options context.
Also document it and replace undocumented and inconsistent
'-sample_fmt list' syntax with -sample_fmts.
2011-09-11 17:29:55 +02:00
Anton Khirnov 33f75d72e6 avconv: move ts scale to options context. 2011-09-05 11:15:40 +02:00
Anton Khirnov 6b779cccaa avconv: move start_time, recording_time and input_ts_offset to options context 2011-09-04 13:12:00 +02:00
Anton Khirnov 6361c5e1e6 cmdutils: allow storing per-stream/chapter/.... options in a generic way 2011-09-04 13:12:00 +02:00
Anton Khirnov 2f8e586df1 cmdutils: split per-option code out of parse_options().
This allows options like -target, which are just shortcuts for other
options, to work without dummy function for all options they invoke.
2011-09-04 13:12:00 +02:00
Anton Khirnov 7cc8d6385a cmdutils: add support for caller-provided option context.
This is the first step to removing the globals plague from avtools.
2011-09-04 13:12:00 +02:00
Anton Khirnov 7efe05ab29 cmdutils: declare only one pointer type in OptionDef
This will be useful in the following commit.
2011-09-04 13:12:00 +02:00
Anton Khirnov cac651c834 cmdutils: move grow_array() from avconv to cmdutils. 2011-09-04 13:12:00 +02:00
Anton Khirnov dad09ff93f cmdutils: move exit_program() declaration to cmdutils from avconv
Allows cmdutils to call each tool's own cleanup function.
2011-09-04 13:12:00 +02:00
Anton Khirnov 20c21f8b75 cmdutils: get rid of dummy contexts for examining AVOptions.
Replace it with newly introduced libavutil API.
2011-09-03 20:58:15 +02:00
Anton Khirnov d4863fc1a8 cmdutils: allow precisely specifying a stream for AVOptions. 2011-08-12 18:35:12 +02:00
Anton Khirnov d70e512250 cmdutils: allow ':'-separated modifiers in option names. 2011-08-12 13:51:30 +02:00
Anton Khirnov 6291d7e416 Make a copy of ffmpeg under a new name -- avconv.
It will be further developed with a few incompatible changes.

ffmpeg.c will stay as is for some time, so any scripts using it won't be
broken.
2011-08-12 13:27:30 +02:00
Stefano Sabatini 8ec19f84e1 cmdutils: add codec_opts parameter to setup_find_stream_info_opts()
Avoid brittle and obfuscating reference to a global.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-28 17:13:14 +02:00
Anton Khirnov 35d2e4e5c3 cmdutils: replace opt_default with opt_default2() and remove set_context_opts 2011-07-13 23:17:42 +02:00
Anton Khirnov 3009f521f3 ffplay: use new avcodec_open2 and avformat_find_stream_info API. 2011-07-13 23:17:42 +02:00
Anton Khirnov 8c8eab8bfe cmdutils: store all codec options in one dict instead of video/audio/sub
Split them when codec id is known.
2011-07-13 23:17:42 +02:00
Anton Khirnov 71a861cf40 lavc: make avcodec_alloc_context3 officially public.
Deprecate avcodec_alloc_context/2.
2011-07-10 17:09:28 +02:00
Anton Khirnov 9ba38229e5 cmdutils: add opt_default2().
It stores options in a dictionary to be passed to new open calls.

It will replace opt_default once all the pieces are in place.
2011-06-16 20:24:57 +02:00
Anton Khirnov dc59ec5e79 AVOptions: add av_opt_find() as a replacement for av_find_opt. 2011-06-16 20:24:56 +02:00
Stefano Sabatini de85935883 cmdutils: add missing NULL check in parse_options()
Fix ffplay -i FILE, which was recently broken.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-12 14:19:45 +02:00
Mans Rullgard 42abb9a80d cmdutils: add missing const qualifier
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-04 18:09:01 +01:00
Stefano Sabatini 26513856d6 cmdutils: remove OPT_FUNC2
Make ff* tools only accept opt_* functions taking two arguments.

The distinction between functions with one and two arguments is quite
pointless. Simplify parse_options() code.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-28 09:40:19 -04:00
Ronald S. Bultje faf8d3ddfa cmdutils: use sws_freeContext() instead of av_freep().
av_freep(swsContext) will leak all memory potentially
allocated within the swsContext.
2011-05-27 13:22:28 -04:00
Benjamin Larsson 91199cfe55 ffplay: add a dummy option -i so that it is easy to switch between ffmpeg -i "file" and ffplay -i "file".
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-11 07:32:36 +02:00
Stefano Sabatini 3372ec327b cmdutils: add OPT_INT check in parse_number_or_die()
Check that the value passed for an OPT_INT option is an int, fail
otherwise.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-10 07:15:24 +02:00
Stefano Sabatini 5d2c6f42d7 cmdutils: remove list_fmts(), simplify
The function was only used in opt_sample_fmt() for listing the sample
formats. Move list_fmts() functionality directly into
opt_sample_fmt().

Also fix the warning:
ffmpeg.c: In function ‘opt_audio_sample_fmt’:
ffmpeg.c:2877: warning: passing argument 1 of ‘list_fmts’ from incompatible pointer type
cmdutils.h:163: note: expected ‘void (*)(char *, int,  int)’ but argument is of type ‘char * (*)(char *, int,  enum AVSampleFormat)’

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-10 07:14:13 +02:00
Anton Khirnov 19615089a0 ffmpeg.c: reset avoptions after each input/output file.
This is consistent with how all the other options work.
2011-05-09 19:35:20 +02:00
Roger Pau Monné 10d39405fa lavfi: add key_frame and pict_type to AVFilterBufferRefVideo.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-26 07:42:13 +02:00
Luca Barbato ba9327ea65 win32: include the correct header in cmdutils.c
CommandLineToArgvW requires windows.h, include it directly
2011-04-25 21:57:30 +02:00
Kirill Gavrilov b1ac139d89 Handle unicode file names on windows
All file names should be in UTF-8 within libavformat.

This is handled by mapping the open() function to an internal one
in os_support.h for windows.

fopen() could be overridden in the same way, but if that would be
used from ffmpeg.c, it would add a dependency on an ff prefixed
internal lavf function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-24 00:05:38 +03:00
Anton Khirnov 41d0eb1c81 lavc: remove the FF_API_SET_STRING_OLD cruft. 2011-04-19 18:41:00 +02:00
Anton Khirnov cdc6a87f19 avio: deprecate av_protocol_next(). 2011-04-08 17:48:53 +02:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Janne Grunau a03be6e1ba use LIBAV_LICENSE and LIBAV_VERSION instead of FFMPEG_* 2011-03-16 21:54:39 +01:00
Janne Grunau 29ba091136 replace FFMPEG with LIBAV in FFMPEG_CONFIGURATION
also update the multiple inclusion guards in config.h|mak
2011-03-16 21:54:39 +01:00
Stefano Sabatini f6c7375a17 Deprecate parse_date() in favor of av_parse_time().
The new av_parse_time() is created in libavutil/parseutils.h, all the
internal functions used by parse_date are moved to
libavutil/parseutils.c and made static.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-16 23:39:56 +00:00
Reinhard Tartler 737eb5976f Merge libavcore into libavutil
It is pretty hopeless that other considerable projects will adopt
libavutil alone in other projects. Projects that need small footprint
are better off with more specialized libraries such as gnulib or rather
just copy the necessary parts that they need. With this in mind, nobody
is helped by having libavutil and libavcore split. In order to ease
maintenance inside and around FFmpeg and to reduce confusion where to
put common code, avcore's functionality is merged (back) to avutil.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-02-15 16:18:21 +01:00
James Zern 60ff9de6ff cmdutils: fix codec-specific options from preset
Using a preset file caused the address of a stack variable to be stored
in opt_names/values. This change causes the strings to be dup'd then
freed in uninit_opts.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-05 18:34:17 -05:00
James Zern 3a6a9cdf5b cmdutils: fix opt_values leak
Add free to uninit_opts and relocate opt_names to same

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-05 17:18:45 -05:00
Diego Elio Pettenò 3568853f63 Make this_year static to cmdutils.c
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-24 23:44:58 +00:00
Georgi Chorbadzhiyski c0dd565304 libavcodec minor version is > 99 so fix the formating
libavcodec minor version is > 99 so when printing the library versions
the output is a little bit broken:

  libavutil    50. 36. 0 / 50.36. 0
  libavcore     0. 16. 1 /  0.16. 1
  libavcodec   52.108. 0 / 52.108. 0
  libavformat  52. 94. 0 / 52.94. 0
  libavdevice  52.  2. 3 / 52. 2. 3
  libavfilter   1. 74. 0 /  1.74. 0
  libswscale    0. 12. 0 /  0.12. 0

Change the formating to look like this:

  libavutil    50. 36. 0 / 50. 36. 0
  libavcore     0. 16. 1 /  0. 16. 1
  libavcodec   52.108. 0 / 52.108. 0
  libavformat  52. 94. 0 / 52. 94. 0
  libavdevice  52.  2. 3 / 52.  2. 3
  libavfilter   1. 74. 0 /  1. 74. 0
  libswscale    0. 12. 0 /  0. 12. 0

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-20 11:34:19 +00:00
Mans Rullgard 324e7ee260 Use INFINITY and NAN macros instead of 1/0 and 0/0 2011-01-18 20:48:23 +00:00
Stefano Sabatini be4876eae9 Disable initialization of the swscale sws_opts context in
cmdutils.c:init_opts(), in the case libswscale compilation is not
enabled.

Fix ffprobe and ffserver compilation with --disable-swscale.

Originally committed as revision 26212 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-04 14:00:06 +00:00
Martin Storsjö f03424a782 Reindent
Originally committed as revision 26205 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-03 12:43:48 +00:00
Anssi Hannula ef2b2243dc Use AVOption for muxers in ffmpeg.
Patch by Anssi Hannula, anssi d hannula d iki d fi

Originally committed as revision 26199 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-02 16:00:47 +00:00
Justin Ruggles 391fa56ddb Update current year to 2011. Happy New Year!
Originally committed as revision 26184 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-01 18:49:18 +00:00
Stefano Sabatini 819e2ab0d8 Add missing check on the existence of avcodec_opts[AVMEDIA_TYPE_X],
fix crash in ffprobe.

Originally committed as revision 25799 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-22 22:03:21 +00:00
Stefano Sabatini 6e872935db Implement get_preset_file() in cmdutils.h and use it to factorize code
from ffmpeg.c and ffserver.c.

Originally committed as revision 25679 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-04 23:07:04 +00:00
Stefano Sabatini ff0652e503 Implement a common get_filtered_video_frame(), shared between ffplay.c
and ffmpeg.c.

Originally committed as revision 25520 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-18 13:57:11 +00:00
Stefano Sabatini f7ead94c69 Factorize definition of the output_filter defined in both ffplay.c and
ffmpeg.c.
Replace it with a more generic definition which can be shared.

Originally committed as revision 25453 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-12 18:40:26 +00:00
Reimar Döffinger a5c33faacc Add init and uninit functions to cmdutils, reduces code duplication
between ffmpeg and ffplay and avoids a valgrind error by freeing
avformat_opts->key.

Originally committed as revision 25309 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-02 08:44:33 +00:00
Michael Niedermayer 0093ebc20a User application side of Codec specific parameters.
Originally committed as revision 25266 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-29 23:06:51 +00:00
Alexander Strange 01d461980e All else being equal, prefer PTS over DTS in timestamp correction
Because DTS values aren't passed through decoders, they tend to be
inaccurate if decoder delay doesn't match what was expected by the encoder.

In particular this improves timestamps for H.264 without num_reorder_frames
set and with -strict 1, which causes DTS to be up to 16 frames ahead of the
picture.

Note that this doesn't really improve any file with very broken PTS/DTS,
since PTS isn't much more accurate in these.

Originally committed as revision 25242 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-28 03:45:27 +00:00
Alexander Strange 7a8bfa5d67 Extract timestamp correction code from ffplay.c to cmdutils.c
Originally committed as revision 25241 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-28 02:05:12 +00:00