1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

447 Commits

Author SHA1 Message Date
Anton Khirnov
90944ee3ab avconv: refactor selecting an encoder
Fail immediately if automatic encoder selection failed. Always set the
stream_copy/encoding_needed flags in one place.
2016-06-21 12:39:02 +02:00
Anton Khirnov
5e1840622c avconv: fix handling attachments in init_output_stream
The current code assumes that encoding_needed is simply an inverse of
stream_copy, which is not true for manually attached files (for which
neither of those is true).
2016-06-21 12:39:02 +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
Vittorio Giovara
20a8c78ce0 avconv: Do not copy extradata if source buffer is empty
Fixes clang-usan runtime error "null pointer passed as argument 2,
which is declared to never be null" while streamcopying.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-06-06 11:56:21 -04:00
Diego Biurrun
e2a3df1a46 avconv: Use more precise deprecation ifdefs
This fixes compilation with the libavcodec version bumped to 58.
2016-05-22 20:22:43 +02:00
Anton Khirnov
35c8580668 avconv: stop using AVStream.codec
It is now only used by the av_parser_change() call during streamcopy, so
allocate a special AVCodecContext instance for this case. This instance
should go away when the new parser API is finished.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-22 20:22:42 +02:00
Diego Biurrun
763d69bfb2 Add some more deprecation guards
Avoids unused function/label/variable warnings after the next version bump.
2016-05-11 12:22:49 +02:00
Vittorio Giovara
41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Luca Barbato
1db8eb1549 avconv: Drop an unused variable 2016-04-01 05:30:22 +02:00
Anton Khirnov
69a638019f avconv: fix -frames for video
For video, frame_number tracks the number of frames sent to the encoder.
So it should be incremented when we submit a frame, not when we get a
packet back.
2016-03-30 09:13:09 +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
wm4
35846d93e0 avconv: use new encode API
The flushing case is a bit strange; not simplifying it so the change is
less noisy.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-23 19:31:35 +01:00
wm4
84aea95e31 avconv: use new decode API
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-23 19:31:35 +01:00
Anton Khirnov
4426540f0c avconv: switch to the new BSF API 2016-03-20 08:15:01 +01:00
wm4
0b6e5d6b32 avconv: remove sub-frame warning
It's not practical to keep this with the new decode API.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-05 09:10:10 +01: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
5b9cdf8cba avconv: switch opening decoders and encoders
Open decoders first, next encoders. This makes sure that that
subtitle_header is always set properly, without relying on
avformat_find_stream_info() setting it.
2016-02-23 17:01:58 +01:00
Anton Khirnov
c15f6098b1 avconv: pass the hw context from filters to the encoder 2016-02-14 22:33:26 +01:00
Luca Barbato
63f7f8d1db avconv: Drop an impossible check
EAGAIN is already managed in poll_filters().

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-04 16:58:32 +01:00
Luca Barbato
7ebf1b4ada avconv: Simplify poll_filters() return value check
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-04 16:58:32 +01:00
Anton Khirnov
e63e3797a1 avconv: pass the global codec side data to the muxer 2015-12-06 10:23:21 +01:00
Anton Khirnov
3efd71b4d0 avconv: set packet duration for CFR video streams 2015-11-08 11:49:05 +01:00
Alexandra Hájková
cd0e08813a avconv: support infinite loop for the loop option
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-26 19:28:24 +01:00
Luca Barbato
ce70f28a17 avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.

Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Luca Barbato
a5d4204309 avformat: Always return ref-counted AVPacket
And drop the av_dup_packet from the input_thread.
2015-10-26 18:00:55 +01:00
Anton Khirnov
fb472e1a11 avconv: add support for Intel QSV-accelerated transcoding
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-16 20:01:37 +02:00
Luca Barbato
34ed5c2e4d avformat: Do not use AVFMT_RAWPICTURE
There are no formats supporting it anymore and it is deprecated.
Update the documentation accordingly.
2015-10-13 13:43:29 +02:00
Alexandra Hájková
16b0c92962 avconv: Add loop option.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-10-13 09:41:02 +02:00
Vittorio Giovara
6064f697a3 lavc: Enable side data only packets by default
Deprecate the now unused option, but temporarily retain the capability
to disable the now default behaviour.

Mention this change in the AVPacket documentation.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-12 13:38:31 +02:00
Vittorio Giovara
059a934806 lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:59 +01:00
Vittorio Giovara
def97856de lavc: AV-prefix all codec capabilities
Express bitfields more simply.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Vittorio Giovara
7c6eb0a1b7 lavc: AV-prefix all codec flags
Convert doxygen to multiline and express bitfields more simply.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Vittorio Giovara
40cf1bbacc Deprecate avctx.coded_frame
The rationale is that coded_frame was only used to communicate key_frame,
pict_type and quality to the caller, as well as a few other random fields,
in a non predictable, let alone consistent way.

There was agreement that there was no use case for coded_frame, as it is
a full-sized AVFrame container used for just 2-3 int-sized properties,
which shouldn't even belong into the AVCodecContext in the first place.

The appropriate AVPacket flag can be used instead of key_frame, while
quality is exported with the new AVPacketSideData quality factor.
There is no replacement for the other fields as they were unreliable,
mishandled or just not used at all.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-20 15:06:50 +01:00
Vittorio Giovara
5d3addb937 Add a quality factor packet side data
This is necessary to preserve the quality information currently exported
with coded_frame. Add the new side data to every encoder that needs it,
and use it in avconv.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-20 15:06:47 +01: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
Anton Khirnov
1959351aec avconv: move the no streams failure to open_output_file()
It is a better place for it, there is no reason to wait until
transcode_init().
2015-07-19 09:38:28 +02:00
Anton Khirnov
ab7b038906 avconv: factor out the output stream initialization 2015-07-19 09:38:25 +02:00
Anton Khirnov
6d5d924604 avconv: move handling the 2pass logfile into avconv_opt
It more logically belongs there.
2015-07-19 09:34:24 +02:00
Anton Khirnov
59245e0c5e avconv: set the encoding/decoding_needed flags earlier
This will be useful in the following commits.
2015-07-19 09:34:08 +02:00
Anton Khirnov
56c2f37727 avconv: drop update_sample_fmt()
There is only one decoder left that supports this (libopus, which is not
used by default since we have a native one) and this code goes against
the avconv design, since it propagates information back from the encoder
to decoder.
2015-07-19 09:33:51 +02:00
Anton Khirnov
9a5e4fbec8 avconv: do not stop processing the input packet on decoding error
We still want to flush the filters on EOF and possibly apply streamcopy.
2015-06-27 16:45:41 +02:00
Anton Khirnov
b114f6d48a avconv: factor out flushing the filters
This also ensures this is always done, avoiding infinite loops if an
error occurs at the end of the input.
2015-06-27 16:45:04 +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
Himangi Saraogi
aa1a1b2496 avconv: Avoid theoretical NULL dereferences
Bug-Id: CID 1292519

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-04-04 19:32:10 +02:00
Anton Khirnov
3892bdab9b avconv: do not overwrite the stream codec context for streamcopy
Since we are not doing encoding, there is no point in ever touching the
separate encoding context. Always use the stream codec context.

Fixes writing attachments.

CC:libav-devel@libav.org
2015-04-03 13:10:03 +02:00
Luca Barbato
22a6d48b0d avconv: Print the avfilter errors
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-20 18:42:26 +01:00
Anton Khirnov
dc7536ca3d avconv: do not abort immediately if initializing hwaccel fails
exit_program() will try to free the decoders, which is not a good idea
from within get_format().
Return an error instead.
2015-03-10 07:40:11 +01:00
Anton Khirnov
88b32673db avconv: copy stream-level side data when streamcopying 2014-10-24 09:03:16 +02:00
Martin Storsjö
d0c0930219 avconv: Use av_gettime_relative
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:45 +03:00