1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-11 03:45:05 +02:00
Commit Graph

25 Commits

Author SHA1 Message Date
Aman Gupta
f45d5e07dd lavc/videotoolboxenc: skip SEI allocation when side data is not present
Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-10-18 19:51:42 -04:00
Carl Eugen Hoyos
f04c27fe7c lavc/videotoolboxenc: Enable a53cc by default. 2016-10-17 17:50:29 +02:00
Rick Kern
d3874b74f3 lavc/videotoolboxenc: Error log formatting.
Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-10-17 08:58:17 -04:00
Rick Kern
9875695e2c lavc/videotoolboxenc: Update a53cc handling
Handles insertion into existing SEI NAL unit, inserts emulation
prevention bytes.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-10-17 08:58:17 -04:00
Rick Kern
aa413b810a lavc/videotoolboxenc: flush/free frames on close
Prevents encode callback from running after codec is closed.
Fixes a crash when an error is returned.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-10-17 08:58:17 -04:00
Aman Gupta
9ea91e4114 lavc/videotoolboxenc: implement a53cc
Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-10-17 08:58:17 -04:00
Rick Kern
8b069b1cd5 lavc/videotoolboxenc: remove unnecessary logging
Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-06-16 21:22:13 -04:00
Rick Kern
98a3355c6a lavc/videotoolboxenc: set extradata when opening codec
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>
2016-06-11 10:30:34 -04:00
Rick Kern
c5a5ca754b lavc/videotoolboxenc: fix allocated buffer size
Allocates a buffer with padding, and with enough room for start codes when
length codes are smaller.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-06-11 10:30:34 -04:00
Rick Kern
dc750194b6 lavc/videotoolboxenc: Set colorimetry values
Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
c356b6865d lavc/videotoolboxenc: Support pixel aspect ratio
Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
9d8a38d20b lavc/videotoolboxenc: Support for forced I-frames
Setting AVFrame.pic_type to AV_PICTURE_TYPE_I will force an I-frame.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
4b806081b2 lavc/videotoolboxenc: add concatentation properties
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>
2016-05-04 18:40:40 +02:00
Rick Kern
ca429e7253 lavc/videotoolboxenc: Add realtime encoding property
Hint to the encoder that encoding should be done in real-time, even at the
expense of quality.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
272dd437bc lavc/videotoolboxenc: Handle out-of-memory and fix memory leak
Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
2fbf39382d lavc/videotoolboxenc: Fix DTS
Some devices output an invalid DTS when B-frames aren't used. Using PTS for
the DTS in this case.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
abe05892be lavc/videotoolboxenc: Fix AVCodecContext.has_b_frames usage.
Now set by the encoder, not used as an input parameter.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
645df43144 lavc/videotoolboxenc: Add entropy setting
Add an entropy setting to choose between CAVLC and CABAC.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
fbe0cf8ca7 lavc/videotoolboxenc: Require hardware encoding
Software encoding can be allowed by setting allow_sw to 1.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
0d4bf3074d lavc/videotoolboxenc: Handle hwaccel format as input
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>
2016-05-04 18:40:40 +02:00
Rick Kern
d7cf3610c2 lavc/videotoolboxenc: Use shared pixel buffer pool
This reduces the chance of a memcpy in the media server.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-05-04 18:40:40 +02:00
Rick Kern
c9ad357aeb lavc/videotoolboxenc: Workaround encoder error
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>
2016-04-02 19:16:20 +02:00
Rick Kern
7801669470 lavc/videotoolboxenc: Fix crash when closing codec after error
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>
2016-04-02 19:16:15 +02:00
Rodger Combs
ecba35bbe3 lavc/videotoolboxenc: remove *_NULLABLE annotations; fixes pre-10.11 build
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.
2016-03-02 21:44:28 -06:00
Rick Kern
3af71ac3f9 lavc: add VideoToolbox H.264 Encoder
Autodetected by default. Encode using -codec:v h264_videotoolbox.

Signed-off-by: Rick Kern <kernrj@gmail.com>
Signed-off-by: wm4 <nfxjfg@googlemail.com>
2016-03-02 21:19:35 +01:00