当前位置:Gxlcms >
数据库问题 >
HandBrake-QuickSync-Mac (内容:QuickSync encoder via VideoToolbox )
HandBrake-QuickSync-Mac (内容:QuickSync encoder via VideoToolbox )
时间:2021-07-01 10:21:17
帮助过:7人阅读
galad87/HandBrake-QuickSync-Mac
forked from kallisti5/HaikuBrake
QuickSync encoder via VideoToolbox
Implements a new encoder in HandBrake that uses VideoToolbox.framework
to access the hardware h.264 encoder.
1 parent a13430b commit 2c1332958f7095c640cbcbcb45ffc955739d5945
galad87 committed on 20 Jun 2013
Showing
with
540 additions and
14 deletions.
- +10 −8 ?????
- test/module.defs
18 ????? libhb/common.c
| @@ -185,15 +185,16 @@ hb_encoder_t *hb_video_encoders_last_item = NULL; |
| hb_encoder_internal_t hb_video_encoders[] = |
| // legacy encoders, back to HB 0.9.4 whenever possible (disabled) |
| - { { "FFmpeg", "ffmpeg", HB_VCODEC_FFMPEG_MPEG4, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_MPEG4, }, |
| - { { "MPEG-4 (FFmpeg)", "ffmpeg4", HB_VCODEC_FFMPEG_MPEG4, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_MPEG4, }, |
| - { { "MPEG-2 (FFmpeg)", "ffmpeg2", HB_VCODEC_FFMPEG_MPEG2, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_MPEG2, }, |
| - { { "VP3 (Theora)", "libtheora", HB_VCODEC_THEORA, HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_THEORA, }, |
| + { { "FFmpeg", "ffmpeg", HB_VCODEC_FFMPEG_MPEG4, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_MPEG4, }, |
| + { { "MPEG-4 (FFmpeg)", "ffmpeg4", HB_VCODEC_FFMPEG_MPEG4, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_MPEG4, }, |
| + { { "MPEG-2 (FFmpeg)", "ffmpeg2", HB_VCODEC_FFMPEG_MPEG2, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_MPEG2, }, |
| + { { "VP3 (Theora)", "libtheora", HB_VCODEC_THEORA, HB_MUX_MASK_MKV, }, NULL, 0, HB_GID_VCODEC_THEORA, }, |
| - { { "H.264 (x264)", "x264", HB_VCODEC_X264, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_H264, }, |
| - { { "MPEG-4", "mpeg4", HB_VCODEC_FFMPEG_MPEG4, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_MPEG4, }, |
| - { { "MPEG-2", "mpeg2", HB_VCODEC_FFMPEG_MPEG2, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_MPEG2, }, |
| - { { "Theora", "theora", HB_VCODEC_THEORA, HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_THEORA, }, |
| + { { "H.264 (x264)", "x264", HB_VCODEC_X264, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_H264, }, |
| + { { "H.264 (VideoToolbox)", "h264", HB_VCODEC_VT_H264, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_H264, }, |
| + { { "MPEG-4", "mpeg4", HB_VCODEC_FFMPEG_MPEG4, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_MPEG4, }, |
| + { { "MPEG-2", "mpeg2", HB_VCODEC_FFMPEG_MPEG2, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_MPEG2, }, |
| + { { "Theora", "theora", HB_VCODEC_THEORA, HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_THEORA, }, |
| int hb_video_encoders_count = sizeof(hb_video_encoders) / sizeof(hb_video_encoders[0]); |
| static int hb_video_encoder_is_enabled(int encoder) |
| @@ -202,6 +203,7 @@ static int hb_video_encoder_is_enabled(int encoder) |
| // the following encoders are always enabled |
| + case HB_VCODEC_VT_H264: |
| case HB_VCODEC_FFMPEG_MPEG4: |
| case HB_VCODEC_FFMPEG_MPEG2: |
2 ????? libhb/common.h
| @@ -403,6 +403,7 @@ struct hb_job_s |
| #define HB_VCODEC_MASK 0x00000FF |
| #define HB_VCODEC_X264 0x0000001 |
| #define HB_VCODEC_THEORA 0x0000002 |
| +#define HB_VCODEC_VT_H264 0x0000004 |
| #define HB_VCODEC_FFMPEG_MPEG4 0x0000010 |
| #define HB_VCODEC_FFMPEG_MPEG2 0x0000020 |
| #define HB_VCODEC_FFMPEG_MASK 0x00000F0 |
| @@ -1008,6 +1009,7 @@ extern hb_work_object_t hb_encvorbis; |
| extern hb_work_object_t hb_muxer; |
| extern hb_work_object_t hb_encca_aac; |
| extern hb_work_object_t hb_encca_haac; |
| +extern hb_work_object_t hb_encvt_h264; |
| extern hb_work_object_t hb_encavcodeca; |
| extern hb_work_object_t hb_reader; |
1 ?????
libhb/hb.c
| @@ -1644,6 +1644,7 @@ int hb_global_init() |
|
hb_register(&hb_encca_aac);
|
|
hb_register(&hb_encca_haac);
|
|
+ hb_register(&hb_encvt_h264);
|
|
hb_register(&hb_encfaac);
|
1 ?????
libhb/internal.h
1 ?????
libhb/muxmkv.c
| @@ -97,6 +97,7 @@ static int MKVInit( hb_mux_object_t * m ) |
|
+ case HB_VCODEC_VT_H264:
|
|
track->codecID = MK_VCODEC_MP4AVC;
|
|
/* Taken from x264 muxers.c */
|
|
avcC_len = 5 + 1 + 2 + job->config.h264.sps_length + 1 + 2 + job->config.h264.pps_length;
|
10 ?????
libhb/muxmp4.c
| @@ -129,7 +129,7 @@ static int MP4Init( hb_mux_object_t * m ) |
|
- if( job->vcodec == HB_VCODEC_X264 )
|
|
+ if( job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_VT_H264 )
|
|
/* Stolen from mp4creator */
|
|
MP4SetVideoProfileLevel( m->file, 0x7F );
|
| @@ -684,7 +684,7 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data, |
|
if( mux_data == job->mux_data )
|
|
- if( job->vcodec == HB_VCODEC_X264 ||
|
|
+ if( job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_VT_H264 ||
|
|
( job->vcodec & HB_VCODEC_FFMPEG_MASK ) )
|
|
if ( buf && buf->s.start < buf->s.renderOffset )
|
| @@ -706,7 +706,7 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data, |
|
stop = buf->s.start + buf->s.duration;
|
|
- if( job->vcodec == HB_VCODEC_X264 ||
|
|
+ if( job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_VT_H264 ||
|
|
( job->vcodec & HB_VCODEC_FFMPEG_MASK ) )
|
|
// x264 supplies us with DTS, so offset is PTS - DTS
|
| @@ -744,7 +744,7 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data, |
|
- if( job->vcodec == HB_VCODEC_X264 ||
|
|
+ if( job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_VT_H264 ||
|
|
( job->vcodec & HB_VCODEC_FFMPEG_MASK ) )
|
|
// x264 supplies us with DTS
|
| @@ -822,7 +822,7 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data, |
|
/* Here‘s where the sample actually gets muxed. */
|
|
- if( ( job->vcodec == HB_VCODEC_X264 ||
|
|
+ if( ( job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_VT_H264||
|
|
( job->vcodec & HB_VCODEC_FFMPEG_MASK ) )
|
|
&& mux_data == job->mux_data )
|
498 ?????
libhb/platform/macosx/encvt_h264.c
|
+ Copyright (c) 2003-2013 HandBrake Team
|
|
+ This file is part of the HandBrake source code
|
|
+ Homepage: <http://handbrake.fr/>.
|
|
+ It may be used under the terms of the GNU General Public License v2.
|
|
+ For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html
|
|
+#include <VideoToolbox/VideoToolbox.h>
|
|
+#include <CoreMedia/CoreMedia.h>
|
|
+#include <CoreVideo/CoreVideo.h>
|
|
+int encvt_h264Init( hb_work_object_t *, hb_job_t * );
|
|
+int encvt_h264Work( hb_work_object_t *, hb_buffer_t **, hb_buffer_t ** );
|
|
+void encvt_h264Close( hb_work_object_t * );
|
|
+hb_work_object_t hb_encvt_h264 =
|