Commit Graph

43241 Commits

Author SHA1 Message Date
Diego Biurrun
52567e8198 get_bits: Drop some TRACE-level debug code
It will not be provided by the new bit reader anyway.
2016-05-22 20:22:43 +02:00
Diego Biurrun
e45a638f50 dump: Drop unused variable 2016-05-22 20:22:43 +02: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
Anton Khirnov
3399a26d3f nvenc: allow setting the number of slices
Based on a patch by Agatha Hu <ahu@nvidia.com>
2016-05-19 14:17:04 +02:00
Philip Langdale
10545f84b8 nvenc: De-compensate aspect ratio compensation of DVD-like content.
For reasons we are not privy to, nvidia decided that the nvenc encoder
should apply aspect ratio compensation to 'DVD like' content, assuming that
the content is not BT.601 compliant, but needs to be BT.601 compliant. In
this context, that means that they make the following, questionable,
assumptions:

1) If the input dimensions are 720x480 or 720x576, assume the content has
an active area of 704x480 or 704x576.

2) Assume that whatever the input sample aspect ratio is, it does not account
for the difference between 'physical' and 'active' dimensions.

From these assumptions, they then conclude that they can 'help', by adjusting
the sample aspect ratio by a factor of 45/44. And indeed, if you wanted to
display only the 704 wide active area with the same aspect ratio as the full
720 wide image - this would be the correct adjustment factor, but what if you
don't? And more importantly, what if you're used to lavc not making this kind
of adjustment at encode time - because none of the other encoders do this!

And, what if you had already accounted for BT.601 and your input had the
correct attributes? Well, it's going to apply the compensation anyway!
So, if you take some content, and feed it through nvenc repeatedly, it
will keep scaling the aspect ratio every time, stretching your video out
more and more and more.

So, clearly, regardless of whether you want to apply bt.601 aspect ratio
adjustments or not, this is not the way to do it. With any other lavc
encoder, you would do it as part of defining your input parameters or do
the adjustment at playback time, and there's no reason by nvenc should
be any different.

This change adds some logic to undo the compensation that nvenc would
otherwise do.

nvidia engineers have told us that they will work to make this
compensation mechanism optional in a future release of the nvenc
SDK. At that point, we can adapt accordingly.

Signed-off-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:17:04 +02:00
Anton Khirnov
9375c97460 nvenc: list the major contributors in the copyright header 2016-05-19 14:17:04 +02:00
Timo Rothenpieler
09522a303d configure: Don't require nonfree for nvenc
As the nvEncodeApi.h header is now MIT licensed, this can be dropped.
The loaded CUDA and NVENC libraries are part of the nvidia driver, and
thus count as system libraries.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:17:03 +02:00
Anton Khirnov
6f58b4dc47 nvenc: drop the hard dependency on CUDA
The code needs only a few definitions from cuda.h, so define them
directly when CUDA is not enabled. CUDA is still required for accepting
HW frames as input.

Based on the code by Timo Rothenpieler <timo@rothenpieler.org>.
2016-05-19 14:17:03 +02:00
Anton Khirnov
f11ec8cee7 nvenc: only support HW frames when CUDA is enabled
hwcontext_cuda.h includes cuda.h, so this will allow building nvenc
without depending on cuda.h
2016-05-19 14:17:03 +02:00
Anton Khirnov
2156c4c300 nvenc: write the VUI signal properties for HEVC
Bump the API version requirement to 6.

Based on a patch by Agatha Hu <ahu@nvidia.com>.
2016-05-19 14:17:03 +02:00
Anton Khirnov
a1df786503 nvenc: only write the VUI signal type fields if they are set
Based on a patch by Agatha Hu <ahu@nvidia.com>.
2016-05-19 14:17:03 +02:00
Timo Rothenpieler
cea1fb854c nvenc: Generate bufferingPeriod/pictureTiming SEI
For some unknown reason enabling these causes proper CBR padding,
so as there are no known downsides just always enable them in CBR mode.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:17:03 +02:00
Timo Rothenpieler
a1e215ea01 nvenc: Delay frame output to increase encoding speed
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:17:01 +02:00
Anton Khirnov
9427d92f40 nvenc: add support for lossless encoding
Based on a patch by Philip Langdale <philipl@overt.org>
2016-05-19 14:08:55 +02:00
Timo Rothenpieler
795329dd4c nvenc: Generate AUD NAL units for better compatiblity
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:08:30 +02:00
Anton Khirnov
e42b9bc894 nvenc: fix the rc option definitions 2016-05-19 14:08:25 +02:00
Anton Khirnov
65dc7ca4c8 Add release notes for 12. 2016-05-19 13:44:41 +02:00
Derek Buitenhuis
d68fb14758 mjpegdec: Properly fail on malloc failure
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 13:44:41 +02:00
Anton Khirnov
85ce9636e4 configure: move the hardware accel libs' entries in the configure output
Print them as a subsection of the external library section, in line with
what is done for the help text in the previous commit.
2016-05-19 13:43:29 +02:00
Anton Khirnov
c0f4c7db9f configure: move the hardware accel libs' entries in the help text
Group them in a subsection of the external library section. That should
make them easier to find and understand how they fit in the scheme of
things.

Also, rewrite the description text in a similar way as in the previous
commit.
2016-05-19 13:41:51 +02:00
Anton Khirnov
5e2203448a configure: improve the help text for external libraries
Add a more accurate description of what the switches actually do (i.e.
allow using the given library, not enabling the corresponding
codecs etc.).

Replace the library descriptions, in many cases boilerplate text without
useful information, with a short summary of what the library does.
2016-05-19 13:40:53 +02:00
Anton Khirnov
0d95d88fbd lavc: revert the Makefile part of 330177b
There is no real advantage to listing some codecs or subsystems
separately simply because they are somehow "hw-accelerated", on the
contrary it makes them harder to find than in a plain alphabetically
ordered list.
2016-05-19 13:40:53 +02:00
Diego Biurrun
ded4a6543d xtea-test: Use struct allocation functions from the API 2016-05-19 09:55:55 +02:00
Diego Biurrun
8131bd4c22 blowfish-test: Use struct allocation functions from the API 2016-05-19 09:55:55 +02:00
Diego Biurrun
a86ef80494 blowfish-test: Return different values for different errors 2016-05-19 09:55:55 +02:00
Martin Storsjö
b84f3a4003 movenc: Write 'loci' geotag metadata for 3gp and mp4
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:55 +03:00
Martin Storsjö
f12a705ee5 movenc: Factorize a function for finding a metadata entry and the associated language
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:54 +03:00
Michael Niedermayer
daec1651f1 movenc: Write ?xyz geotag metadata for mov files
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:53 +03:00
Michael Niedermayer
bc43131997 mov: Also export loci altitude
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:53 +03:00
Michael Niedermayer
94d8141c8c mov: Append place name instead of overwriting for loci
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:52 +03:00
Michael Niedermayer
f126365cda mov: Fix parsing short loci
Previously, we required the minimum number of bytes required for
the full box. Don't strictly require the astronomical body and additional
notes fields, but do require an altitude field (which currently isn't
parsed). This matches the initial length check at the start of the function
(which doesn't know about the variable length place field).

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:51 +03:00
Michael Niedermayer
704d2bd18b mov: Print reason of loci parsing failure
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:45 +03:00
Martin Storsjö
d34826c33d mov: Add a comment referring to the standard that defines the loci box
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-19 10:46:39 +03:00
Martin Storsjö
72d621069f movenc: Add a missed const
This was missed in e1eb0fc960, when ff_interleaved_peek was
changed to include const during the evolution of the patch.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 21:59:48 +03:00
Martin Storsjö
a79aafd0b4 movenc: Add a test for VFR with b-frames, with a duration change at a fragment end
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:37:05 +03:00
Martin Storsjö
e1eb0fc960 movenc: Use packets in interleaving queues for the duration at the end of fragments
As long as caller only writes packets using av_interleaved_write_frame
with no manual flushing, this should allow us to always have accurate
durations at the end of fragments, since there should be at least
one queued packet in each stream (except for the stream where the
current packet is being written, but if the muxer itself does the
cutting of fragments, it also has info about the next packet for that
stream).

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:37:03 +03:00
Martin Storsjö
fd4957d9c6 movenc-test: Test write_data_type
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:37:00 +03:00
Martin Storsjö
71852a1ba8 matroskaenc: Provide output bytestream markers
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:36:58 +03:00
Martin Storsjö
dbbaad32e3 movenc: Provide output bytestream markers for fragmented content
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:36:55 +03:00
Martin Storsjö
371df9ba71 flvenc: Provide output bytestream markers
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:36:53 +03:00
Martin Storsjö
db7968bff4 avio: Allow custom IO users to get labels for the output bytestream
This allows callers with avio write callbacks to get the bytestream
positions that correspond to keyframes, suitable for live streaming.

In the simplest form, a caller could expect that a header is written
to the bytestream during the avformat_write_header, and the data
output to the avio context during e.g. av_write_frame corresponds
exactly to the current packet passed in.

When combined with av_interleaved_write_frame, and with muxers that
do buffering (most muxers that do some sort of fragmenting or
clustering), the mapping from input data to bytestream positions
is nontrivial.

This allows callers to get directly information about what part
of the bytestream is what, without having to resort to assumptions
about the muxer behaviour.

One keyframe/fragment/block can still be split into multiple (if
they are larger than the aviocontext buffer), which would call
the callback with e.g. AVIO_DATA_MARKER_SYNC_POINT, followed by
AVIO_DATA_MARKER_UNKNOWN for the second time it is called with
the following data.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:36:45 +03:00
Vittorio Giovara
8e757716c6 avprobe: Print stereo3d information 2016-05-17 12:25:27 -04:00
Vittorio Giovara
0c4468dc18 stereo3d: Add API to get name from value or value from name
Use it in av_dump_format() instead of a huge switch case.
2016-05-17 12:25:27 -04:00
Vladimir Voroshilov
d621b2f795 lavf: Raw G.729 demuxer
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-05-17 12:24:32 -04:00
Martin Storsjö
34effe816f fate: Update fate-lavf-ts after commit 393596f9d5
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-17 12:41:38 +03:00
Diego Biurrun
b8de14bcdf tools: Port to codec parameters API 2016-05-17 11:16:26 +02:00
Francois Cartegnie
393596f9d5 mpegtsenc: stop impersonating ses in sdt
Unless specified, users must use non registered
range for network id

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-05-17 10:29:36 +02:00
Alexandra Hájková
ffa190d047 Move VLC and RL_VLC_ELEM structure definitions to a separate header
Use the newly created vlc.h directly instead of including get_bits when needed.
The VLC and RL_VLC_ELEM structures are independent from the bitreader.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-05-17 10:29:27 +02:00
Anton Khirnov
b23613268c avconv_dxva2: use the hwcontext API 2016-05-17 09:11:34 +02:00