Some AVCodec properties like pix_fmts or sample_fmts are marked as
deprecated and should be replaced by avcodec_get_supported_config()
in current FFmpeg.
Created compat functions to get rid of deprecate warnings running with
both old and new FFmpeg.
- print error if:
1. `uv -s testcard -A Opus --param audio-lavc-encoder=nonsense`
2. `uv -s testcard -A Opus --param audio-lavc-encoder=libopus` but libopus
was not compiled in
- print requested encoder name if not suitable to encode the codec,
eg. `uv -t testcard -A Opus --param audio-lavc-encoder=AAC`
Currently, libopus is prefered over opus as encoder but only because
opus is marked as experimental; it, however, precedes libopus in FFmpeg
codec_list[] so the native would be selected as soon as the experimental
flag is removed.
Get the info from audio lavc in textual form instead with a new API to
querying additional info about codec for user.
The new API will allow adding additional useful information in help,
eg. encoders present.
this updates the commit a0dd6b9b85
fixes:
```
uv -d decklink:sync -r embedded -t testcard:mode=Hp24 -s embedded -A AAC
```
TS adjustnment was made with input BPS (2 B in example above) but the
data len is already converted for codec (4 B for AAC).
Some codecs (eg. libopus) produce first packet with PTS -120 at 48000 time
base so drop this packet, because we do not support negative timestamps
It would crash on assert in audio_frame2::set_timestamp(), anyways.
can be issue only under some circumstances:
1. reconfiguring audio encoder
2. audio frame is not divisible by chunk_size (codec frame size) so
there was left some data in the buffer
For audio codecs, we respect its native capitalization of letters, eg.
AAC, speex. So do it also for Opus. This should not affect existing
applications since the Opus name is parsed case-insensitively.
Only exception is SDP (rtpmap) where is usually used lower-case (at
least in rfc7587).
This commit is mostly just a refactor - the removed while loop was
actually always run exactly once (supposing that data passed to us
is longer than zero).
Functional changes:
- assuming non-zero input
- returning NULL on error
Supposedly the above changes should not alter UG expected behavior.
It somehow works now but the stream isn't correct, gave up after few
hours of attempts, looks like every second frame (120 samples) is both
temporarily and spatially (inverse value) inverted for some reason.
Returning doesn't make sense, because it would be impossible to drain
the buffer since the call will end up exactly in the same place under
similar circumstances (also with the same data_len).
removed compat with lavc <57.37.100
As commit 342faa1f removed compatibility code with libavcodec
57.107.100 (FFmpeg from 2017), there is no need to keep compatibility
with even older FFmpeg versions.
suppress missing-field-initializers warning when assigning
AVChannelLayout to AVCodecContext::ch_layout. This is C++ specific, the
construction is entirely fine in C (empty-initializes remaining
members).
Rewritten to C - it seems to be a bit invasive, because the rewrite is
quite huge. On the other hand, it cleans the code a bit and also
removes some inefficiencies that there have been (now not possible
because the absence of RAII).