VideoToolbox doesn't supply parameter sets until the first frame is done
encoding. This spins up a temporary encoder and encodes a single frame to
get this data.
Signed-off-by: Rick Kern <kernrj@gmail.com>
Add frames_before and frames_after as hints that there will be frames before
or after the frames produced in this session. This may help with
concatenation issues like bit rate spikes.
Signed-off-by: Rick Kern <kernrj@gmail.com>
Handle AV_PIX_FMT_VIDEOTOOLBOX.
This results in better energy usage and faster encoding, especially on iOS.
When the buffer comes from the media server, no memcpy's are needed.
Signed-off-by: Rick Kern <kernrj@gmail.com>
CMVideoFormatDescriptionGetH264ParameterSetAtIndex() fails on some
hardware/OS versions when retrieving the parameter set count alone.
Signed-off-by: Rick Kern <kernrj@gmail.com>
Signed-off-by: wm4 <nfxjfg@googlemail.com>
Fixes crash in #5352. VTCompressionSessionInvalidate() crashes if the
internal encoder hasn't completed, but hasn't experienced an error.
The function call isn't needed since the encoder is invalidated when
the reference count reaches 0 anyway.
Signed-off-by: Rick Kern <kernrj@gmail.com>
Signed-off-by: wm4 <nfxjfg@googlemail.com>
These macros were added in OS X 10.11, and the file compiles without warnings
on both 10.10 and 10.11 with them removed.
Thanks to mark4o on IRC for pointing out the failure and testing the patch.
Autodetected by default. Encode using -codec:v h264_videotoolbox.
Signed-off-by: Rick Kern <kernrj@gmail.com>
Signed-off-by: wm4 <nfxjfg@googlemail.com>