Commit Graph

48 Commits

Author SHA1 Message Date
Anton Khirnov f6772e9bf8 avconv: make sure the filtergraph is freed on init failure
The filtergraph's existence is used in several places to mean that the
filtergraph is fully configured. This causes problems if it's allocated,
but the initialization fails (e.g. if a non-existent filter is
specified).
2016-10-02 11:41:45 +02:00
Luca Barbato 602abe77b0 avconv: Check the fifo allocation 2016-08-12 11:41:58 +02:00
Anton Khirnov b0f36a0043 avconv: stop using setpts for input framerate forced with -r
The setpts filter does not signal to the rest of the filtergraph that
the stream is CFR. Just generate the timestamps manually instead.
2016-07-22 19:08:12 +02:00
Anton Khirnov 94ebf55658 avconv: restructure sending EOF to filters
Be more careful when an input stream encounters EOF when its filtergraph
has not been configured yet. The current code would immediately mark the
corresponding output streams as finished, while there may still be
buffered frames waiting for frames to appear on other filtergraph
inputs.

This should fix the random FATE failures for complex filtergraph tests
after a3a0230a98
2016-06-28 08:30:20 +02:00
Anton Khirnov d2e56cf753 avconv: move flushing the queued frames to configure_filtergraph()
This is a more appropriate place for it, and will also be useful in the
following commit.
2016-06-28 08:30:20 +02:00
Mark Thompson bd31c61cf9 avconv: Remove hw_device_ctx output filter reinit hack
Not needed any more because we no longer have any useful case which
will reinitialise with hardware frames here.
2016-06-26 19:40:56 +01:00
Anton Khirnov a3a0230a98 avconv: init filtergraphs only after we have a frame on each input
This makes sure the actual stream parameters are used, which is
important mainly for hardware decoding+filtering cases, which would
previously require various weird workarounds to handle the fact that a
fake software graph has to be constructed, but never used.
This should also improve behaviour in rare cases where
avformat_find_stream_info() does not provide accurate information.
2016-06-25 12:04:32 +02:00
Anton Khirnov 50722b4f0c avconv: decouple configuring filtergraphs and setting output parameters
Currently, a filtergraph will pull in the output constraints from its
corresponding decoder context, which breaks proper layering. Instead,
explicitly send the constaints on the output parameters to the
filtergraph.

This is similar to what is done for filtergraph inputs in
30ab4c51a180610d9f1720c75518d763515c0d9f
2016-06-25 12:04:32 +02:00
Anton Khirnov 722ec3eb35 avconv: decouple configuring filtergraphs and setting input parameters
Currently, calling configure_filtergraph() will pull in the input
parameters from the corresponding decoder context. This has the
following disadvantages:
- the decoded frame is a more proper source for this information
- a filter accessing decoder data breaks proper layering

Add functions for explicitly sending the input stream parameters to a
filtergraph input - currently from a frame and a decoder. The decoder
one will be dropped in future commits after some more restructuring.
2016-06-25 11:20:50 +02:00
Anton Khirnov 73c6ec6d65 avconv: create simple filtergraphs earlier
We already have all the necessary information in open_output_file().
This makes the information about the stream/filtergraph mappings
available earlier.
2016-06-21 12:39:02 +02:00
Anton Khirnov 49670e4218 avconv: add a function for determining whether a filtergraph is simple
This makes the code easier to read.
2016-06-21 12:39:02 +02:00
Mark Thompson 5d273d3efa avconv: VAAPI hwcontext initialisation and hwaccel helper
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-30 09:04:53 +02:00
Anton Khirnov 15e84ed3f1 avconv: convert to codecpar
The switch is not yet complete because the parsers and the bistream
filters do not have a new AVCodecParam-based API yet.
2016-02-23 17:01:58 +01:00
Anton Khirnov 1bf3413461 avconv: use the new buffersrc parameters API
The timebase change in the zmbv-8bit test is due to the fact that
previously the timebase string was evaluated as floating point, then
converted to a rational. After this commit, the timebase is passed
directly as is.
2016-02-14 22:22:41 +01:00
Luca Barbato 8b830ee9a2 avconv: Do not try to configure filter outputs without streams
Prevent a NULL-dereference.

CC: libav-stable@libav.org
2015-10-07 18:45:50 +02:00
Vittorio Giovara 18adc1fd3b avconv_filter: Use full named options
This introduces a slight timebase computation difference in zmbv-8bit
fate test. This is expected since the new options are double instead
of ints, and the additional precision skews the results in a non
meaningful way.
2015-09-13 17:34:45 +02:00
Anton Khirnov 6d592fbd0d avconv: split creating and (re-)configuring complex filtergraphs
The current code is less than straightforward due to the fact that
output streams can be created based on filtergraph definitions. This
change should make the code simpler and more readable. It will also be
useful in the future commits.
2015-07-19 09:38:53 +02:00
Martin Storsjö 16302246b1 avconv: Add an option for automatically rotating video according to display matrix
The option is enabled by default, but can be disabled.

If this is enabled, such side data isn't copied into the output stream
(except when doing stream copy).

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-02 22:09:06 +03:00
Vittorio Giovara c802a2e718 avconv: fix leak in filter error
CC: libav-stable@libav.org
Bug-Id: CID 1005311
2014-10-17 09:55:46 +01:00
Anton Khirnov 383136264e avconv: do not use the stream codec context for encoding 2014-06-01 08:33:21 +02:00
Anton Khirnov 41776ba9c0 avconv: do not use the stream codec context for decoding 2014-06-01 08:33:11 +02:00
Diego Biurrun 8f8bc92365 Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
Anton Khirnov 07fd0a2219 avconv: add infrastructure for using hwaccels 2013-11-23 11:55:43 +01:00
Vittorio Giovara d28fc7b29a avconv_filter: add new line after error message 2013-11-21 14:48:27 +01:00
Anton Khirnov 488a0fa689 avconv: support -t as an input option.
It limits the duration of the data read from a given input.
2013-08-05 10:54:19 +02:00
Anton Khirnov 811bd07846 avconv: make input -ss accurate when transcoding
Insert (a)trim filters on the corresponding inputs, so the extra frames
are decoded and discarded.
2013-08-05 10:53:41 +02:00
Anton Khirnov 56ee3f9de7 avconv: distinguish between -ss 0 and -ss not being used
Using -ss 0 to drop frames with negative timestamps is a perfectly valid
use case.
2013-08-05 10:53:12 +02:00
Anton Khirnov 2e661f26f8 avconv: insert extra filters in the same way for both graph inputs and outputs
This will allow using the same code when one filter can be inserted both
on input and output.
2013-08-05 10:52:22 +02:00
Anton Khirnov 06cd4c5a68 avconv: fix usage of deprecated lavfi API 2013-08-05 10:51:41 +02:00
Anton Khirnov 51fc88e746 avconv: improve some variable names
'filter' is too generic, since the functions in question deal with
several filters.

Also add const qualifiers to those variables.
2013-08-04 15:46:19 +02:00
Luca Barbato 72fbc9685c avconv: use current syntax for the scale filter 2013-05-10 08:26:04 +02:00
Anton Khirnov 8cd472d3f9 avconv: make output -ss insert trim/atrim filters.
This makes output -ss sample-accurate for audio and will allow further
simplication in the future.
2013-04-30 12:00:55 +02:00
Anton Khirnov a83c0da539 avconv: make -t insert trim/atrim filters.
This makes -t sample-accurate for audio and will allow further
simplication in the future.

Most of the FATE changes are due to audio now being sample accurate. In
some cases a video frame was incorrectly passed with the old code, while
its was over the limit.
2013-04-30 11:53:12 +02:00
Anton Khirnov bee2d75b66 avconv: update to the new options syntax.
The separators were changed from ',' to '|' in all the filters.
2013-04-11 20:44:45 +02:00
Anton Khirnov 38f0c0781a lavfi: merge avfiltergraph.h into avfilter.h
We do not support using filters without AVFilterGraph in practice
anyway, so there is no point in pretending we do.
2013-04-11 20:33:33 +02:00
Martin Storsjö e760e1d408 avconv: Make sure the encoder exists before inspecting supported_list
This fixes crashes when there is no encoder for the default codec of
selected format.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-06 21:56:10 +02:00
Justin Ruggles d925cca95f avconv: remove an unused variable 2013-02-25 15:15:22 -05:00
Justin Ruggles 5c7db097eb avconv: pass libavresample options to AVFilterGraph 2013-02-23 17:07:54 -05:00
Anton Khirnov 10bca66101 cmdutils: add a macro to simplify grow_array() calls. 2012-12-18 20:11:06 +01:00
Justin Ruggles 9a71d362a6 avconv: deprecate the -vol option
Remove the code for volume scaling in avconv.c and instead auto-insert a
volume filter into the beginning of the filter chain.
2012-12-05 11:23:37 -05:00
Justin Ruggles 95682d8cd2 avconv: fix variable shadowing in configure_input_audio_filter() 2012-11-28 18:13:21 -05:00
Justin Ruggles a903f8f087 Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
Also reorder some other #include when applicable.
2012-11-11 13:35:12 -05:00
Diego Biurrun c1ef30a6ba De-doxygenize some top-level files 2012-10-12 20:56:54 +02:00
Anton Khirnov 716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Diego Elio Pettenò 5e3f9979fa Use atexit() instead of defining a custom exit_program() interface. 2012-10-01 17:17:42 -04:00
Anton Khirnov 58dee6e62d avconv: don't pass a bogus parameter to avfilter_graph_create_filter().
The buffer sink does not take any parameters.

Fixes an uninitialized variable warning.
2012-09-17 15:48:20 +02:00
Anton Khirnov a3ad68d36c cmdutils: extend -h to allow printing codec details. 2012-08-19 19:22:08 +02:00
Anton Khirnov fe2147e936 avconv: split configuring filter configuration to a separate file. 2012-08-08 11:11:52 +02:00